[PATCH] D47431: TableGen: Allow foreach in multiclass to depend on template args

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 4 09:19:12 PDT 2018


simon_tatham added inline comments.


================
Comment at: lib/TableGen/TGParser.cpp:2917
 
-    TemplateArgs.emplace_back(QualifiedNameOfImplicitName(MC), DefmName);
-
-    // Loop over all the def's in the multiclass, instantiating each one.
-    for (const std::unique_ptr<Record> &DefProto : MC->DefPrototypes) {
-      auto CurRec = make_unique<Record>(*DefProto);
-      CurRec->appendLoc(SubClassLoc);
+    Substs.emplace_back(QualifiedNameOfImplicitName(MC), DefmName);
 
----------------
While you're looking at this code, should this be tracking whether the DefmName you're adding to Substs here was explicitly given by the user, or made up anonymously on line 2861?

I feel as if the end-product record that comes out of the whole chain of defms and foreaches ought to have its 'anonymous' flag set if //any// defm or def on the way to it was anonymous, because in that case some part of the final name will include something TableGen made up.


Repository:
  rL LLVM

https://reviews.llvm.org/D47431





More information about the llvm-commits mailing list