[PATCH] D23277: [llvm-cov] Add the "Goto first zero count" feature.
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 2 14:15:07 PDT 2016
vsk accepted this revision.
vsk added a comment.
This revision is now accepted and ready to land.
Lgtm with two minor changes.
================
Comment at: tools/llvm-cov/SourceCoverageView.cpp:86
@@ +85,3 @@
+unsigned SourceCoverageView::getFirstUncoveredLineNo() {
+ auto CheckIfUncovered = [](const coverage::CoverageSegment S) {
+ return S.HasCount && S.Count == 0;
----------------
This makes a copy of the CoverageSegment. `const coverage::CoverageSegment &` should work just as well, without the extra copy. The comparator you defined for the call to min_element() should also take const references.
================
Comment at: tools/llvm-cov/SourceCoverageViewHTML.cpp:358
@@ +357,3 @@
+ std::string LinkText = escape("Go to first unexecuted line", getOptions());
+ std::string LinkTarget = "#L" + utostr(uint64_t(LineNo));
+ if (!FullyCovered)
----------------
Link{Text,Target} shouldn't be computed until we're in the !FullyCovered case.
https://reviews.llvm.org/D23277
More information about the llvm-commits
mailing list