summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-30 23:03:37 +0000
committerOwen Anderson <resistor@mac.com>2009-07-30 23:03:37 +0000
commitb292b8ce708d8d5fa4286f1bc2855d6ac0d0f526 (patch)
tree4847eb648a3d471bdd4b7653a8f83ad5cb4224bd /llvm/lib/Transforms/Utils/Local.cpp
parent5ac2f49516d8624d998873dbd322e22f0ee5f358 (diff)
downloadbcm5719-llvm-b292b8ce708d8d5fa4286f1bc2855d6ac0d0f526.tar.gz
bcm5719-llvm-b292b8ce708d8d5fa4286f1bc2855d6ac0d0f526.zip
Move more code back to 2.5 APIs.
llvm-svn: 77635
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index e9be0e263b8..18ce81d1437 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/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();
}
OpenPOWER on IntegriCloud