diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-17 18:53:24 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-17 18:53:24 +0000 |
commit | 3d555ac96d8b23106a6eaf970c0382f84266bc4c (patch) | |
tree | 50bc234bdf2bfcf26fd98350e30697e6048bcec9 /llvm/lib/Transforms/Utils/ValueMapper.cpp | |
parent | 3c1c9875b9749e4e644b7fd783993a1c74a006f9 (diff) | |
download | bcm5719-llvm-3d555ac96d8b23106a6eaf970c0382f84266bc4c.tar.gz bcm5719-llvm-3d555ac96d8b23106a6eaf970c0382f84266bc4c.zip |
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/ValueMapper.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/ValueMapper.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index f8fa61329e2..84dcb42a749 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -341,8 +341,10 @@ Value *Mapper::mapValue(const Value *V) { ValueToValueMapTy::iterator I = getVM().find(V); // If the value already exists in the map, use it. - if (I != getVM().end() && I->second) + if (I != getVM().end()) { + assert(I->second && "Unexpected null mapping"); return I->second; + } // If we have a materializer and it can materialize a value, use that. if (auto *Materializer = getMaterializer()) { |