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

llvm-svn: 224463
This commit is contained in:
Kostya Serebryany 2014-12-17 21:50:04 +00:00
parent 78df9d03fa
commit fea4fb404e
1 changed files with 2 additions and 4 deletions

View File

@ -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<Instruction*, 8> IndirCalls;