-
Notifications
You must be signed in to change notification settings - Fork 13.6k
llvm-cov: Insufficient merging strategy for template instantiations #119299
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
Comments
@evodius96 Do you have any opinions re. this direction? |
Related to this is inconsistent coverage metrics due to ifdefs and building with different defines in different translation units. This happens for unit tests, for example, where you don't need to link all of the different inconsistent translation units together. This also can happen with anonymous namespaced instantiations that get linked into the same libraries and exectuables. (And we have all of that with Trilinos.) My current plan is to just take maxes over all of the (unit test) executables using NOTE: I need to merge all source data with clang-tidy metrics for function size and complexity as part of a larger effort to get better static and dynamic metrics for C++ code. See: |
llvm-cov report
llvm-cov report
merges metrics for instantiations with the strategy "Take max(covered)/max(num) for each instantance".max/max
.llvm-cov show
Source viewThe merged counters can be seen in Line (and region) counters. They show max counters in each record. I think this will be less informative if any instances are not fully covered on their own.
Branches and MC/DC records are not merged in the source view. It is noisy. Actual uncovered branches should be found in instantiation subviews.
Anyways, the source view doesn't reflect the summary. (see also #119282)
Possible merge strategies
Planning. It should be better if merged result can be seen in the source view.
llvm-cov
will accept one of strategies below by command line options.They below are listed in order of tolerance.
Count up after merging records
findIndependencePairs
deferred)I think:
Max(any)
This assumes harderning the current strategy. Show "covered" if one of instantiations is fully covered.
This might be confused in skipped/folded stuff.
Min(all)
This actually means, "Don't merge, just count up each instance". The template will be "not covered at all" if at least one instantiation is not executed.
The text was updated successfully, but these errors were encountered: