TableGen: Generate valid identifiers for anonymous records
[oota-llvm.git] / lib / TableGen / TGParser.h
index 044e3a02ba4bc7e200075bec56482576b13711bb..a5753458108e3d94b6c4e72e8d951bd6d8d4053a 100644 (file)
@@ -69,6 +69,8 @@ class TGParser {
   // Record tracker
   RecordKeeper &Records;
 
+  unsigned AnonCounter;
+
   // A "named boolean" indicating how to parse identifiers.  Usually
   // identifiers map to some existing object but in special cases
   // (e.g. parsing def names) no such object exists yet because we are
@@ -82,8 +84,8 @@ class TGParser {
   };
 
 public:
-  TGParser(SourceMgr &SrcMgr, RecordKeeper &records) :
-    Lex(SrcMgr), CurMultiClass(0), Records(records) {}
+  TGParser(SourceMgr &SrcMgr, RecordKeeper &records)
+      : Lex(SrcMgr), CurMultiClass(0), Records(records), AnonCounter(0) {}
 
   /// ParseFile - Main entrypoint for parsing a tblgen file.  These parser
   /// routines return true on error, or false on success.
@@ -112,6 +114,8 @@ private:  // Semantic analysis methods.
   bool AddSubMultiClass(MultiClass *CurMC,
                         SubMultiClassReference &SubMultiClass);
 
+  std::string GetNewAnonymousName();
+
   // IterRecord: Map an iterator name to a value.
   struct IterRecord {
     VarInit *IterVar;