summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-03-18 07:33:49 +0000
committerKostya Serebryany <kcc@google.com>2013-03-18 07:33:49 +0000
commit6b5b58deeb78d147a78ff0a28ce883eac717d602 (patch)
treec9964128ff9444afadfc1cc744a3511ff3495f23 /llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
parentcbed82ea70974a601cb1cea43c415362f7f89f43 (diff)
downloadbcm5719-llvm-6b5b58deeb78d147a78ff0a28ce883eac717d602.tar.gz
bcm5719-llvm-6b5b58deeb78d147a78ff0a28ce883eac717d602.zip
[asan] don't instrument functions with available_externally linkage. This saves a bit of compile time and reduces the number of redundant global strings generated by asan (https://code.google.com/p/address-sanitizer/issues/detail?id=167)
llvm-svn: 177250
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index 2d212d0ddc7..758c6e7bcb4 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -1095,6 +1095,7 @@ bool AddressSanitizer::maybeInsertAsanInitAtFunctionEntry(Function &F) {
bool AddressSanitizer::runOnFunction(Function &F) {
if (BL->isIn(F)) return false;
if (&F == AsanCtorFunction) return false;
+ if (F.getLinkage() == GlobalValue::AvailableExternallyLinkage) return false;
DEBUG(dbgs() << "ASAN instrumenting:\n" << F << "\n");
initializeCallbacks(*F.getParent());
OpenPOWER on IntegriCloud