[compiler-rt] [compiler-rt] Restore unsigned value in struct, use enum only in function (PR #165048)

Mikołaj Piróg via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 25 06:18:07 PDT 2025


================
@@ -661,14 +677,22 @@ static const char *getIntelProcessorTypeAndSubtype(
     break; // Unknown.
   }
 
+  if (Type != CPU_TYPE_MAX)
+    __cpu_model.__cpu_type = Type;
+  if (Subtype != CPU_SUBTYPE_MAX)
+    __cpu_model.__cpu_subtype = Subtype;
+
----------------
mikolaj-pirog wrote:

I understand the downsides, but I believe in this file it's not gonna be a problem, especially how the function is local.

I can refactor later to not use the global like that, but the previous solution of passing a pointer to some fields of the global isn't much different than what the code is doing now

https://github.com/llvm/llvm-project/pull/165048


More information about the llvm-commits mailing list