[llvm] bbd3999 - Convert TableGen assert to error
Stephen Neuendorffer via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 1 13:18:42 PDT 2021
Author: Stephen Neuendorffer
Date: 2021-06-01T13:17:58-07:00
New Revision: bbd399954b8913293176ad61db74c4d3675ad0bc
URL: https://github.com/llvm/llvm-project/commit/bbd399954b8913293176ad61db74c4d3675ad0bc
DIFF: https://github.com/llvm/llvm-project/commit/bbd399954b8913293176ad61db74c4d3675ad0bc.diff
LOG: Convert TableGen assert to error
This gives a nice message about the location of errors in a large
tablegen file, which is much more useful for users
Differential Revision: https://reviews.llvm.org/D102740
Added:
Modified:
llvm/utils/TableGen/CodeGenDAGPatterns.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index 14e248f2c248d..c1a3a34d928bb 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -2853,7 +2853,8 @@ TreePatternNodePtr TreePattern::ParseTreePattern(Init *TheInit,
ParseTreePattern(Dag->getArg(0), Dag->getArgNameStr(0));
// Apply the type cast.
- assert(New->getNumTypes() == 1 && "FIXME: Unhandled");
+ if (New->getNumTypes() != 1)
+ error("Type cast can only have one type!");
const CodeGenHwModes &CGH = getDAGPatterns().getTargetInfo().getHwModes();
New->UpdateNodeType(0, getValueTypeByHwMode(Operator, CGH), *this);
More information about the llvm-commits
mailing list