Handle instructions in the map, but that map to a null pointer.
authorChris Lattner <sabre@nondot.org>
Wed, 12 Jul 2006 21:37:11 +0000 (21:37 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 12 Jul 2006 21:37:11 +0000 (21:37 +0000)
This unbreaks smg2000.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29127 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/InlineFunction.cpp

index eeb69116ed551262e5d33b02bb72e1b45e71c0d4..c6f5075f6403b13e3228940e5a09e9eeeaba87fa 100644 (file)
@@ -157,7 +157,8 @@ static void UpdateCallGraphAfterInlining(const Function *Caller,
     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))