Skip to content

Commit

Permalink
[TableGen] Resolve References at top level
Browse files Browse the repository at this point in the history
Add a dummy resolver to resolve references outside records. This invokes
Fold() with isFinal to force resolution.

Fixes llvm#102447
  • Loading branch information
optimisan committed Aug 16, 2024
1 parent b145038 commit 051f74a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion llvm/lib/TableGen/TGParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4460,8 +4460,13 @@ bool TGParser::ParseDump(MultiClass *CurMultiClass, Record *CurRec) {

if (CurRec)
CurRec->addDump(Loc, Message);
else
else {
HasReferenceResolver resolver{nullptr};
resolver.setFinal(true);
// force a resolution with a dummy resolver
Message->resolveReferences(resolver);
addEntry(std::make_unique<Record::DumpInfo>(Loc, Message));
}

return false;
}

0 comments on commit 051f74a

Please sign in to comment.