[llvm] [TableGen] Use PrintFatalError in ParseTreePattern when DAG has zero operands, so that llvm-tblgen doesn't crash (PR #161417)
Prerona Chaudhuri via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 2 13:31:37 PDT 2025
================
@@ -19,21 +19,21 @@ def INSTR_BAR : Instruction {
}
#ifdef ERROR1
-// ERROR1: [[@LINE+1]]:1: error: {{.*}} Invalid number of type casts!
+// ERROR1: error: Invalid number of type casts!
----------------
pchaudhuri-nv wrote:
I was wondering if we can use PrintError instead or PrintFatalError, because ParseTreePattern does return nullptr even before my change. However for the test in the bug, FindPatternInputsAndOutputs then crashes because it doesn't handle the case when the children of Pat are nullptr.
Should I then also fix FindPatternInputsAndOutputs, so that we can use PrintError in ParseCastOperand ?
https://github.com/llvm/llvm-project/pull/161417
More information about the llvm-commits
mailing list