See rational here: https://reviews.llvm.org/D71847#1922648
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks, yes, this is what I had in mind.
llvm/include/llvm/Frontend/OpenMP/OMPContext.h | ||
---|---|---|
49 | LLVM doesn't use the all uppercase naming style for enums, I'd use something like Count, Num, or Max. One technique you could use to avoid the sentinel enum is to make an alias for the last enum, as is done for builtin types here: | |
152 | This is the same instantiation, so we don't get any savings unless the same technique is applied here. I started by trying to change this type, but it was challenging, so I raised the issue to see if you'd be OK with it. | |
llvm/lib/Frontend/OpenMP/OMPContext.cpp | ||
132 | Worth fixing this formatting nit |
lgtm, as long as you are OK with the casts as the code author.
llvm/lib/Frontend/OpenMP/OMPContext.cpp | ||
---|---|---|
130–132 | I expected BitVector to expose an API to do this without iterating the bits individually, but I can't find one. test seems close, but not quite right. Oh well. |
LLVM doesn't use the all uppercase naming style for enums, I'd use something like Count, Num, or Max.
One technique you could use to avoid the sentinel enum is to make an alias for the last enum, as is done for builtin types here:
https://github.com/llvm/llvm-project/blob/master/clang/include/clang/AST/Type.h#L2514
Then you won't have to handle NUM_PROPERTIES below, and you would use TraitProperty::Max + 1 for the BitVector.