]> granicus.if.org Git - clang/commitdiff
[X86] Use the CPUKind enum from PROC_ALIAS to directly get the CPUKind in fillValidCP...
authorCraig Topper <craig.topper@intel.com>
Thu, 21 Mar 2019 17:33:20 +0000 (17:33 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 21 Mar 2019 17:33:20 +0000 (17:33 +0000)
We were using getCPUKind which translates the string to the enum also using PROC_ALIAS. This just cuts out the string compares.

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

lib/Basic/Targets/X86.cpp

index 87a954fcfd384abb71d6b1edd5d9f7fa08291073..fa5ffd5e801d884b380d64773d0efa9561cff963 100644 (file)
@@ -1819,10 +1819,9 @@ void X86TargetInfo::fillValidCPUList(SmallVectorImpl<StringRef> &Values) const {
 #define PROC(ENUM, STRING, IS64BIT)                                            \
   if (IS64BIT || getTriple().getArch() == llvm::Triple::x86)                   \
     Values.emplace_back(STRING);
-  // Go through CPUKind checking to ensure that the alias is de-aliased and
-  // 64 bit-ness is checked.
+  // For aliases we need to lookup the CPUKind to check get the 64-bit ness.
 #define PROC_ALIAS(ENUM, ALIAS)                                                \
-  if (checkCPUKind(getCPUKind(ALIAS)))                                         \
+  if (checkCPUKind(CK_##ENUM))                                                      \
     Values.emplace_back(ALIAS);
 #include "clang/Basic/X86Target.def"
 }