mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 19:25:00 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user