diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-18 06:14:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-18 06:14:59 +0000 |
commit | 3c4a34e8db5057458d7590b85e9819b7b4c4a7b8 (patch) | |
tree | 496cfe64576aeb01c5585970c105f4daa86a1cf1 | |
parent | 4d45bd007d0c3a3a6e5b3876b67fd495acb0db2b (diff) | |
download | external_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.cpp | 12 |
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]); + } } } } |