mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-30 23:20:54 +00:00
ValueMapper: Unduplicate RF_NoModuleLevelChanges check, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265761 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
11a3cfb7db
commit
86c8abfe54
@ -651,10 +651,12 @@ Optional<Metadata *> Mapper::mapSimpleMetadata(const Metadata *MD) {
|
|||||||
if (isa<MDString>(MD))
|
if (isa<MDString>(MD))
|
||||||
return mapToSelf(MD);
|
return mapToSelf(MD);
|
||||||
|
|
||||||
if (auto *CMD = dyn_cast<ConstantAsMetadata>(MD)) {
|
// This is a module-level metadata. If nothing at the module level is
|
||||||
if ((Flags & RF_NoModuleLevelChanges))
|
// changing, use an identity mapping.
|
||||||
return mapToSelf(MD);
|
if ((Flags & RF_NoModuleLevelChanges))
|
||||||
|
return mapToSelf(MD);
|
||||||
|
|
||||||
|
if (auto *CMD = dyn_cast<ConstantAsMetadata>(MD)) {
|
||||||
// Disallow recursion into metadata mapping through mapValue.
|
// Disallow recursion into metadata mapping through mapValue.
|
||||||
VM.disableMapMetadata();
|
VM.disableMapMetadata();
|
||||||
Value *MappedV = mapValue(CMD->getValue());
|
Value *MappedV = mapValue(CMD->getValue());
|
||||||
@ -668,11 +670,6 @@ Optional<Metadata *> Mapper::mapSimpleMetadata(const Metadata *MD) {
|
|||||||
|
|
||||||
assert(isa<MDNode>(MD) && "Expected a metadata node");
|
assert(isa<MDNode>(MD) && "Expected a metadata node");
|
||||||
|
|
||||||
// If this is a module-level metadata and we know that nothing at the
|
|
||||||
// module level is changing, then use an identity mapping.
|
|
||||||
if (Flags & RF_NoModuleLevelChanges)
|
|
||||||
return mapToSelf(MD);
|
|
||||||
|
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user