Changes in directory llvm/lib/Transforms/Utils:

LCSSA.cpp updated: 1.28 -> 1.29
---
Log message:

Fix PR977: http://llvm.org/PR977  and 
Transforms/LCSSA/2006-10-31-UnreachableBlock.ll


---
Diffs of the changes:  (+8 -1)

 LCSSA.cpp |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Utils/LCSSA.cpp
diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.28 
llvm/lib/Transforms/Utils/LCSSA.cpp:1.29
--- llvm/lib/Transforms/Utils/LCSSA.cpp:1.28    Sun Aug 27 17:42:52 2006
+++ llvm/lib/Transforms/Utils/LCSSA.cpp Tue Oct 31 11:52:18 2006
@@ -184,7 +184,14 @@
     
     // Otherwise, patch up uses of the value with the appropriate LCSSA Phi,
     // inserting PHI nodes into join points where needed.
-    Value *Val = GetValueForBlock(DT->getNode(UserBB), Instr, Phis);
+    DominatorTree::Node *UserBBNode = DT->getNode(UserBB);
+         
+    // If the block has no dominator info, it is unreachable.
+    Value *Val;
+    if (UserBBNode)
+      Val = GetValueForBlock(UserBBNode, Instr, Phis);
+    else
+      Val = UndefValue::get(Instr->getType());
     
     // Preincrement the iterator to avoid invalidating it when we change the
     // value.



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to