| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
llvm-cov's report mode does not print any output when -show-functions is
specified and no source files are specified. This can be surprising, so
the tool should at least print out an error message when this happens.
rdar://problem/34636859
llvm-svn: 314175
|
|
|
|
|
|
|
|
|
| |
Passing "-dump" to llvm-cov will now print more detailed information
about function hash and counter mismatches. This should make it easier
to debug *.profdata files which contain incorrect records, and to debug
other scenarios where coverage goes missing due to mismatch issues.
llvm-svn: 313853
|
|
|
|
|
|
|
|
|
| |
Use the same logic as the line-oriented coverage view to determine the
number of covered lines in a function.
Fixes llvm.org/PR34615.
llvm-svn: 313604
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After clang started emitting deferred regions (r312818), llvm-cov has
had a hard time picking reasonable line execuction counts. There have
been one or two generic improvements in this area (e.g r310012), but
line counts can still report coverage for whitespace instead of code
(llvm.org/PR34612).
To fix the problem:
* Introduce a new region kind so that frontends can explicitly label
gap areas.
This is done by changing the encoding of the columnEnd field of
MappingRegion. This doesn't substantially increase binary size, and
makes it easy to maintain backwards-compatibility.
* Don't set the line count to a count from a gap area, unless the count
comes from a wrapped segment.
* Don't highlight gap areas as uncovered.
Fixes llvm.org/PR34612.
llvm-svn: 313597
|
|
|
|
|
|
|
| |
The checks with the MARKER prefix were not being run over the right
input, because stderr was not redirected properly.
llvm-svn: 313596
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix an unsigned integer overflow in the logic that computes the
number of uncovered lines in a function.
* When aggregating region and line coverage summaries, take into account
that different instantiations may have a different number of regions.
The new test case provides test coverage for both bugs. I also verified
this change by preparing a coverage report for a stage2 build of llc --
the new assertions should detect any outstanding over-counting bugs.
Fixes PR34613.
llvm-svn: 313417
|
|
|
|
|
|
|
|
|
| |
Failing bot:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/4791
This looks like another stderr redirection issue.
llvm-svn: 312975
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Region coverage is difficult to explain without going deep into how
coverage is implemented. Instantiation coverage is easier to explain,
but probably not useful in most cases (templates don't exist in C, and
most C++ code contains relatively few templates).
This patch adds the options "-show-region-summary" and
"-show-instantiation-summary" to allow hiding those columns.
"-show-instantiation-summary" is turned off by default.
llvm-svn: 312969
|
|
|
|
|
|
|
|
|
| |
These lines by definition don't have an execution count.
This is the final part of the fix for:
https://bugs.llvm.org/show_bug.cgi?id=34166
llvm-svn: 312955
|
|
|
|
|
|
| |
Input redirection was using `2&>1` instead of `2>&1`.
llvm-svn: 312902
|
|
|
|
|
|
| |
A follow-up to a test fix (r312825).
llvm-svn: 312826
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On a Windows bot, I see a FileCheck error where the source being matched
over no longer exists, i.e it seems like it's FileCheck'ing some stale
output:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/4747
You can see "// CHECK: [[@LINE]]|{{ +}Marker at 19:3 = 1" in the
FileCheck stderr, but that CHECK line doesn't exist.
Remove the input file to FileCheck before running the test, to try and
appease the bot.
llvm-svn: 312825
|
|
|
|
|
|
|
|
|
|
| |
This should fix the lld bot:
The Buildbot has detected a new failure on builder llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast while building cfe.
Full details are available at:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/16993
llvm-svn: 312821
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A coverage segment contains a starting line and column, an execution
count, and some other metadata. Clients of the coverage library use
segments to prepare line-oriented reports.
Users of the coverage library depend on segments being unique and sorted
in source order. Currently this is not guaranteed (this is why the clang
change which introduced deferred regions was reverted).
This commit documents the "unique and sorted" condition and asserts that
it holds. It also fixes the SegmentBuilder so that it produces correct
output in some edge cases.
Testing: I've added unit tests for some edge cases. I've also checked
that the new SegmentBuilder implementation is fully covered. Apart from
running check-profile and the llvm-cov tests, I've successfully used a
stage1 llvm-cov to prepare a coverage report for an instrumented clang
binary.
Differential Revision: https://reviews.llvm.org/D36813
llvm-svn: 312817
|
|
|
|
|
|
|
| |
This fixes an issue where a std::string was moved to a constructor
which accepted a StringRef.
llvm-svn: 312816
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each source region has a start and end location. Report an error when
the end location does not precede the begin location.
The old lineExecutionCounts.covmapping test actually had a buggy source
region in it. This commit introduces a regenerated copy of the coverage
and moves the old copy to malformedRegions.covmapping, for a test.
Differential Revision: https://reviews.llvm.org/D37387
llvm-svn: 312814
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure that the text and html emitters always emit the same set of
region markers, and avoid emitting redundant markers for line segments
which don't end on the line they start on.
This is related to D35925, and depends on D36014
Differential Revision: https://reviews.llvm.org/D36020
llvm-svn: 312813
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add a -name-whitelist option, which behaves in the same way as -name, but it reads in multiple function names from the given input file(s).
Reviewers: vsk
Reviewed By: vsk
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37111
llvm-svn: 312227
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
another machine to your local copies
Summary:
This patch adds the -path-equivalence option (example: llvm-cov show -path-equivalence=/origin/path,/local/path) which maps the source code path from one machine to another when using `llvm-cov show`. This is similar to the -filename-equivalence option, but doesn't require you to specify all the source files on the command line.
This allows you to generate the coverage data on one machine (e.g. in a CI system), and then use llvm-cov on another machine where you have the same code base on a different path.
Reviewers: vsk
Reviewed By: vsk
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36391
llvm-svn: 310827
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Files which don't contain any functions are likely useless; don't
include them in the main table. Put the links at the bottom of the
page, in case someone wants to figure out coverage for code inside
a macro.
Not sure if this is the best solution, but it seems like an
improvement.
Differential Revision: https://reviews.llvm.org/D36298
llvm-svn: 310518
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes a slight change to the way llvm-cov determines line
execution counts. If there are multiple line segments on a line, the
line count is the max count among the regions which start *and* end on
the line. This avoids an issue posed by deferred regions which start on
the same line as a terminated region, e.g:
if (false)
return; //< The line count should be 0, even though a new region
//< starts at the semi-colon.
foo();
Another change is that counts from line segments which don't correspond
to region entries are considered. This enables the first change, and
corrects an outstanding issue (see the showLineExecutionCounts.cpp test
change).
This is related to D35925.
Testing: check-profile, llvm-cov lit tests
Differential Revision: https://reviews.llvm.org/D36014
llvm-svn: 310012
|
|
|
|
|
|
|
| |
Make `-show-instantiations=false` actually skip displaying instantiation
sub-views, instead of simply ignoring the option.
llvm-svn: 309903
|
|
|
|
|
|
|
|
|
|
|
| |
The coverage tool needs to know which slice to look at when it's handed
a universal binary. Some projects need to look at aggregate coverage
reports for a variety of slices in different binaries: this patch adds
support for these kinds of projects to llvm-cov.
rdar://problem/33579007
llvm-svn: 309747
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: t.p.northover, oren_ben_simhon, niravd, mcrosier
Reviewed By: oren_ben_simhon, mcrosier
Subscribers: nhaehnle, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D35466
llvm-svn: 308193
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR30735 reports an issue where llvm-cov hangs with a worker thread
waiting on a condition, and the main thread waiting to join() the
workers. While this doesn't appear to be a bug in llvm-cov or the
ThreadPool implementation, it would be helpful to disable the use of
threading in the llvm-cov tests where no test coverage is added.
More context: https://bugs.llvm.org/show_bug.cgi?id=30735
llvm-svn: 307610
|
|
|
|
|
|
|
|
|
|
| |
When an output directory is specified, llvm-cov spawns some threads to
speed up the process of writing out file reports. Add an option which
allows users to control how many threads llvm-cov uses.
A CommandGuide.rst update + test is included.
llvm-svn: 307609
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The order in which GCOV file info is printed depends on the string hash
function. This makes some GCOV tests brittle, because the tests must be
updated whenever the hash function changes.
Sort the filenames before printing out the file info to solve the
problem. This should be relatively cheap.
Differential Revision: https://reviews.llvm.org/D32512
llvm-svn: 301371
|
|
|
|
| |
llvm-svn: 296487
|
|
|
|
|
|
|
|
|
| |
Instead of stripping the longest common prefix off of the filenames in a
report, strip out the longest chain of redundant path components. This
fixes the case in PR31982, where there are two files with the same
prefix, and stripping out the LCP makes things less intelligible.
llvm-svn: 296029
|
|
|
|
|
|
| |
PR31395)
llvm-svn: 294137
|
|
|
|
| |
llvm-svn: 294136
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit makes llvm-cov avoid showing 0% (0/0) coverage for things
like file function coverage, etc. in reports and HTML output. This can happen
for files like headers that have macros but no functions. This commit makes
llvm-cov report - (0/0) instead.
rdar://29246480
Differential Revision: https://reviews.llvm.org/D26615
llvm-svn: 287539
|
|
|
|
| |
llvm-svn: 285853
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D25086
llvm-svn: 285088
|
|
|
|
|
|
|
|
|
| |
When we load coverage data from multiple objects, we don't have a way to
attribute a source object to a function record. Printing out the object
filename next to the source filename is already not very useful: soon,
it'll actually become misleading. Stop printing out the filename now.
llvm-svn: 285043
|
|
|
|
|
|
|
|
| |
... so that they don't show up in the index. This came up because polly
contains a .git directory and some other unmapped input in its source
dir.
llvm-svn: 282282
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used to append filenames into a vector of std::string, and then
append a reference to each string into a separate vector. This made it
easier to work with the getUniqueSourceFiles API. But it's buggy.
std::string has a small-string optimization, so you can't expect to
capture a reference to one if you're copying it into a growing vector.
Add a test that triggers this invalid reference to std::string scenario,
and kill the issue with fire by just using ArrayRef<std::string>
everywhere.
llvm-svn: 282281
|
|
|
|
|
|
|
|
|
| |
We've supported restricting coverage reports to a set of files for a
long time. Add support for being able to restrict by entire directories.
I suppose this supersedes D20803.
llvm-svn: 282202
|
|
|
|
| |
llvm-svn: 282020
|
|
|
|
| |
llvm-svn: 281882
|
|
|
|
|
|
|
| |
While we're at it, re-use the logic from CoverageReport to compute
summaries.
llvm-svn: 281877
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are distinct statistics which are useful to look at separately.
Example: say you have a template function "foo" with 5 instantiations
and only 3 of them are covered. Then this contributes (1/1) to the total
function coverage and (3/5) to the total instantiation coverage. I.e,
the old "Function Coverage" column has been renamed to "Instantiation
Coverage", and the new "Function Coverage" aggregates information from
the various instantiations of a function.
One benefit of making this switch is that the Line and Region coverage
columns will start making sense. Let's continue the example and assume
that the 5 instantiations of "foo" cover {2, 4, 6, 8, 10} out of 10
lines respectively. The new line coverage for "foo" is (10/10), not
(30/50). The old scenario got confusing because we'd report that there
were more lines in a file than what was actually possible.
llvm-svn: 281875
|
|
|
|
| |
llvm-svn: 281872
|
|
|
|
|
|
|
|
| |
Copying in the full text of the function doesn't help at all when we
already know that it's never executed. Just say that it's unexecuted --
the relevant source text has already been printed.
llvm-svn: 281589
|
|
|
|
|
|
|
| |
Doing so is pointless, since the whole view is usually visible in a
small amount of space.
llvm-svn: 281588
|
|
|
|
|
|
|
| |
Having the same title, timestamp, etc. occur repeatedly creates an
unnecessary distraction when paging through a report.
llvm-svn: 281579
|
|
|
|
|
|
|
| |
E.g the 'showProjectSummary' test contains some checks which can't fail
because they match themselves...
llvm-svn: 281578
|
|
|
|
|
|
|
| |
Having the version information in every view is distracting, especially
if there are several sub-views.
llvm-svn: 281414
|
|
|
|
|
|
|
|
|
|
| |
number>" in the coverage report.
The llvm-cov version information will be useful to the user when comparing the code coverage across different versions of llvm-cov. This patch provides the llvm-cov version information in the generated coverage report.
Differential Revision: https://reviews.llvm.org/D24457
llvm-svn: 281321
|
|
|
|
|
|
|
| |
Having it in the same row as the source name is jarring. Move it next to
the "Source" column label.
llvm-svn: 281146
|