mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-30 15:10:33 +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))
|
||||
return mapToSelf(MD);
|
||||
|
||||
if (auto *CMD = dyn_cast<ConstantAsMetadata>(MD)) {
|
||||
if ((Flags & RF_NoModuleLevelChanges))
|
||||
return mapToSelf(MD);
|
||||
// This is a module-level metadata. If nothing at the module level is
|
||||
// changing, use an identity mapping.
|
||||
if ((Flags & RF_NoModuleLevelChanges))
|
||||
return mapToSelf(MD);
|
||||
|
||||
if (auto *CMD = dyn_cast<ConstantAsMetadata>(MD)) {
|
||||
// Disallow recursion into metadata mapping through mapValue.
|
||||
VM.disableMapMetadata();
|
||||
Value *MappedV = mapValue(CMD->getValue());
|
||||
@ -668,11 +670,6 @@ Optional<Metadata *> Mapper::mapSimpleMetadata(const Metadata *MD) {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user