summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-07-08 00:50:49 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-07-08 00:50:49 +0000
commitc94285a1a02f8432f74d6c63ab7357a96497f177 (patch)
tree17b080e1953d95996ae630b46ca40766bdb980a3 /clang/lib/CodeGen/BackendUtil.cpp
parent79580db9184264dfba4fbe76bd4d385c837a4e99 (diff)
downloadbcm5719-llvm-c94285a1a02f8432f74d6c63ab7357a96497f177.tar.gz
bcm5719-llvm-c94285a1a02f8432f74d6c63ab7357a96497f177.zip
[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 lazily. llvm-svn: 212505
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index aa0893ef117..a1521dce39f 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -180,11 +180,8 @@ static void addBoundsCheckingPass(const PassManagerBuilder &Builder,
static void addAddressSanitizerPasses(const PassManagerBuilder &Builder,
PassManagerBase &PM) {
- const PassManagerBuilderWrapper &BuilderWrapper =
- static_cast<const PassManagerBuilderWrapper&>(Builder);
- const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts();
PM.add(createAddressSanitizerFunctionPass());
- PM.add(createAddressSanitizerModulePass(CGOpts.SanitizerBlacklistFile));
+ PM.add(createAddressSanitizerModulePass());
}
static void addMemorySanitizerPass(const PassManagerBuilder &Builder,
OpenPOWER on IntegriCloud