Enable CPU detection when using MS VS 2k8 too.
authorTorok Edwin <edwintorok@gmail.com>
Sat, 12 Dec 2009 12:42:31 +0000 (12:42 +0000)
committerTorok Edwin <edwintorok@gmail.com>
Sat, 12 Dec 2009 12:42:31 +0000 (12:42 +0000)
MSVS2k8 doesn't define __i386__, hence all the CPU detection code was disabled.
Enable it by looking for _MSC_VER.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91217 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Host.cpp

index e112698349ee72991fa95b4c912c535dca3b714b..2e02609bcb8d6cf29380d7445864b9c790c21489 100644 (file)
@@ -107,7 +107,7 @@ static void DetectX86FamilyModel(unsigned EAX, unsigned &Family, unsigned &Model
 
 
 std::string sys::getHostCPUName() {
 
 
 std::string sys::getHostCPUName() {
-#if defined(__x86_64__) || defined(__i386__)
+#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";
   unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
   if (GetX86CpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX))
     return "generic";