From: Kostya Serebryany Date: Wed, 17 Dec 2014 21:50:04 +0000 (+0000) Subject: [sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, llvm part X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=1c97c5e8bddfcce56b890f26e56ce10293f8ce4e;p=oota-llvm.git [sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, llvm part git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224463 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/lib/Transforms/Instrumentation/SanitizerCoverage.cpp index 07223d4df5c..9293362235b 100644 --- a/lib/Transforms/Instrumentation/SanitizerCoverage.cpp +++ b/lib/Transforms/Instrumentation/SanitizerCoverage.cpp @@ -171,10 +171,8 @@ bool SanitizerCoverageModule::runOnModule(Module &M) { bool SanitizerCoverageModule::runOnFunction(Function &F) { if (F.empty()) return false; - // For now instrument only functions that will also be asan-instrumented. - if (!F.hasFnAttribute(Attribute::SanitizeAddress) && - !F.hasFnAttribute(Attribute::SanitizeMemory)) - return false; + if (F.getName().find(".module_ctor") != std::string::npos) + return false; // Should not instrument sanitizer init functions. if (CoverageLevel >= 3) SplitAllCriticalEdges(F, this); SmallVector IndirCalls;