[llvm] [Offload] Define additional device info properties (PR #152533)
Rafal Bielski via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 8 07:20:24 PDT 2025
================
@@ -131,17 +131,32 @@ static void ProcessEnum(const EnumRec &Enum, raw_ostream &OS) {
OS << formatv("/// @brief {0}\n", Enum.getDesc());
OS << formatv("typedef enum {0} {{\n", Enum.getName());
- uint32_t EtorVal = 0;
+ uint32_t EtorVal = Enum.isBitField();
for (const auto &EnumVal : Enum.getValues()) {
- if (Enum.isTyped()) {
- OS << MakeComment(
- formatv("[{0}] {1}", EnumVal.getTaggedType(), EnumVal.getDesc())
- .str());
- } else {
- OS << MakeComment(EnumVal.getDesc());
- }
- OS << formatv(TAB_1 "{0}_{1} = {2},\n", Enum.getEnumValNamePrefix(),
- EnumVal.getName(), EtorVal++);
+ size_t NumTemplateValues{EnumVal.getTemplateValues().size()};
+ size_t TemplateIndex{
----------------
rafbiels wrote:
I went with the latter suggestion and a for-loop with always processed `i==0`:
```cpp
for (size_t i{0}; i == 0 || i < EnumVal.getTemplateValues().size(); ++i)
```
https://github.com/llvm/llvm-project/pull/152533
More information about the llvm-commits
mailing list