aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-18 06:14:59 +0000
committerChris Lattner <sabre@nondot.org>2003-10-18 06:14:59 +0000
commit3c4a34e8db5057458d7590b85e9819b7b4c4a7b8 (patch)
tree496cfe64576aeb01c5585970c105f4daa86a1cf1
parent4d45bd007d0c3a3a6e5b3876b67fd495acb0db2b (diff)
downloadexternal_llvm-3c4a34e8db5057458d7590b85e9819b7b4c4a7b8.zip
external_llvm-3c4a34e8db5057458d7590b85e9819b7b4c4a7b8.tar.gz
external_llvm-3c4a34e8db5057458d7590b85e9819b7b4c4a7b8.tar.bz2
Fix PR#50
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9227 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Utils/PromoteMemoryToRegister.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index 1692745..0292f9e 100644
--- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -269,12 +269,12 @@ void PromoteMem2Reg::run() {
// At this point, the blocks left in the preds list must have dummy
// entries inserted into every PHI nodes for the block.
- for (unsigned i = 0, e = PNs.size(); i != e; ++i) {
- PHINode *PN = PNs[i];
- Value *NullVal = Constant::getNullValue(PN->getType());
- for (unsigned pred = 0, e = Preds.size(); pred != e; ++pred)
- PN->addIncoming(NullVal, Preds[pred]);
- }
+ for (unsigned i = 0, e = PNs.size(); i != e; ++i)
+ if (PHINode *PN = PNs[i]) {
+ Value *NullVal = Constant::getNullValue(PN->getType());
+ for (unsigned pred = 0, e = Preds.size(); pred != e; ++pred)
+ PN->addIncoming(NullVal, Preds[pred]);
+ }
}
}
}