diff options
author | Chris Lattner <sabre@nondot.org> | 2006-07-12 21:37:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-07-12 21:37:11 +0000 |
commit | b3c64f7ab38182823722cdf389891db4861d9584 (patch) | |
tree | 55156d2091e4174147e038c4d9f5506837034034 /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | dea9202e3b0ff7062885655c37dce906888ba2df (diff) | |
download | bcm5719-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.cpp | 3 |
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)) |