[llvm] r266823 - [TableGen] Make an error message slightly more informative

Nicolai Haehnle via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 14:58:10 PDT 2016


Author: nha
Date: Tue Apr 19 16:58:10 2016
New Revision: 266823

URL: http://llvm.org/viewvc/llvm-project?rev=266823&view=rev
Log:
[TableGen] Make an error message slightly more informative

Reviewers: ab, spop, stoklund

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19192

Modified:
    llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp

Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp?rev=266823&r1=266822&r2=266823&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp Tue Apr 19 16:58:10 2016
@@ -2974,9 +2974,16 @@ const DAGInstruction &CodeGenDAGPatterns
   // fill in the InstResults map.
   for (unsigned j = 0, e = I->getNumTrees(); j != e; ++j) {
     TreePatternNode *Pat = I->getTree(j);
-    if (Pat->getNumTypes() != 0)
+    if (Pat->getNumTypes() != 0) {
+      std::string Types;
+      for (unsigned k = 0, ke = Pat->getNumTypes(); k != ke; ++k) {
+        if (k > 0)
+          Types += ", ";
+        Types += Pat->getExtType(k).getName();
+      }
       I->error("Top-level forms in instruction pattern should have"
-               " void types");
+               " void types, has types " + Types);
+    }
 
     // Find inputs and outputs, and verify the structure of the uses/defs.
     FindPatternInputsAndOutputs(I, Pat, InstInputs, InstResults,




More information about the llvm-commits mailing list