add some helpful comments to the emitter
[oota-llvm.git] / utils / TableGen / DAGISelMatcherEmitter.cpp
index d2eab2741cbc31f78bb90d2473abb4b3306469a1..7c0846a9df983829933f8d5d282409103886c04b 100644 (file)
@@ -204,6 +204,12 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
       assert(ChildSize != 0 && "Should not have a zero-sized child!");
     
       CurrentIdx += EmitVBRValue(ChildSize, OS);
+      OS << "/*->" << CurrentIdx+ChildSize << "*/";
+      
+      if (i == 0)
+        OS.PadToColumn(CommentIndent) << "// " << SM->getNumChildren()
+          << " children in Scope";
+      
       OS << '\n' << TmpBuf.str();
       CurrentIdx += ChildSize;
     }