[PATCH] D23277: [llvm-cov] Add the "Goto first zero count" feature.

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 17:22:20 PDT 2016


vsk added a comment.

In https://reviews.llvm.org/D23277#529763, @MaggieYi wrote:

> In https://reviews.llvm.org/D23277#526594, @vsk wrote:
>
> > Thanks for splitting things up :).
> >
> > I'm not sure that the javascript bit is needed. It looks like a way to remove/disable a link, but I don't see any issue with leaving the link active.
>
>
> If the link is removed, the user could easily know that this source file is fully covered. From this point, it is better to remove the link.


If the source file is fully covered, we shouldn't emit the link. I don't understand why it's necessary to emit the link, and then add code to disable it when the page is viewed.

> In addition, the JavaScript is also used by another patch. Following this patch, I want to submit another patch which provides easy navigation to find the previous and next source file report. For each source file view, three hyperlinks (index, prev and next links) are given below the report create time. By clicking the index link, the coverage report will go back to index.html page. The prev/next links will go to the previous/next source report. The prev link is disabled if the source file is the first source file link in the index page. The next link is disabled if the source file is the last source file link in the index page. The JavaScript of removing the link is also needed by the index/prev/next patch.


Similarly, if there is no "next" report, a next link shouldn't be emitted. Ditto for "prev" links.

> > I also don't think we need a 'zeroline' or 'zero' id. Every line already has an anchor: <a name='L$N'>. I think a "Jump to the first uncovered line" link which uses one of the line anchors would do the job.

> 

> 

> I use the following way to implement “Goto first zero line” feature.

> 

> To create links to jump to the first uncovered line within the page, two HTML tags need to be used.

> 

> <a href="#zero">Goto first zero count</a>

> 

> This first tag is almost the same as any other HTML tag you would use to create a link to another page. However, to create a bookmark (anchor), I must start the link with a #, which represents a name statement, used in the next tag. When the user clicks on the "Goto first zero count" link, the computer would then go to the name tag, if found on the same page of the link.

> 

> id="zero"

> 

> This next piece of code is where the link will go to on the page when the link is clicked. The ID attribute is added to a <tr> tag.

> 

> <tr id="zero">

> 

> Since I also need an ID to remove the link by Javascript, the 'id="zeroline"'has been added to the first tag.

> 

> <a href="#zero" 'id="zeroline">Goto first zero count</a>

> 

> Both 'zeroline' and 'zero' are needed using this method. I am not sure the way you mentioned here. Could you please explain it by an example?


Sure, let's say that we determined that line 100 is the first line which has an execution count of 0. Then, we can emit: <a href="#L100">Go to first unexecuted line</a>. I understand how you're using #zero and #zeroline, but still don't think that they are essential.


https://reviews.llvm.org/D23277





More information about the llvm-commits mailing list