diff options
author | Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> | 2021-03-31 09:24:03 +0100 |
---|---|---|
committer | Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> | 2021-03-31 09:24:03 +0100 |
commit | 44ce487bfe8badc3e3718e7cc81c289540e6725d (patch) | |
tree | bd7ec6800a1b4ae7acda594cc0f8cc87ae19eb94 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | ce193ea9e8430f15d19dd60d73f13a66e4f374ac (diff) | |
download | llvm-44ce487bfe8badc3e3718e7cc81c289540e6725d.zip llvm-44ce487bfe8badc3e3718e7cc81c289540e6725d.tar.gz llvm-44ce487bfe8badc3e3718e7cc81c289540e6725d.tar.bz2 |
[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
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index 1b996f0..ce6e090 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -846,7 +846,11 @@ TypeInfer::ValidateOnExit::~ValidateOnExit() { "(use -print-records with llvm-tblgen to see all " "expanded records).\n"; Infer.TP.dump(); - llvm_unreachable(nullptr); + dbgs() << "Generated from record:\n"; + Infer.TP.getRecord()->dump(); + PrintFatalError(Infer.TP.getRecord()->getLoc(), + "Type set is empty for each HW mode in '" + + Infer.TP.getRecord()->getName() + "'"); } } #endif |