summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets/X86.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2017-11-15 00:11:24 +0000
committerErich Keane <erich.keane@intel.com>2017-11-15 00:11:24 +0000
commit8202521cf57bf1cbe77e3fe3228e15580b1388d3 (patch)
tree362ac5e11aa9ebbd6dbc68b38913b9b52a8cf797 /clang/lib/Basic/Targets/X86.cpp
parentede2449fd150b8bfdbd4f63744a818076de46b58 (diff)
downloadbcm5719-llvm-8202521cf57bf1cbe77e3fe3228e15580b1388d3.tar.gz
bcm5719-llvm-8202521cf57bf1cbe77e3fe3228e15580b1388d3.zip
Simplify CpuIs code to use include from LLVM
LLVM exposes a file in the backend (X86TargetParser.def) that contains information about the correct list of CpuIs values. This patch removes 2 of the copied and pasted versions of this list from clang and instead includes the data from the .def file. Differential Revision: https://reviews.llvm.org/D40054 llvm-svn: 318234
Diffstat (limited to 'clang/lib/Basic/Targets/X86.cpp')
-rw-r--r--clang/lib/Basic/Targets/X86.cpp36
1 files changed, 6 insertions, 30 deletions
diff --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp
index a08ba478a0b..4c58acebb54 100644
--- a/clang/lib/Basic/Targets/X86.cpp
+++ b/clang/lib/Basic/Targets/X86.cpp
@@ -1291,36 +1291,12 @@ bool X86TargetInfo::validateCpuSupports(StringRef FeatureStr) const {
// rather than the full range of cpus.
bool X86TargetInfo::validateCpuIs(StringRef FeatureStr) const {
return llvm::StringSwitch<bool>(FeatureStr)
- .Case("amd", true)
- .Case("amdfam10h", true)
- .Case("amdfam15h", true)
- .Case("amdfam17h", true)
- .Case("atom", true)
- .Case("barcelona", true)
- .Case("bdver1", true)
- .Case("bdver2", true)
- .Case("bdver3", true)
- .Case("bdver4", true)
- .Case("bonnell", true)
- .Case("broadwell", true)
- .Case("btver1", true)
- .Case("btver2", true)
- .Case("core2", true)
- .Case("corei7", true)
- .Case("haswell", true)
- .Case("intel", true)
- .Case("istanbul", true)
- .Case("ivybridge", true)
- .Case("knl", true)
- .Case("nehalem", true)
- .Case("sandybridge", true)
- .Case("shanghai", true)
- .Case("silvermont", true)
- .Case("skylake", true)
- .Case("skylake-avx512", true)
- .Case("slm", true)
- .Case("westmere", true)
- .Case("znver1", true)
+#define X86_VENDOR(ENUM, STRING) .Case(STRING, true)
+#define X86_CPU_TYPE_COMPAT_WITH_ALIAS(ARCHNAME, ENUM, STR, ALIAS) \
+ .Cases(STR, ALIAS, true)
+#define X86_CPU_TYPE_COMPAT(ARCHNAME, ENUM, STR) .Case(STR, true)
+#define X86_CPU_SUBTYPE_COMPAT(ARCHNAME, ENUM, STR) .Case(STR, true)
+#include "llvm/Support/X86TargetParser.def"
.Default(false);
}
OpenPOWER on IntegriCloud