You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
llvm-tblgen crashes if "lookup" operators are used on the top level when the looked-up record does not exist.
I define "lookup" operators as !exists<type>(str) and !cast<type>(expr).
td file to reproduce this issue: (run llvm-tblgen file.td)
class Test{}
dump !cast<Test>("non-existent record");
Assertion failure:
llvm-tblgen: ~/llvm-project/llvm/lib/TableGen/Error.cpp:176: void llvm::dumpMessage(llvm::SMLoc, llvm::Init*): Assertion `MessageInit && "no debug message to print"' failed.
This is happening because references to records are only resolved once the Record parsing is finished. But at the top level there is no Record and so the resolution never happens.
I don't see a fix without adding a new mechanism to resolve top level references. The existing resolveReferences() method only works on a Record, which does not exist here. I can think of two approaches: 1. Create a dummy record for the top level and this single statement (RecordVal), or, 2. Create new methods to handle top level resolutions without the enclosing record.
The text was updated successfully, but these errors were encountered:
Add a dummy resolver to resolve references outside records. This invokes
Fold() with isFinal to force resolution.
Fixes#102447
Co-authored-by: Akshat Oke <Akshat.Oke@amd.com>
llvm-tblgen
crashes if "lookup" operators are used on the top level when the looked-up record does not exist.I define "lookup" operators as
!exists<type>(str)
and!cast<type>(expr)
.td
file to reproduce this issue: (runllvm-tblgen file.td
)Assertion failure:
This is happening because references to records are only resolved once the Record parsing is finished. But at the top level there is no Record and so the resolution never happens.
I don't see a fix without adding a new mechanism to resolve top level references. The existing
resolveReferences()
method only works on aRecord
, which does not exist here. I can think of two approaches: 1. Create a dummy record for the top level and this single statement (RecordVal
), or, 2. Create new methods to handle top level resolutions without the enclosing record.The text was updated successfully, but these errors were encountered: