[PATCH] D43757: TableGen: Remove the ResolveFirst mechanism

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 6 05:53:02 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL326789: TableGen: Remove the ResolveFirst mechanism (authored by nha, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D43757

Files:
  llvm/trunk/include/llvm/TableGen/Record.h
  llvm/trunk/lib/TableGen/TGParser.cpp


Index: llvm/trunk/lib/TableGen/TGParser.cpp
===================================================================
--- llvm/trunk/lib/TableGen/TGParser.cpp
+++ llvm/trunk/lib/TableGen/TGParser.cpp
@@ -2722,12 +2722,6 @@
       if (ResolveMulticlassDef(*MC, CurRec, DefProto.get(), DefmLoc))
         return Error(SubClassLoc, "could not instantiate def");
 
-      // Defs that can be used by other definitions should be fully resolved
-      // before any use.
-      if (DefProto->isResolveFirst() && !CurMultiClass) {
-        CurRec->resolveReferences();
-        CurRec->setResolveFirst(false);
-      }
       NewRecDefs.push_back(CurRec);
     }
 
Index: llvm/trunk/include/llvm/TableGen/Record.h
===================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h
+++ llvm/trunk/include/llvm/TableGen/Record.h
@@ -1288,18 +1288,6 @@
 
   bool IsAnonymous;
 
-  // Class-instance values can be used by other defs.  For example, Struct<i>
-  // is used here as a template argument to another class:
-  //
-  //   multiclass MultiClass<int i> {
-  //     def Def : Class<Struct<i>>;
-  //
-  // These need to get fully resolved before instantiating any other
-  // definitions that use them (e.g. Def).  However, inside a multiclass they
-  // can't be immediately resolved so we mark them ResolveFirst to fully
-  // resolve them later as soon as the multiclass is instantiated.
-  bool ResolveFirst = false;
-
   void init();
   void checkName();
 
@@ -1323,7 +1311,7 @@
     Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
     Values(O.Values), SuperClasses(O.SuperClasses),
     TrackedRecords(O.TrackedRecords), ID(LastID++),
-    IsAnonymous(O.IsAnonymous), ResolveFirst(O.ResolveFirst) { }
+    IsAnonymous(O.IsAnonymous) { }
 
   static unsigned getNewUID() { return LastID++; }
 
@@ -1461,14 +1449,6 @@
     return IsAnonymous;
   }
 
-  bool isResolveFirst() const {
-    return ResolveFirst;
-  }
-
-  void setResolveFirst(bool b) {
-    ResolveFirst = b;
-  }
-
   void print(raw_ostream &OS) const;
   void dump() const;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43757.137174.patch
Type: text/x-patch
Size: 2095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180306/d90be7e8/attachment.bin>


More information about the llvm-commits mailing list