From b3c64f7ab38182823722cdf389891db4861d9584 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 12 Jul 2006 21:37:11 +0000 Subject: Handle instructions in the map, but that map to a null pointer. This unbreaks smg2000. llvm-svn: 29127 --- llvm/lib/Transforms/Utils/InlineFunction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp') diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index eeb69116ed5..c6f5075f640 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -157,7 +157,8 @@ static void UpdateCallGraphAfterInlining(const Function *Caller, const Instruction *OrigCall = I->first.getInstruction(); std::map::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(VMI->second)) -- cgit v1.2.3