-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[llvm-cov] Fix branch counts of template functions (#111743) #113925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[llvm-cov] Fix branch counts of template functions (#111743) #113925
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
785f306
to
74764e5
Compare
Hi @evodius96, could you please review my changes. |
Ping |
Sorry for the delay, I was out of town for a family emergency. I will take a look at this this week! Thanks |
llvm/tools/llvm-cov/CodeCoverage.cpp
Outdated
@@ -1270,13 +1270,18 @@ int CodeCoverageTool::doExport(int argc, const char **argv, | |||
cl::desc("Don't export branch data (LCOV)"), | |||
cl::cat(ExportCategory)); | |||
|
|||
cl::opt<bool> UnifyInstantiations("unify-instantiations", cl::Optional, | |||
cl::desc("Unify function instantiations"), | |||
cl::init(false), cl::cat(ExportCategory)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worthwhile to turn this ON by default? Then the summary would be more consistent with the summary output of llvm-cov show
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I changed the default to true.
if (ViewDepth == 0) | ||
SrcLine = Expansion.Region.LineStart; | ||
// Track the path to the nested expansions | ||
NestedPath.push_back(Expansion.Region.startLoc()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better than tracking LineStart. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's required to avoid unifying different expanded branches of the same root line.
e69e9a5
to
ecde8c3
Compare
// Contains the path to default and expanded branches | ||
// Size is 1 for default branches and greater 1 for expanded branches. | ||
std::vector<LineColPair> NestedPath; | ||
// Indicates whether this item should at rendering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: For LLVM, it's typically to end comments with a period.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't know that and updated all my added comments now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the nit about comments, LGTM. Thanks!
ecde8c3
to
d94626e
Compare
Thanks for the review. |
You can trigger the merge yourself from this pull request. |
5346252
to
53a9786
Compare
Added option "--unify-instantiations" to llvm-cov export to combine branch execution counts of C++ template instantiations. on-behalf-of: @e-solutions-GmbH <info@esolutions.de>
53a9786
to
0a20607
Compare
The merge button is always disabled for me with info: |
Ping |
Apologies -- last week was a holiday in the US. Ah, I see. I think you should request write access to the repo, but the process has changed since I did it. Nevertheless, I will attempt to merge this for you since I have the ability to do that. |
@stma247 Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR. Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues. How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/16/builds/9919 Here is the relevant piece of the build log for the reference
|
@stma247 Looks like the LIT test failed on a couple of the build bots. I reverted the commit until that can be addressed. |
Hi @evodius96, I must have missed the reverted commit somehow. I am working on a solution and will create a new PR. |
Fixed flaky test if EXPENSIVE_CHECKS are enabled, caused by an ambiguous comparator. Keep orginal position in NestedCountedRegion to sort distinct. on-behalf-of: @e-solutions-GmbH <info@esolutions.de>
Fixed flaky test if EXPENSIVE_CHECKS are enabled, caused by an ambiguous comparator. Keep orginal position in NestedCountedRegion to sort distinct. on-behalf-of: @e-solutions-GmbH <info@esolutions.de>
Fixed flaky test if EXPENSIVE_CHECKS are enabled, caused by an ambiguous comparator. Keep orginal position in NestedCountedRegion to sort distinct. on-behalf-of: @e-solutions-GmbH <info@esolutions.de>
Fixed flaky test if EXPENSIVE_CHECKS are enabled, caused by an ambiguous comparator. Keep orginal position in NestedCountedRegion to sort distinct. on-behalf-of: @e-solutions-GmbH <info@esolutions.de>
Fixed flaky test if EXPENSIVE_CHECKS are enabled, caused by an ambiguous comparator. Keep orginal position in NestedCountedRegion to sort distinct. on-behalf-of: @e-solutions-GmbH <info@esolutions.de>
The new PR is #135074 |
Fixed flaky test if EXPENSIVE_CHECKS are enabled, caused by an ambiguous comparator. Keep orginal position in NestedCountedRegion to sort distinct. on-behalf-of: @e-solutions-GmbH <info@esolutions.de>
Fixed flaky test if EXPENSIVE_CHECKS are enabled, caused by an ambiguous comparator. Keep orginal position in NestedCountedRegion to sort distinct. on-behalf-of: @e-solutions-GmbH <info@esolutions.de>
…lvm#135074) This PR is a second attempt for issue llvm#111743 to finish reverted PR llvm#113925. Added option "--unify-instantiations" to llvm-cov export to combine branch execution counts of C++ template instantiations. Fix non-deterministic behavior.
…lvm#135074) This PR is a second attempt for issue llvm#111743 to finish reverted PR llvm#113925. Added option "--unify-instantiations" to llvm-cov export to combine branch execution counts of C++ template instantiations. Fix non-deterministic behavior.
…lvm#135074) This PR is a second attempt for issue llvm#111743 to finish reverted PR llvm#113925. Added option "--unify-instantiations" to llvm-cov export to combine branch execution counts of C++ template instantiations. Fix non-deterministic behavior.
…lvm#135074) This PR is a second attempt for issue llvm#111743 to finish reverted PR llvm#113925. Added option "--unify-instantiations" to llvm-cov export to combine branch execution counts of C++ template instantiations. Fix non-deterministic behavior.
Added option "--unify-instantiations" to llvm-cov export to combine branch execution counts of C++ template instantiations.
on-behalf-of: @e-solutions-GmbH info@esolutions.de