diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-07-16 21:03:44 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-07-16 21:03:44 +0000 |
commit | bde6869ef4bf1c8b1c620c570ea340c8b2d3d269 (patch) | |
tree | 1008426d6e33e154c20e7c1c566951d27805129f /lib/Transforms/Utils | |
parent | 384152444d22d356f7b4090a158da4cbc1f79464 (diff) | |
download | external_llvm-bde6869ef4bf1c8b1c620c570ea340c8b2d3d269.zip external_llvm-bde6869ef4bf1c8b1c620c570ea340c8b2d3d269.tar.gz external_llvm-bde6869ef4bf1c8b1c620c570ea340c8b2d3d269.tar.bz2 |
Return Undef if the block has no dominator. This was required to allow
llvm-gcc build to succeed. Without this change it fails in libstdc++
compilation. This causes no regressions in dejagnu tests. However,
someone who knows this code better might want to review it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39924 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/LCSSA.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp index 3f4bad5..220241d 100644 --- a/lib/Transforms/Utils/LCSSA.cpp +++ b/lib/Transforms/Utils/LCSSA.cpp @@ -231,6 +231,10 @@ Value *LCSSA::GetValueForBlock(DomTreeNode *BB, Instruction *OrigInst, DomTreeNode *IDom = BB->getIDom(); + // If the block has no dominator, bail + if (!IDom) + return V = UndefValue::get(OrigInst->getType()); + // Otherwise, there are two cases: we either have to insert a PHI node or we // don't. We need to insert a PHI node if this block is not dominated by one // of the exit nodes from the loop (the loop could have multiple exits, and |