aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-12 21:37:11 +0000
committerChris Lattner <sabre@nondot.org>2006-07-12 21:37:11 +0000
commit981418bf1562d0b5b470ddc7d0034c9f3297b893 (patch)
tree7462120d620d388fb59f05b3197ef7a3acd06a5b /lib/Transforms/Utils/InlineFunction.cpp
parentbcfb913df0def0cb9f866e7811229768334144f3 (diff)
Handle instructions in the map, but that map to a null pointer.
This unbreaks smg2000. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29127 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp
index eeb69116ed..c6f5075f64 100644
--- a/lib/Transforms/Utils/InlineFunction.cpp
+++ b/lib/Transforms/Utils/InlineFunction.cpp
@@ -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))