[PATCH] D20970: [cpu-detection] Naming convention

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 12:44:15 PDT 2016


echristo added inline comments.

================
Comment at: lib/Support/Host.cpp:189-190
@@ -189,7 +188,4 @@
 
-static void DetectX86FamilyModel(unsigned EAX, unsigned &Family,
-                                 unsigned &Model) {
-  Family = (EAX >> 8) & 0xf; // Bits 8 - 11
-  Model = (EAX >> 4) & 0xf;  // Bits 4 - 7
-  if (Family == 6 || Family == 0xf) {
-    if (Family == 0xf)
+static void detectX86FamilyModel(unsigned EAX, unsigned *Family,
+                                 unsigned *Model) {
+  *Family = (EAX >> 8) & 0xf; // Bits 8 - 11
----------------
asbirlea wrote:
> echristo wrote:
> > Why are you changing the references to pointers?
> 1. Consistency withe the above methods.
> 2. Planning to port the same code into compiler-rt/ as ***.c (it will address Bug 25510).
I'd almost rather change the other methods :)

And I believe we can use c++ in compiler-rt - at least the sanitizers do.


http://reviews.llvm.org/D20970





More information about the llvm-commits mailing list