[PATCH] D102740: Convert TableGen assert to error

Stephen Neuendorffer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 18 17:12:42 PDT 2021


stephenneuendorffer created this revision.
stephenneuendorffer requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This gives a nice message about the location of errors in a large
tablegen file, which is much more useful for users


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102740

Files:
  llvm/utils/TableGen/CodeGenDAGPatterns.cpp


Index: llvm/utils/TableGen/CodeGenDAGPatterns.cpp
===================================================================
--- llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -2853,7 +2853,8 @@
         ParseTreePattern(Dag->getArg(0), Dag->getArgNameStr(0));
 
     // Apply the type cast.
-    assert(New->getNumTypes() == 1 && "FIXME: Unhandled");
+    if (New->getNumTypes() != 1)
+      error("Type case can only have one type!");
     const CodeGenHwModes &CGH = getDAGPatterns().getTargetInfo().getHwModes();
     New->UpdateNodeType(0, getValueTypeByHwMode(Operator, CGH), *this);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102740.346311.patch
Type: text/x-patch
Size: 631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210519/d983105f/attachment.bin>


More information about the llvm-commits mailing list