19 #include "llvm/ADT/StringSwitch.h" 21 using namespace clang;
25 #define BUILTIN(ID, TYPE, ATTRS) \ 26 {#ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr}, 27 #define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) \ 28 {#ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES, nullptr}, 29 #include "clang/Basic/BuiltinsWebAssembly.def" 32 bool WebAssemblyTargetInfo::hasFeature(StringRef Feature)
const {
33 return llvm::StringSwitch<bool>(Feature)
34 .Case(
"simd128", SIMDLevel >= SIMD128)
35 .Case(
"nontrapping-fptoint", HasNontrappingFPToInt)
39 bool WebAssemblyTargetInfo::isValidCPUName(StringRef Name)
const {
40 return llvm::StringSwitch<bool>(Name)
42 .Case(
"bleeding-edge",
true)
43 .Case(
"generic",
true)
50 if (SIMDLevel >= SIMD128)
54 bool WebAssemblyTargetInfo::handleTargetFeatures(
56 for (
const auto &Feature : Features) {
57 if (Feature ==
"+simd128") {
58 SIMDLevel =
std::max(SIMDLevel, SIMD128);
61 if (Feature ==
"-simd128") {
62 SIMDLevel =
std::min(SIMDLevel, SIMDEnum(SIMD128 - 1));
65 if (Feature ==
"+nontrapping-fptoint") {
66 HasNontrappingFPToInt =
true;
69 if (Feature ==
"-nontrapping-fptoint") {
70 HasNontrappingFPToInt =
false;
74 Diags.
Report(diag::err_opt_not_valid_with_opt)
75 << Feature <<
"-target-feature";
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Concrete class used by the front-end to report problems and issues.
Defines the Diagnostic-related interfaces.
char __ovld __cnfn min(char x, char y)
Returns y if y < x, otherwise it returns x.
Enumerates target-specific builtins in their own namespaces within namespace clang.
Dataflow Directional Tag Classes.
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods --------------------——===//
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods --------------------——===//
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods --------------------——===//
char __ovld __cnfn max(char x, char y)
Returns y if x < y, otherwise it returns x.
void defineCPUMacros(MacroBuilder &Builder, StringRef CPUName, bool Tuning)
void defineMacro(const Twine &Name, const Twine &Value="1")
Append a #define line for macro of the form "\#define Name Value\n".
Defines enum values for all the target-independent builtin functions.