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

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 13:16:45 PDT 2016


echristo accepted this revision.
echristo added a comment.
This revision is now accepted and ready to land.

LGTM.

Thanks!


================
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:
> > 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.
That seems like a good idea for now.


http://reviews.llvm.org/D20970





More information about the llvm-commits mailing list