From 0811cd1d158ee9f43948d2897ff02bcb34bc0a44 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 28 Nov 2017 01:13:45 +0000 Subject: [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 --- clang/lib/Basic/Targets/WebAssembly.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'clang/lib/Basic/Targets/WebAssembly.cpp') 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(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"; -- cgit v1.2.3