This is an archive of the discontinued LLVM Phabricator instance.

Move asan-coverage into a separate phase.
ClosedPublic

Authored by kcc on Nov 6 2014, 12:42 PM.

Details

Summary

This change moves asan-coverage instrumentation
into a separate Module pass.
The other part of the change in clang introduces a new flag
-fsanitize-coverage=N.
Another small patch will update tests in compiler-rt.

With this patch no functionality change is expected except for the flag name.
The following changes will make the coverage instrumentation work with tsan/msan

Diff Detail

Event Timeline

kcc updated this revision to Diff 15887.Nov 6 2014, 12:42 PM
kcc retitled this revision from to Move asan-coverage into a separate phase..
kcc updated this object.
kcc edited the test plan for this revision. (Show Details)
kcc added reviewers: samsonov, nlewycky.
kcc added a subscriber: Unknown Object (MLST).
samsonov accepted this revision.Nov 6 2014, 4:51 PM
samsonov edited edge metadata.

Looks reasonable to me, coverage certainly deserves a separate pass. Nick, any comments?

lib/Transforms/Instrumentation/SanitizerCoverage.cpp
105

Looks like this can be LLVMContext&

This revision is now accepted and ready to land.Nov 6 2014, 4:51 PM
kcc added inline comments.Nov 7 2014, 11:55 AM
lib/Transforms/Instrumentation/SanitizerCoverage.cpp
105

I can't initialize reference in the CTOR as there is no context available at that time.

nlewycky accepted this revision.Nov 10 2014, 4:32 PM
nlewycky edited edge metadata.
nlewycky added inline comments.
lib/Transforms/Instrumentation/SanitizerCoverage.cpp
115

Please roll this into the report_fatal_error string. (LLVM is a library, may not have stdout, etc.)

122–124

DataLayoutPass *DLP = &getAnalysis<DataLayoutPass>();

142

Space before the colon.

191

Typo: initialed -> initialized

kcc updated this revision to Diff 16061.Nov 11 2014, 1:48 PM
kcc edited edge metadata.

Addressed Nick's comments.

lib/Transforms/Instrumentation/SanitizerCoverage.cpp
115

done

std::string Err;                                                               
raw_string_ostream Stream(Err);                                                
Stream << "SanitizerCoverage interface function redefined: "                   
       << *FuncOrBitcast;                                                      
report_fatal_error(Err);
122–124

done.
Also added

AU.addRequired<DataLayoutPass>();

to
getAnalysisUsage()

142

done

191

done

kcc closed this revision.Nov 11 2014, 2:05 PM