[PATCH] D122832: [TableGen] Add a backend to help with target enums

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 02:40:28 PDT 2022


frasercrmck added a comment.

Looking again, the way AMDGPU use `GenericEnum` (in particular the `FilterClass`) is different to how I'd envisaged enums. For example,`MIMGDim : GenericEnum { let FilterClass = "AMDGPUDimProps"; }` allows the creation of an enum from a completely different complex class without having to manually enumerate them, since it just pulls in all defs of the `AMDGPUDimProps` class. I'd originally done something similar but found that relying on alphabetical order can be restrictive in its own sense, so I used `list<EnumMember> Members`. I feel there's a valid use case for both behaviours.

Is there a way we can support both in the same class? A toggling of behaviour between `FilterClass` //or// `Members`? Or something like if `FilterClass` is a subclass of `EnumMembers` it could pull in members in a different way. Might be a little convoluted.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122832



More information about the llvm-commits mailing list