[llvm] r224463 - [sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, llvm part

Kostya Serebryany kcc at google.com
Wed Dec 17 13:50:04 PST 2014


Author: kcc
Date: Wed Dec 17 15:50:04 2014
New Revision: 224463

URL: http://llvm.org/viewvc/llvm-project?rev=224463&view=rev
Log:
[sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, llvm part

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp?rev=224463&r1=224462&r2=224463&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp Wed Dec 17 15:50:04 2014
@@ -171,10 +171,8 @@ bool SanitizerCoverageModule::runOnModul
 
 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<Instruction*, 8> IndirCalls;





More information about the llvm-commits mailing list