This is an archive of the discontinued LLVM Phabricator instance.

[SanitizerCoverage] Don't duplicate code to get section pointers
ClosedPublic

Authored by metzman on Oct 12 2018, 1:09 PM.

Details

Summary

Merge code used to get section start and section end pointers
for SanitizerCoverage constructors. This includes code that handles
getting the start pointers when targeting MSVC.

Diff Detail

Repository
rL LLVM

Event Timeline

metzman created this revision.Oct 12 2018, 1:09 PM
metzman retitled this revision from Dont duplicate code to get section start and end pointers to [SanitizerCoverage] Don't duplicate code to get section pointers.Oct 12 2018, 1:19 PM
metzman added a subscriber: kcc.

Please take a look at this NFC.
It merges code from the two places where we were getting section start and end pointers.
Though @kcc only asked for merging the code handling the start pointers on Windows, I decided to combine other nearby duplicated code.

llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
267 ↗(On Diff #169479)

I think it is correct to use this IRB instead of the one from runOnModule, but please let me know if I am wrong.

271 ↗(On Diff #169479)

clang-format-diff.py made this change. I can add the extra newline back if wanted.

This revision is now accepted and ready to land.Oct 16 2018, 2:44 PM
This revision was automatically updated to reflect the committed changes.