change the new isel matcher to emit ComplexPattern matches
[oota-llvm.git] / utils / TableGen / DAGISelMatcherEmitter.cpp
index 1f0405038c6bd54d1e834e197d8bb42b474fa3f3..63c854b748e7098523edd49caef054c50e2207da 100644 (file)
@@ -370,17 +370,22 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
     return 2;
 
   case Matcher::CheckComplexPat: {
-    const ComplexPattern &Pattern =
-      cast<CheckComplexPatMatcher>(N)->getPattern();
-    OS << "OPC_CheckComplexPat, " << getComplexPat(Pattern) << ',';
+    const CheckComplexPatMatcher *CCPM = cast<CheckComplexPatMatcher>(N);
+    const ComplexPattern &Pattern = CCPM->getPattern();
+    OS << "OPC_CheckComplexPat, /*CP*/" << getComplexPat(Pattern) << ", /*#*/"
+       << CCPM->getMatchNumber() << ',';
+    
     if (!OmitComments) {
       OS.PadToColumn(CommentIndent) << "// " << Pattern.getSelectFunc();
-      OS << ": " << Pattern.getNumOperands() << " operands";
+      OS << ":$" << CCPM->getName();
+      for (unsigned i = 0, e = Pattern.getNumOperands(); i != e; ++i)
+        OS << " #" << CCPM->getFirstResult()+i;
+           
       if (Pattern.hasProperty(SDNPHasChain))
-        OS << " + chain result and input";
+        OS << " + chain result";
     }
     OS << '\n';
-    return 2;
+    return 3;
   }
       
   case Matcher::CheckAndImm: {