Skip to content

Commit 44ce487

Browse files
committed
[TableGen] Emit more helpful error messages on empty type set
I have seen this error quite frequently in our out-of-tree CHERI backends and the lack of location information sometimes makes it quite difficult to track down the actual source of the error. This patch changes the llvm_unreachable() to a PrintFatalError() so that tablegen prints a stack of source locations. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D99468
1 parent ce193ea commit 44ce487

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/utils/TableGen/CodeGenDAGPatterns.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,11 @@ TypeInfer::ValidateOnExit::~ValidateOnExit() {
846846
"(use -print-records with llvm-tblgen to see all "
847847
"expanded records).\n";
848848
Infer.TP.dump();
849-
llvm_unreachable(nullptr);
849+
dbgs() << "Generated from record:\n";
850+
Infer.TP.getRecord()->dump();
851+
PrintFatalError(Infer.TP.getRecord()->getLoc(),
852+
"Type set is empty for each HW mode in '" +
853+
Infer.TP.getRecord()->getName() + "'");
850854
}
851855
}
852856
#endif

0 commit comments

Comments
 (0)