summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets/WebAssembly.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2017-11-28 01:13:45 +0000
committerDan Gohman <dan433584@gmail.com>2017-11-28 01:13:45 +0000
commit0811cd1d158ee9f43948d2897ff02bcb34bc0a44 (patch)
treebb837e7e8faea7e472c5a07046358021b01e71e1 /clang/lib/Basic/Targets/WebAssembly.cpp
parentcdd48b8a6b08a1feb6acbc407b5735ed7e7dfead (diff)
downloadbcm5719-llvm-0811cd1d158ee9f43948d2897ff02bcb34bc0a44.tar.gz
bcm5719-llvm-0811cd1d158ee9f43948d2897ff02bcb34bc0a44.zip
[WebAssembly] Add options for using the nontrapping-fptoint feature.
This adds ways to control use of WebAssembly's new nontrapping-fptoint feature. llvm-svn: 319129
Diffstat (limited to 'clang/lib/Basic/Targets/WebAssembly.cpp')
-rw-r--r--clang/lib/Basic/Targets/WebAssembly.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets/WebAssembly.cpp b/clang/lib/Basic/Targets/WebAssembly.cpp
index 9eaaf8d4fdc..915aad4b563 100644
--- a/clang/lib/Basic/Targets/WebAssembly.cpp
+++ b/clang/lib/Basic/Targets/WebAssembly.cpp
@@ -32,6 +32,7 @@ const Builtin::Info WebAssemblyTargetInfo::BuiltinInfo[] = {
bool WebAssemblyTargetInfo::hasFeature(StringRef Feature) const {
return llvm::StringSwitch<bool>(Feature)
.Case("simd128", SIMDLevel >= SIMD128)
+ .Case("nontrapping-fptoint", HasNontrappingFPToInt)
.Default(false);
}
@@ -61,6 +62,14 @@ bool WebAssemblyTargetInfo::handleTargetFeatures(
SIMDLevel = std::min(SIMDLevel, SIMDEnum(SIMD128 - 1));
continue;
}
+ if (Feature == "+nontrapping-fptoint") {
+ HasNontrappingFPToInt = true;
+ continue;
+ }
+ if (Feature == "-nontrapping-fptoint") {
+ HasNontrappingFPToInt = false;
+ continue;
+ }
Diags.Report(diag::err_opt_not_valid_with_opt)
<< Feature << "-target-feature";
OpenPOWER on IntegriCloud