r212505 - [ASan] Completely remove sanitizer blacklist file from instrumentation pass.

Alexey Samsonov vonosmas at gmail.com
Mon Jul 7 17:50:49 PDT 2014

Author: samsonov
Date: Mon Jul  7 19:50:49 2014
New Revision: 212505

URL: http://llvm.org/viewvc/llvm-project?rev=212505&view=rev
[ASan] Completely remove sanitizer blacklist file from instrumentation pass.

All blacklisting logic is now moved to the frontend (Clang).
If a function (or source file it is in) is blacklisted, it doesn't
get sanitize_address attribute and is therefore not instrumented.
If a global variable (or source file it is in) is blacklisted, it is
reported to be blacklisted by the entry in llvm.asan.globals metadata,
and is not modified by the instrumentation.

The latter may lead to certain false positives - not all the globals
created by Clang are described in llvm.asan.globals metadata (e.g,
RTTI descriptors are not), so we may start reporting errors on them
even if "module" they appear in is blacklisted. We assume it's fine
to take such risk:
  1) errors on these globals are rare and usually indicate wild memory access
  2) we can lazily add descriptors for these globals into llvm.asan.globals


Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=212505&r1=212504&r2=212505&view=diff
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Mon Jul  7 19:50:49 2014
@@ -180,11 +180,8 @@ static void addBoundsCheckingPass(const
 static void addAddressSanitizerPasses(const PassManagerBuilder &Builder,
                                       PassManagerBase &PM) {
-  const PassManagerBuilderWrapper &BuilderWrapper =
-      static_cast<const PassManagerBuilderWrapper&>(Builder);
-  const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts();
-  PM.add(createAddressSanitizerModulePass(CGOpts.SanitizerBlacklistFile));
+  PM.add(createAddressSanitizerModulePass());
 static void addMemorySanitizerPass(const PassManagerBuilder &Builder,

More information about the cfe-commits mailing list