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

Yuxuan Chen via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 25 09:27:14 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;
+
----------------
yuxuanchen1997 wrote:

I commented on my original PR that passing pointers to field while assuming a different signedness is not good. What about passing pointers to entire struct? That would required the struct to be named but I think we should be fine by that?

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


More information about the llvm-commits mailing list