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

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 13:15:17 PDT 2016


asbirlea 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
----------------
echristo wrote:
> 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.
Planning to add to lib/builtins, which appears C only.
Keeping the code close to what will go in compiler-rt seemed a good idea.


http://reviews.llvm.org/D20970





More information about the llvm-commits mailing list