mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
MapMetadata: Allow unresolved metadata if it won't change
Allow unresolved nodes through the `MapMetadata()` if `RF_NoModuleLevelChanges`, since there's no remapping to do anyway. This fixes PR22929. I'll add a clang test as a follow-up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232449 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -291,14 +291,18 @@ static Metadata *MapMetadataImpl(const Metadata *MD,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Note: this cast precedes the Flags check so we always get its associated
|
||||
// assertion.
|
||||
const MDNode *Node = cast<MDNode>(MD);
|
||||
assert(Node->isResolved() && "Unexpected unresolved 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(VM, MD);
|
||||
|
||||
// Require resolved nodes whenever metadata might be remapped.
|
||||
assert(Node->isResolved() && "Unexpected unresolved node");
|
||||
|
||||
if (Node->isDistinct())
|
||||
return mapDistinctNode(Node, Cycles, VM, Flags, TypeMapper, Materializer);
|
||||
|
||||
|
Reference in New Issue
Block a user