aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-17 18:53:24 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-17 18:53:24 +0000
commit3d555ac96d8b23106a6eaf970c0382f84266bc4c (patch)
tree50bc234bdf2bfcf26fd98350e30697e6048bcec9 /llvm/lib/Transforms/Utils/CloneFunction.cpp
parent3c1c9875b9749e4e644b7fd783993a1c74a006f9 (diff)
downloadllvm-3d555ac96d8b23106a6eaf970c0382f84266bc4c.zip
llvm-3d555ac96d8b23106a6eaf970c0382f84266bc4c.tar.gz
llvm-3d555ac96d8b23106a6eaf970c0382f84266bc4c.tar.bz2
ValueMapper: Don't allow explicit null mappings of Values, NFC
As a follow-up to r123058, assert that there are no null mappings in the ValueMap instead of just ignoring them when they are there. There were a couple of accidental insertions in CloneFunction so I cleaned those up (caught by testcases). llvm-svn: 266565
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 41d340b..781238e 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -346,7 +346,7 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB,
ConstantInt *Cond = dyn_cast<ConstantInt>(BI->getCondition());
// Or is a known constant in the caller...
if (!Cond) {
- Value *V = VMap[BI->getCondition()];
+ Value *V = VMap.lookup(BI->getCondition());
Cond = dyn_cast_or_null<ConstantInt>(V);
}
@@ -449,7 +449,7 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
// Defer PHI resolution until rest of function is resolved.
SmallVector<const PHINode*, 16> PHIToResolve;
for (const BasicBlock &BI : *OldFunc) {
- Value *V = VMap[&BI];
+ Value *V = VMap.lookup(&BI);
BasicBlock *NewBB = cast_or_null<BasicBlock>(V);
if (!NewBB) continue; // Dead block.