Skip to content

Commit

Permalink
ValueMapper: Fix unused var warning. NFC
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266529 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
atanasyan committed Apr 16, 2016
1 parent 492acdd commit db4fbb6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Transforms/Utils/ValueMapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,15 @@ bool MDNodeMapper::mapOperand(const Metadata *Op) {
return false;

if (Optional<Metadata *> MappedOp = M.mapSimpleMetadata(Op)) {
#ifndef NDEBUG
if (auto *CMD = dyn_cast<ConstantAsMetadata>(Op))
assert((!*MappedOp || M.getVM().count(CMD->getValue()) ||
M.getVM().getMappedMD(Op)) &&
"Expected Value to be memoized");
else
assert((isa<MDString>(Op) || M.getVM().getMappedMD(Op)) &&
"Expected result to be memoized");
#endif
return *MappedOp != Op;
}

Expand Down

0 comments on commit db4fbb6

Please sign in to comment.