]> granicus.if.org Git - clang/commitdiff
[Driver] Enable CFI for WebAssembly
authorDerek Schuff <dschuff@google.com>
Mon, 8 Aug 2016 21:14:15 +0000 (21:14 +0000)
committerDerek Schuff <dschuff@google.com>
Mon, 8 Aug 2016 21:14:15 +0000 (21:14 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278051 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChain.cpp

index 58afaed91a953757d26228f9edae31e897a53a07..863bd0a164bdae8f0ade901cc747b4c933ccf440 100644 (file)
@@ -697,7 +697,9 @@ SanitizerMask ToolChain::getSupportedSanitizers() const {
   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;
 }