[llvm-commits] CVS: llvm/lib/Transforms/Utils/InlineFunction.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jul 12 14:37:23 PDT 2006



Changes in directory llvm/lib/Transforms/Utils:

InlineFunction.cpp updated: 1.44 -> 1.45
---
Log message:

Handle instructions in the map, but that map to a null pointer.
This unbreaks smg2000.


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

 InlineFunction.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Utils/InlineFunction.cpp
diff -u llvm/lib/Transforms/Utils/InlineFunction.cpp:1.44 llvm/lib/Transforms/Utils/InlineFunction.cpp:1.45
--- llvm/lib/Transforms/Utils/InlineFunction.cpp:1.44	Wed Jul 12 13:37:18 2006
+++ llvm/lib/Transforms/Utils/InlineFunction.cpp	Wed Jul 12 16:37:11 2006
@@ -157,7 +157,8 @@
     const Instruction *OrigCall = I->first.getInstruction();
     
     std::map<const Value*, Value*>::iterator VMI = ValueMap.find(OrigCall);
-    if (VMI != ValueMap.end()) { // Only copy the edge if the call was inlined!
+    // Only copy the edge if the call was inlined!
+    if (VMI != ValueMap.end() && VMI->second) {
       // If the call was inlined, but then constant folded, there is no edge to
       // add.  Check for this case.
       if (Instruction *NewCall = dyn_cast<Instruction>(VMI->second))






More information about the llvm-commits mailing list