aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Instructions.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
commit9e9a0d5fc26878e51a58a8b57900fcbf952c2691 (patch)
tree477eb7b58abe6134ff6accc805279396a77892e8 /lib/VMCore/Instructions.cpp
parent124e6eb09d47674a4bac48a522e83e4513a970e5 (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/VMCore/Instructions.cpp')
-rw-r--r--lib/VMCore/Instructions.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 08b4396307..368914652d 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -187,7 +187,7 @@ Value *PHINode::removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty) {
// If the PHI node is dead, because it has zero entries, nuke it now.
if (NumOps == 2 && DeletePHIIfEmpty) {
// If anyone is using this PHI, make them use a dummy value instead...
- replaceAllUsesWith(getType()->getContext().getUndef(getType()));
+ replaceAllUsesWith(UndefValue::get(getType()));
eraseFromParent();
}
return Removed;
@@ -231,8 +231,7 @@ Value *PHINode::hasConstantValue(bool AllowNonDominatingInstruction) const {
if (getIncomingValue(0) != this) // not X = phi X
return getIncomingValue(0);
else
- return
- getType()->getContext().getUndef(getType()); // Self cycle is dead.
+ return UndefValue::get(getType()); // Self cycle is dead.
}
// Otherwise if all of the incoming values are the same for the PHI, replace
@@ -254,7 +253,7 @@ Value *PHINode::hasConstantValue(bool AllowNonDominatingInstruction) const {
// that only has entries for itself. In this case, there is no entry into the
// loop, so kill the PHI.
//
- if (InVal == 0) InVal = getType()->getContext().getUndef(getType());
+ if (InVal == 0) InVal = UndefValue::get(getType());
// If we have a PHI node like phi(X, undef, X), where X is defined by some
// instruction, we cannot always return X as the result of the PHI node. Only