[PATCH] D91632: [TableGen] [ISel Matcher Emitter] Rework with two passes: one to size, one to emit

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 03:25:17 PST 2020


RKSimon added inline comments.


================
Comment at: llvm/utils/TableGen/DAGISelMatcher.h:92
+    // Highest enum value; watch out when adding more.
+    HighestKind = MorphNodeTo
   };
----------------
Paul-C-Anagnostopoulos wrote:
> RKSimon wrote:
> > We seem to mainly use this as "HighestKind + 1" - wouldn't a NumOfKinds / KindCount value be better (and wouldn't need the assignment to the previous enum value).
> > ```
> >   MorphNodeTo, // Build a node, finish a match and update results.
> >   KindCount        // Total number of kind types.
> > ```
> I had that originally but changed my mind. Why? . . . Ah, because then the compiler complains when it isn't included in a switch on the kind. Is there a trick I don't know? Using default: just seems confusing.
> 
OK - no worries for now then


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

https://reviews.llvm.org/D91632



More information about the llvm-commits mailing list