[PATCH] D152998: [TableGen] Support named arguments

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 12:49:59 PDT 2023


reames requested changes to this revision.
reames added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/include/llvm/TableGen/Record.h:516
 // Represent a positional argument.
 class PositionalArgumentInit : public ArgumentInit, public FoldingSetNode {
   unsigned Index;
----------------
I'm not 100% on this, but I don't think sub-classing is the right model here.  I think this code would be a lot easier to follow with a single ArgumentInit class with an optional index, an optional name, and a value.  A single isPositionalArg() method then let's you dispatch in the few places you need to.


================
Comment at: llvm/lib/TableGen/TGParser.cpp:741
 ///
-SubClassReference TGParser::
-ParseSubClassReference(Record *CurRec, bool isDefm) {
+SubClassReference TGParser::ParseSubClassReference(Record *CurRec,
+                                                   bool IsDefm) {
----------------
Stray change, remove.


================
Comment at: llvm/lib/TableGen/TGParser.h:280
 
-  SubClassReference ParseSubClassReference(Record *CurRec, bool isDefm);
+  SubClassReference ParseSubClassReference(Record *CurRec, bool IsDefm);
   SubMultiClassReference ParseSubMultiClassReference(MultiClass *CurMC);
----------------
Stray change, remove.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152998/new/

https://reviews.llvm.org/D152998



More information about the llvm-commits mailing list