[llvm] [Offload] Define additional device info properties (PR #152533)
Callum Fare via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 8 09:25:11 PDT 2025
================
@@ -107,10 +107,22 @@ void EmitOffloadInfo(const RecordKeeper &Records, raw_ostream &OS) {
)";
- auto ErrorCodeEnum = EnumRec{Records.getDef("DeviceInfo")};
- uint32_t EtorVal = 0;
- for (const auto &EnumVal : ErrorCodeEnum.getValues()) {
- OS << formatv(TAB_1 "OFFLOAD_DEVINFO({0}, \"{1}\", {2})\n",
- EnumVal.getName(), EnumVal.getDesc(), EtorVal++);
+ auto Enum = EnumRec{Records.getDef("DeviceInfo")};
+
+ uint32_t EtorVal = Enum.isBitField();
----------------
callumfare wrote:
Nitpick: It's a little unclear what's going on here at first glance. Could do with a comment that says bitfield values must start at 1, but regular enums start at 0.
https://github.com/llvm/llvm-project/pull/152533
More information about the llvm-commits
mailing list