diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-02-10 15:23:53 -0800 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-02-10 16:53:21 -0800 |
commit | fa35c1f80f0ea080a7cbc581416929b0a654f25c (patch) | |
tree | 8d867ee62c0769a96ec8858ffbf1432bfe85714d /llvm/lib/Transforms/Utils/ValueMapper.cpp | |
parent | edd365c7098d212172b6e94a793910a8e1a0f521 (diff) | |
download | llvm-fa35c1f80f0ea080a7cbc581416929b0a654f25c.zip llvm-fa35c1f80f0ea080a7cbc581416929b0a654f25c.tar.gz llvm-fa35c1f80f0ea080a7cbc581416929b0a654f25c.tar.bz2 |
ValueMapper: Rename RF_MoveDistinctMDs => RF_ReuseAndMutateDistinctMDs, NFC
Rename the `RF_MoveDistinctMDs` flag passed into `MapValue` and
`MapMetadata` to `RF_ReuseAndMutateDistinctMDs` in order to more
precisely describe its effect and clarify the header documentation.
Found this while helping to investigate PR48841, which pointed out an
unsound use of the flag in `CloneModule()`. For now I've just added a
FIXME there, but I'm hopeful that the new (more precise) name will
prevent other similar errors.
Diffstat (limited to 'llvm/lib/Transforms/Utils/ValueMapper.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/ValueMapper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index 930e0b7..9557fa9 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -547,7 +547,7 @@ MDNode *MDNodeMapper::mapDistinctNode(const MDNode &N) { assert(N.isDistinct() && "Expected a distinct node"); assert(!M.getVM().getMappedMD(&N) && "Expected an unmapped node"); DistinctWorklist.push_back( - cast<MDNode>((M.Flags & RF_MoveDistinctMDs) + cast<MDNode>((M.Flags & RF_ReuseAndMutateDistinctMDs) ? M.mapToSelf(&N) : M.mapToMetadata(&N, cloneOrBuildODR(N)))); return DistinctWorklist.back(); |