[llvm-commits] [llvm] r52606 - in /llvm/trunk/lib/Transforms: IPO/LowerSetJmp.cpp IPO/RaiseAllocations.cpp Scalar/ConstantProp.cpp Scalar/GCSE.cpp Utils/CodeExtractor.cpp Utils/InlineFunction.cpp Utils/Local.cpp
Dan Gohman
gohman at apple.com
Sat Jun 21 15:08:46 PDT 2008
Author: djg
Date: Sat Jun 21 17:08:46 2008
New Revision: 52606
URL: http://llvm.org/viewvc/llvm-project?rev=52606&view=rev
Log:
Use Instruction::eraseFromParent().
Modified:
llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp
llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp
llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp
llvm/trunk/lib/Transforms/Scalar/GCSE.cpp
llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp
llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
llvm/trunk/lib/Transforms/Utils/Local.cpp
Modified: llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp?rev=52606&r1=52605&r2=52606&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp Sat Jun 21 17:08:46 2008
@@ -440,7 +440,7 @@
// Replace all uses of this instruction with the PHI node created by
// the eradication of setjmp.
Inst->replaceAllUsesWith(PHI);
- Inst->getParent()->getInstList().erase(Inst);
+ Inst->eraseFromParent();
++SetJmpsTransformed;
}
@@ -478,10 +478,10 @@
// Replace the old call inst with the invoke inst and remove the call.
CI.replaceAllUsesWith(II);
- CI.getParent()->getInstList().erase(&CI);
+ CI.eraseFromParent();
// The old terminator is useless now that we have the invoke inst.
- Term->getParent()->getInstList().erase(Term);
+ Term->eraseFromParent();
++CallsTransformed;
}
Modified: llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp?rev=52606&r1=52605&r2=52606&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp Sat Jun 21 17:08:46 2008
@@ -177,7 +177,7 @@
BranchInst::Create(II->getNormalDest(), I);
// Delete the old call site
- MI->getParent()->getInstList().erase(I);
+ I->eraseFromParent();
Changed = true;
++NumRaised;
}
Modified: llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp?rev=52606&r1=52605&r2=52606&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp Sat Jun 21 17:08:46 2008
@@ -79,7 +79,7 @@
// Remove the dead instruction.
WorkList.erase(I);
- I->getParent()->getInstList().erase(I);
+ I->eraseFromParent();
// We made a change to the function...
Changed = true;
Modified: llvm/trunk/lib/Transforms/Scalar/GCSE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GCSE.cpp?rev=52606&r1=52605&r2=52606&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GCSE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GCSE.cpp Sat Jun 21 17:08:46 2008
@@ -201,5 +201,5 @@
}
// Erase the instruction from the program.
- I->getParent()->getInstList().erase(I);
+ I->eraseFromParent();
}
Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=52606&r1=52605&r2=52606&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Sat Jun 21 17:08:46 2008
@@ -550,18 +550,18 @@
ReturnInst::Create(Constant::getNullValue(OldFnRetTy), TheSwitch);
}
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
+ TheSwitch->eraseFromParent();
break;
case 1:
// Only a single destination, change the switch into an unconditional
// branch.
BranchInst::Create(TheSwitch->getSuccessor(1), TheSwitch);
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
+ TheSwitch->eraseFromParent();
break;
case 2:
BranchInst::Create(TheSwitch->getSuccessor(1), TheSwitch->getSuccessor(2),
call, TheSwitch);
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
+ TheSwitch->eraseFromParent();
break;
default:
// Otherwise, make the default destination of the switch instruction be one
Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=52606&r1=52605&r2=52606&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Sat Jun 21 17:08:46 2008
@@ -119,7 +119,7 @@
BranchInst::Create(InvokeDest, UI);
// Delete the unwind instruction!
- UI->getParent()->getInstList().pop_back();
+ UI->eraseFromParent();
// Update any PHI nodes in the exceptional block to indicate that
// there is now a new entry in them.
@@ -455,10 +455,10 @@
TheCall->replaceAllUsesWith(R->getReturnValue());
}
// Since we are now done with the Call/Invoke, we can delete it.
- TheCall->getParent()->getInstList().erase(TheCall);
+ TheCall->eraseFromParent();
// Since we are now done with the return instruction, delete it also.
- Returns[0]->getParent()->getInstList().erase(Returns[0]);
+ Returns[0]->eraseFromParent();
// We are now done with the inlining.
return true;
Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=52606&r1=52605&r2=52606&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Sat Jun 21 17:08:46 2008
@@ -159,7 +159,7 @@
BranchInst::Create(SI->getSuccessor(1), SI->getSuccessor(0), Cond, SI);
// Delete the old switch...
- SI->getParent()->getInstList().erase(SI);
+ SI->eraseFromParent();
return true;
}
}
More information about the llvm-commits
mailing list