cleanup/simplify

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80706 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-09-01 18:50:55 +00:00
parent 2af658fcc0
commit 7c8c1ba40c

View File

@ -331,9 +331,8 @@ CallGraphNode *SRETPromotion::updateCallSites(Function *F, Function *NF) {
if (C2 && (C2 == Call))
continue;
if (GetElementPtrInst *UGEP = dyn_cast<GetElementPtrInst>(U2)) {
ConstantInt *Idx = dyn_cast<ConstantInt>(UGEP->getOperand(2));
assert (Idx && "Unexpected getelementptr index!");
GetElementPtrInst *UGEP = cast<GetElementPtrInst>(U2);
ConstantInt *Idx = cast<ConstantInt>(UGEP->getOperand(2));
Value *GR = ExtractValueInst::Create(New, Idx->getZExtValue(),
"evi", UGEP);
while(!UGEP->use_empty()) {
@ -346,9 +345,6 @@ CallGraphNode *SRETPromotion::updateCallSites(Function *F, Function *NF) {
UGEP->eraseFromParent();
continue;
}
assert(0 && "Unexpected sret parameter use");
}
Call->eraseFromParent();
}