r288447 - [WebAssembly] Add an -mdirect flag for the direct wasm object feature.

Dan Gohman via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 1 17:12:40 PST 2016


Author: djg
Date: Thu Dec  1 19:12:40 2016
New Revision: 288447

URL: http://llvm.org/viewvc/llvm-project?rev=288447&view=rev
Log:
[WebAssembly] Add an -mdirect flag for the direct wasm object feature.

Add a target flag for enabling the new direct wasm object emission
feature.

Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=288447&r1=288446&r2=288447&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Thu Dec  1 19:12:40 2016
@@ -1613,6 +1613,8 @@ def ffixed_x18 : Flag<["-"], "ffixed-x18
 
 def msimd128 : Flag<["-"], "msimd128">, Group<m_wasm_Features_Group>;
 def mno_simd128 : Flag<["-"], "mno-simd128">, Group<m_wasm_Features_Group>;
+def mdirect : Flag<["-"], "mdirect">, Group<m_wasm_Features_Group>;
+def mno_direct : Flag<["-"], "mno-direct">, Group<m_wasm_Features_Group>;
 
 def mamdgpu_debugger_abi : Joined<["-"], "mamdgpu-debugger-abi=">,
   Flags<[HelpHidden]>,

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=288447&r1=288446&r2=288447&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu Dec  1 19:12:40 2016
@@ -8019,6 +8019,10 @@ private:
         SIMDLevel = std::min(SIMDLevel, SIMDEnum(SIMD128 - 1));
         continue;
       }
+      if (Feature == "+direct")
+        continue;
+      if (Feature == "-direct")
+        continue;
 
       Diags.Report(diag::err_opt_not_valid_with_opt) << Feature
                                                      << "-target-feature";




More information about the cfe-commits mailing list