]> granicus.if.org Git - clang/commitdiff
Revert "[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with...
authorLeonard Chan <leonardchan@google.com>
Fri, 26 Oct 2018 22:51:51 +0000 (22:51 +0000)
committerLeonard Chan <leonardchan@google.com>
Fri, 26 Oct 2018 22:51:51 +0000 (22:51 +0000)
This reverts commit 8d6af840396f2da2e4ed6aab669214ae25443204 and commit
b78d19c287b6e4a9abc9fb0545de9a3106d38d3d which causes slower build times
by initializing the AddressSanitizer on every function run.

The corresponding revisions are https://reviews.llvm.org/D52814 and
https://reviews.llvm.org/D52739.

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

lib/CodeGen/BackendUtil.cpp
test/CodeGen/asan-new-pm.ll [deleted file]

index ee9fa844519301d1e0a0d22f800fa47602811a06..fd9a95b71998b0758ffa468be5265af388b3c202 100644 (file)
@@ -52,7 +52,6 @@
 #include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"
 #include "llvm/Transforms/InstCombine/InstCombine.h"
 #include "llvm/Transforms/Instrumentation.h"
-#include "llvm/Transforms/Instrumentation/AddressSanitizerPass.h"
 #include "llvm/Transforms/Instrumentation/BoundsChecking.h"
 #include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
 #include "llvm/Transforms/ObjCARC.h"
@@ -1023,16 +1022,6 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
                                                CodeGenOpts.DebugPassManager);
       }
     }
-
-    if (LangOpts.Sanitize.has(SanitizerKind::Address)) {
-      bool Recover = CodeGenOpts.SanitizeRecover.has(SanitizerKind::Address);
-      MPM.addPass(createModuleToFunctionPassAdaptor(
-          AddressSanitizerPass(/*CompileKernel=*/false, Recover,
-                               CodeGenOpts.SanitizeAddressUseAfterScope)));
-      bool ModuleUseAfterScope = asanUseGlobalsGC(TargetTriple, CodeGenOpts);
-      MPM.addPass(AddressSanitizerPass(/*CompileKernel=*/false, Recover,
-                                       ModuleUseAfterScope));
-    }
   }
 
   // FIXME: We still use the legacy pass manager to do code generation. We
diff --git a/test/CodeGen/asan-new-pm.ll b/test/CodeGen/asan-new-pm.ll
deleted file mode 100644 (file)
index 07376ef..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: %clang_cc1 -S -emit-llvm -o - -fexperimental-new-pass-manager -fsanitize=address %s | FileCheck %s
-
-; CHECK: @llvm.global_ctors = {{.*}}@asan.module_ctor
-; CHECK: declare void @__asan_loadN
-
-define i32 @test_load(i32* %a) sanitize_address {
-entry:
-  %tmp1 = load i32, i32* %a, align 4
-  ret i32 %tmp1
-}