summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-08-03 17:37:10 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-08-03 17:37:10 +0000
commitfa8ef91748db3c9c890d90653eafad7652b704f6 (patch)
treee4ae787c930f472dd8c392f0f0764a6708742f5d /llvm/lib/Transforms
parent5d05763761758c7ab425f32221571b94d4bd2b61 (diff)
downloadbcm5719-llvm-fa8ef91748db3c9c890d90653eafad7652b704f6.tar.gz
bcm5719-llvm-fa8ef91748db3c9c890d90653eafad7652b704f6.zip
[CloneFunction] Don't crash if the value map doesn't hold something
It is possible for the value map to not have an entry for some value that has already been removed. I don't have a testcase, this is fall-out from a buildbot. llvm-svn: 277614
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index e6aa85c2aaa..4f0088246ea 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -562,7 +562,7 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
// Note that we must test the size on each iteration, the worklist can grow.
for (unsigned Idx = 0; Idx != Worklist.size(); ++Idx) {
const Value *OrigV = Worklist[Idx];
- auto *I = cast<Instruction>(VMap.lookup(OrigV));
+ auto *I = cast_or_null<Instruction>(VMap.lookup(OrigV));
if (!I)
continue;
OpenPOWER on IntegriCloud