[gcov] Display the hit counter for the line of a function definition
ClosedPublic

Authored by calixte on Jul 26 2018, 7:09 AM.

Details

Summary

Right now there is no hit counter on the line of function.
So the idea is add the line of the function to all the lines covered by the entry block.
Tests in compiler-rt/profile will be fixed in another patch: https://reviews.llvm.org/D49854

Diff Detail

Repository
rL LLVM
calixte created this revision.Jul 26 2018, 7:09 AM
calixte edited the summary of this revision. (Show Details)Jul 26 2018, 7:14 AM
calixte added a reviewer: sylvestre.ledru.
calixte removed a reviewer: sylvestre.ledru.
calixte added a subscriber: sylvestre.ledru.
marco-c accepted this revision.Jul 27 2018, 10:06 AM

I hope this won't have any side effects we are not expecting. The updated tests in compiler-rt all look good, so I'm reasonably confident.

lib/Transforms/Instrumentation/GCOVProfiling.cpp
588 ↗(On Diff #157480)

Nit: you might try to use EntryBlock, if it still usable after the split. Not so important though.

The formatting seems to be off.

This revision is now accepted and ready to land.Jul 27 2018, 10:06 AM
calixte updated this revision to Diff 160332.Aug 13 2018, 4:51 AM

Fix formatting.

calixte added inline comments.Aug 13 2018, 4:55 AM
lib/Transforms/Instrumentation/GCOVProfiling.cpp
588 ↗(On Diff #157480)

It seems that EntryBlock::splitBasicBlock (http://llvm.org/doxygen/BasicBlock_8cpp_source.html#l00401) is creating a new BasicBlock so we must get it from F.

calixte added inline comments.Aug 17 2018, 2:34 AM
lib/Transforms/Instrumentation/GCOVProfiling.cpp
588 ↗(On Diff #157480)

In fact the entry block is not changed by splitBasicBlock.

calixte updated this revision to Diff 169167.Thu, Oct 11, 1:46 AM

Don't get EntryBlock again