[PATCH] D43681: [WebAssembly] Add exception handling option

Heejin Ahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 1 16:41:33 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL326517: [WebAssembly] Add exception handling option (authored by aheejin, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D43681

Files:
  cfe/trunk/docs/ClangCommandLineReference.rst
  cfe/trunk/include/clang/Driver/Options.td
  cfe/trunk/lib/Basic/Targets/WebAssembly.cpp
  cfe/trunk/lib/Basic/Targets/WebAssembly.h


Index: cfe/trunk/lib/Basic/Targets/WebAssembly.cpp
===================================================================
--- cfe/trunk/lib/Basic/Targets/WebAssembly.cpp
+++ cfe/trunk/lib/Basic/Targets/WebAssembly.cpp
@@ -37,6 +37,7 @@
       .Case("simd128", SIMDLevel >= SIMD128)
       .Case("nontrapping-fptoint", HasNontrappingFPToInt)
       .Case("sign-ext", HasSignExt)
+      .Case("exception-handling", HasExceptionHandling)
       .Default(false);
 }
 
@@ -83,6 +84,14 @@
       HasSignExt = false;
       continue;
     }
+    if (Feature == "+exception-handling") {
+      HasExceptionHandling = true;
+      continue;
+    }
+    if (Feature == "-exception-handling") {
+      HasExceptionHandling = false;
+      continue;
+    }
 
     Diags.Report(diag::err_opt_not_valid_with_opt)
         << Feature << "-target-feature";
Index: cfe/trunk/lib/Basic/Targets/WebAssembly.h
===================================================================
--- cfe/trunk/lib/Basic/Targets/WebAssembly.h
+++ cfe/trunk/lib/Basic/Targets/WebAssembly.h
@@ -32,11 +32,12 @@
 
   bool HasNontrappingFPToInt;
   bool HasSignExt;
+  bool HasExceptionHandling;
 
 public:
   explicit WebAssemblyTargetInfo(const llvm::Triple &T, const TargetOptions &)
       : TargetInfo(T), SIMDLevel(NoSIMD), HasNontrappingFPToInt(false),
-        HasSignExt(false) {
+        HasSignExt(false), HasExceptionHandling(false) {
     NoAsmVariants = true;
     SuitableAlign = 128;
     LargeArrayMinWidth = 128;
Index: cfe/trunk/docs/ClangCommandLineReference.rst
===================================================================
--- cfe/trunk/docs/ClangCommandLineReference.rst
+++ cfe/trunk/docs/ClangCommandLineReference.rst
@@ -2352,6 +2352,8 @@
 
 .. option:: -msimd128, -mno-simd128
 
+.. option:: -mexception-handling, -mno-exception-handling
+
 X86
 ---
 .. option:: -m3dnow, -mno-3dnow
Index: cfe/trunk/include/clang/Driver/Options.td
===================================================================
--- cfe/trunk/include/clang/Driver/Options.td
+++ cfe/trunk/include/clang/Driver/Options.td
@@ -1917,6 +1917,8 @@
 def mno_nontrapping_fptoint : Flag<["-"], "mno-nontrapping-fptoint">, Group<m_wasm_Features_Group>;
 def msign_ext : Flag<["-"], "msign-ext">, Group<m_wasm_Features_Group>;
 def mno_sign_ext : Flag<["-"], "mno-sign-ext">, Group<m_wasm_Features_Group>;
+def mexception_handing : Flag<["-"], "mexception-handling">, Group<m_wasm_Features_Group>;
+def mno_exception_handing : Flag<["-"], "mno-exception-handling">, Group<m_wasm_Features_Group>;
 
 def mamdgpu_debugger_abi : Joined<["-"], "mamdgpu-debugger-abi=">,
   Flags<[HelpHidden]>,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43681.136641.patch
Type: text/x-patch
Size: 2638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180302/886a048a/attachment.bin>


More information about the cfe-commits mailing list