[llvm-tblgen] Support conditional definitions using !casts clauses
authorPhilip Reames <preames@rivosinc.com>
Fri, 10 Mar 2023 23:49:27 +0000 (15:49 -0800)
committerPhilip Reames <listmail@philipreames.com>
Fri, 10 Mar 2023 23:50:11 +0000 (15:50 -0800)
commit8a4451cdc3fffe121e5b5a0bddb7f44457dd0753
tree94d5c2ecf1e9db6e333cbd9a85734a34ddd9d51a
parentc3801568ef2b7f923f9116f72a6b0bb382bcaa41
[llvm-tblgen] Support conditional definitions using !casts clauses

This is a follow on to D145108. This started as simply fixing the crash on an error case reported against that change, but I think this also ends up fixing the original reported issue (https://github.com/llvm/llvm-project/issues/49830) as well. More accurately, D145108 fixed the case where the cast resolves to an existing record, and this change fixes the case where the named record doesn't exist.

Differential Revision: https://reviews.llvm.org/D145711
llvm/lib/TableGen/Record.cpp
llvm/test/TableGen/if-unresolved-cast.td [new file with mode: 0644]