diff options
author | Erich Keane <erich.keane@intel.com> | 2018-02-08 23:16:55 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2018-02-08 23:16:55 +0000 |
commit | e44bdb3f70918c67c99326e12f929e0466a20f9d (patch) | |
tree | 86ea268a8deeaed4bd51a4d6d912dd96c76eacd5 /clang/lib/Basic/Targets/WebAssembly.cpp | |
parent | d45879d8add0c2d831f89bc638f75e23b75e9a72 (diff) | |
download | bcm5719-llvm-e44bdb3f70918c67c99326e12f929e0466a20f9d.tar.gz bcm5719-llvm-e44bdb3f70918c67c99326e12f929e0466a20f9d.zip |
Add Rest of Targets Support to ValidCPUList (enabling march notes)
A followup to: https://reviews.llvm.org/D42978
Most of the rest of the Targets were pretty rote, so this
patch knocks them all out at once.
Differential Revision: https://reviews.llvm.org/D43057
llvm-svn: 324676
Diffstat (limited to 'clang/lib/Basic/Targets/WebAssembly.cpp')
-rw-r--r-- | clang/lib/Basic/Targets/WebAssembly.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/lib/Basic/Targets/WebAssembly.cpp b/clang/lib/Basic/Targets/WebAssembly.cpp index ecccb588659..4338d03ade0 100644 --- a/clang/lib/Basic/Targets/WebAssembly.cpp +++ b/clang/lib/Basic/Targets/WebAssembly.cpp @@ -29,6 +29,9 @@ const Builtin::Info WebAssemblyTargetInfo::BuiltinInfo[] = { #include "clang/Basic/BuiltinsWebAssembly.def" }; +static constexpr llvm::StringLiteral ValidCPUNames[] = { + {"mvp"}, {"bleeding-edge"}, {"generic"}}; + bool WebAssemblyTargetInfo::hasFeature(StringRef Feature) const { return llvm::StringSwitch<bool>(Feature) .Case("simd128", SIMDLevel >= SIMD128) @@ -38,11 +41,12 @@ bool WebAssemblyTargetInfo::hasFeature(StringRef Feature) const { } bool WebAssemblyTargetInfo::isValidCPUName(StringRef Name) const { - return llvm::StringSwitch<bool>(Name) - .Case("mvp", true) - .Case("bleeding-edge", true) - .Case("generic", true) - .Default(false); + return llvm::find(ValidCPUNames, Name) != std::end(ValidCPUNames); +} + +void WebAssemblyTargetInfo::fillValidCPUList( + SmallVectorImpl<StringRef> &Values) const { + Values.append(std::begin(ValidCPUNames), std::end(ValidCPUNames)); } void WebAssemblyTargetInfo::getTargetDefines(const LangOptions &Opts, |