This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Add to emitted DebugLoc information about coverage when it's required

Authored by calixte on Jul 27 2018, 7:22 AM.



Some lines have a hit counter where they should not have one.
Cleanup stuff is located to the last line of the body which is most of the time a '}'.
And Exception stuff is added at the beginning of a function and at the end (represented by '{' and '}').
So in such cases, the DebugLoc used in GCOVProfiling.cpp must be marked as not covered.
This patch is a followup of
Tests in projects/compiler_rt are fixed by:

Diff Detail

rC Clang

Event Timeline

calixte created this revision.Jul 27 2018, 7:22 AM

Test coverage?

calixte updated this revision to Diff 163062.Aug 29 2018, 5:52 AM
  • Use ImplicitCode instead of Covered
  • Set Artificial location as ImplicitCode to avoid coverage on landing pads
calixte updated this revision to Diff 164851.Sep 11 2018, 5:14 AM
  • Add some ImplicitCode when there is some stuff at the end of a function
  • Fix the tests
calixte updated this revision to Diff 164860.Sep 11 2018, 6:39 AM
  • only put an ImplicitCode for EmitLandingPad
  • fix tests (were broken with clanf-format-diff)
calixte edited the summary of this revision. (Show Details)Sep 11 2018, 6:45 AM
marco-c accepted this revision.Sep 20 2018, 2:38 AM
This revision is now accepted and ready to land.Sep 20 2018, 2:38 AM

@calixte This was reverted and never relanded. Is D49915 (DILocation::ImplicitCode) still needed?