r345433 - Revert "[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address"

Leonard Chan via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 26 15:51:51 PDT 2018


Author: leonardchan
Date: Fri Oct 26 15:51:51 2018
New Revision: 345433

URL: http://llvm.org/viewvc/llvm-project?rev=345433&view=rev
Log:
Revert "[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address"

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.

Removed:
    cfe/trunk/test/CodeGen/asan-new-pm.ll
Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=345433&r1=345432&r2=345433&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Fri Oct 26 15:51:51 2018
@@ -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::EmitAssemblyWit
                                                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

Removed: cfe/trunk/test/CodeGen/asan-new-pm.ll
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/asan-new-pm.ll?rev=345432&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/asan-new-pm.ll (original)
+++ cfe/trunk/test/CodeGen/asan-new-pm.ll (removed)
@@ -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
-}




More information about the cfe-commits mailing list