[PATCH] D91632: [TableGen] [ISel Matcher Emitter] Rework with two passes: one to size, one to emit
Paul C. Anagnostopoulos via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 19 06:01:41 PST 2020
Paul-C-Anagnostopoulos added inline comments.
================
Comment at: llvm/utils/TableGen/DAGISelMatcher.h:92
+ // Highest enum value; watch out when adding more.
+ HighestKind = MorphNodeTo
};
----------------
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.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91632/new/
https://reviews.llvm.org/D91632
More information about the llvm-commits
mailing list