[llvm-commits] [llvm] r91240 - /llvm/trunk/lib/System/Host.cpp

Torok Edwin edwintorok at gmail.com
Sun Dec 13 00:59:41 PST 2009


Author: edwin
Date: Sun Dec 13 02:59:40 2009
New Revision: 91240

URL: http://llvm.org/viewvc/llvm-project?rev=91240&view=rev
Log:
Using _MSC_VER there was wrong, better just use the already existing ifdefs for
x86 CPU detection for the X86 getHostCPUName too, and create a simple
getHostCPUName that returns "generic" for all else.

Modified:
    llvm/trunk/lib/System/Host.cpp

Modified: llvm/trunk/lib/System/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Host.cpp?rev=91240&r1=91239&r2=91240&view=diff

==============================================================================
--- llvm/trunk/lib/System/Host.cpp (original)
+++ llvm/trunk/lib/System/Host.cpp Sun Dec 13 02:59:40 2009
@@ -103,11 +103,8 @@
     Model += ((EAX >> 16) & 0xf) << 4; // Bits 16 - 19
   }
 }
-#endif
-
 
 std::string sys::getHostCPUName() {
-#if defined(__x86_64__) || defined(__i386__) || defined(_MSC_VER)
   unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
   if (GetX86CpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX))
     return "generic";
@@ -295,7 +292,9 @@
       return "generic";
     }
   }
-#endif
-
+}
+#else
+std::string sys::getHostCPUName() {
   return "generic";
 }
+#endif





More information about the llvm-commits mailing list