r278051 - [Driver] Enable CFI for WebAssembly

Derek Schuff via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 8 14:14:16 PDT 2016


Author: dschuff
Date: Mon Aug  8 16:14:15 2016
New Revision: 278051

URL: http://llvm.org/viewvc/llvm-project?rev=278051&view=rev
Log:
[Driver] Enable CFI for WebAssembly

Since CFI support has landed in the WebAssembly backend, enable it in
the frontend driver.

Patch by Dominic Chen

Differential Revision: https://reviews.llvm.org/D23244

Modified:
    cfe/trunk/lib/Driver/ToolChain.cpp

Modified: cfe/trunk/lib/Driver/ToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=278051&r1=278050&r2=278051&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChain.cpp Mon Aug  8 16:14:15 2016
@@ -697,7 +697,9 @@ SanitizerMask ToolChain::getSupportedSan
   SanitizerMask Res = (Undefined & ~Vptr & ~Function) | (CFI & ~CFIICall) |
                       CFICastStrict | UnsignedIntegerOverflow | LocalBounds;
   if (getTriple().getArch() == llvm::Triple::x86 ||
-      getTriple().getArch() == llvm::Triple::x86_64)
+      getTriple().getArch() == llvm::Triple::x86_64 ||
+      getTriple().getArch() == llvm::Triple::wasm32 ||
+      getTriple().getArch() == llvm::Triple::wasm64)
     Res |= CFIICall;
   return Res;
 }




More information about the cfe-commits mailing list