diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-30 23:03:37 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-30 23:03:37 +0000 |
commit | 9e9a0d5fc26878e51a58a8b57900fcbf952c2691 (patch) | |
tree | 477eb7b58abe6134ff6accc805279396a77892e8 /lib/Transforms/Utils/Local.cpp | |
parent | 124e6eb09d47674a4bac48a522e83e4513a970e5 (diff) |
Move more code back to 2.5 APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | lib/Transforms/Utils/Local.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index e9be0e263b..18ce81d143 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -263,8 +263,6 @@ void llvm::RecursivelyDeleteTriviallyDeadInstructions(Value *V) { /// too, recursively. void llvm::RecursivelyDeleteDeadPHINode(PHINode *PN) { - LLVMContext &Context = PN->getContext(); - // We can remove a PHI if it is on a cycle in the def-use graph // where each node in the cycle has degree one, i.e. only one use, // and is an instruction with no side effects. @@ -281,7 +279,7 @@ llvm::RecursivelyDeleteDeadPHINode(PHINode *PN) { if (PHINode *JP = dyn_cast<PHINode>(J)) if (!PHIs.insert(cast<PHINode>(JP))) { // Break the cycle and delete the PHI and its operands. - JP->replaceAllUsesWith(Context.getUndef(JP->getType())); + JP->replaceAllUsesWith(UndefValue::get(JP->getType())); RecursivelyDeleteTriviallyDeadInstructions(JP); break; } @@ -301,7 +299,7 @@ void llvm::MergeBasicBlockIntoOnlyPred(BasicBlock *DestBB) { while (PHINode *PN = dyn_cast<PHINode>(DestBB->begin())) { Value *NewVal = PN->getIncomingValue(0); // Replace self referencing PHI with undef, it must be dead. - if (NewVal == PN) NewVal = DestBB->getContext().getUndef(PN->getType()); + if (NewVal == PN) NewVal = UndefValue::get(PN->getType()); PN->replaceAllUsesWith(NewVal); PN->eraseFromParent(); } |