summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitb3c64f7ab38182823722cdf389891db4861d9584 (patch)
tree55156d2091e4174147e038c4d9f5506837034034 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parentdea9202e3b0ff7062885655c37dce906888ba2df (diff)
downloadbcm5719-llvm-b3c64f7ab38182823722cdf389891db4861d9584.tar.gz
bcm5719-llvm-b3c64f7ab38182823722cdf389891db4861d9584.zip
Handle instructions in the map, but that map to a null pointer.
This unbreaks smg2000. llvm-svn: 29127
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp3
1 files changed, 2 insertions, 1 deletions
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<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))
OpenPOWER on IntegriCloud