summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-cov] Use the native path in the coverage report.Ying Yi2016-08-303-2/+10
| | | | | | | | | | | The coverage reports contain the source or binary file paths. On Windows, the file path might contain the seperators of both '/' and '\'. This patch uses the native path in the coverage reports. For example, on Windows, all '/' are converted to '\'. Differential Revision: https://reviews.llvm.org/D23922 llvm-svn: 280061
* [llvm-cov] Add the project summary to each source file coverage report.Ying Yi2016-08-248-36/+194
| | | | | | | | | | | | This patch includes the following changes: - Included header "Code coverage report" and include the date that the report was created. - Included title (as specified in a command line option, (i.e llvm-cov -project-title="Simple Test") - In the summary, list the elf files that the source code file has contributed to. - Used column heading for "Line No.", "Count No.", Source". Differential Revision: https://reviews.llvm.org/D23345 llvm-svn: 279628
* [llvm-cov] Swapped the line and count columns.Ying Yi2016-08-091-2/+2
| | | | | | | | | In the coverage report, the line and count columns have been swapped to make it more readable. A follow-up commit in compiler-rt is needed Differential Revision: https://reviews.llvm.org/D23281 llvm-svn: 278152
* [llvm-cov] Add some documentation for the -tab-size optionVedant Kumar2016-08-041-2/+3
| | | | | | Also, un-hide the cl::opt. llvm-svn: 277741
* [LLVM-COV]Replace tabs to the space indentations in the HTML coverage report.Ying Yi2016-08-043-12/+30
| | | | | | | | | | | When using orbis-llvm-cov.exe to generate the HTML report, the HTML report can look quite different to the source file if it includes tabs.The default tab size is 2 spaces instead of 8 spaces. A command line switch is be added to set the tab size. Differential Revision: https://reviews.llvm.org/D23087 llvm-svn: 277715
* [llvm-cov] Add a debug mode for source range highlighting (in html)Vedant Kumar2016-07-271-10/+34
| | | | | | | llvm-cov's `-dump' option now emits information which helps debug source range highlighting in html mode. llvm-svn: 276924
* Revert "[llvm-cov] Minor aesthetic improvements for html reports"Vedant Kumar2016-07-271-9/+7
| | | | | | This reverts commit r276906. It breaks tests. llvm-svn: 276908
* [llvm-cov] Minor aesthetic improvements for html reportsVedant Kumar2016-07-271-7/+9
| | | | | | | This fixes the highlighting for lines without any coverage segments. I don't have a neat way of testing this yet, but am working on it. llvm-svn: 276906
* [llvm-cov] Escape '\' in strings when emitting JSONVedant Kumar2016-07-271-2/+12
| | | | | | | Test that Windows path separators are escaped properly. Add a round-trip test to verify the JSON produced by the exporter. llvm-svn: 276832
* Retry: [llvm-cov] Add support for exporting coverage data to JSONVedant Kumar2016-07-264-4/+463
| | | | | | | | | | | | | | | | | | | | | | | | This enables users to export coverage information as portable JSON for use by analysis tools and storage in document based databases. The export sub-command is invoked just like the others: llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary The resulting JSON contains a list of files and functions. Every file object contains a list of segments, expansions, and a summary of the file's region, function, and line coverage. Every function object contains the function's name and regions. There is also a total summary for the entire object file. Changes since the initial commit (r276813): - Fixed the regexes in the tests to handle Windows filepaths. Patch by Eddie Hurtig! Differential Revision: https://reviews.llvm.org/D22651 llvm-svn: 276818
* Revert "[llvm-cov] Add support for exporting coverage data to JSON"Vedant Kumar2016-07-264-463/+4
| | | | | | | | | This reverts commit r276813. The Windows bots are complaining about some of the filename regexes in the tests: http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/5299 llvm-svn: 276816
* [llvm-cov] Add support for exporting coverage data to JSONVedant Kumar2016-07-264-4/+463
| | | | | | | | | | | | | | | | | | | | This enables users to export coverage information as portable JSON for use by analysis tools and storage in document based databases. The export sub-command is invoked just like the others: llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary The resulting JSON contains a list of files and functions. Every file object contains a list of segments, expansions, and a summary of the file's region, function, and line coverage. Every function object contains the function's name and regions. There is also a total summary for the entire object file. Patch by Eddie Hurtig! Differential Revision: https://reviews.llvm.org/D22651 llvm-svn: 276813
* [llvm-cov] Don't copy stylesheets into index filesVedant Kumar2016-07-221-1/+2
| | | | | | Just link in the stylesheet from the toplevel dir of the report. llvm-svn: 276468
* [llvm-cov] - Add the coverage of lines in the summary report.Ying Yi2016-07-221-4/+24
| | | | | | | | | | The llvm-cov ‘report' command displays a summary of the coverage of a binary file. The summary report currently only includes covered regions and covered functions. This patch adds the coverage of lines in the summary report. Differential Revision: https://reviews.llvm.org/D22569 llvm-svn: 276409
* test commitYing Yi2016-07-221-1/+1
| | | | llvm-svn: 276401
* [llvm-cov] Use relative paths to the stylesheet (for html reports)Vedant Kumar2016-07-212-58/+73
| | | | | | | | | | This makes it easy to swap out the default stylesheet for a custom one. It also shaves ~6.62 MB out of the report directory for a full coverage build of llvm+clang. While we're at it, prune the CSS and add tests for it. llvm-svn: 276359
* [llvm-cov] Re-write a very opaque comment (NFC)Vedant Kumar2016-07-181-1/+1
| | | | llvm-svn: 275843
* [llvm-cov] Place anchors around line numbers in html reportsVedant Kumar2016-07-181-3/+6
| | | | | | Based on a suggestion by Harlan Haskins! llvm-svn: 275840
* [llvm-cov] Clean up error reporting (NFC)Vedant Kumar2016-07-181-47/+25
| | | | | | Use CodeCoverageTool::{error,warning} everywhere. llvm-svn: 275837
* [llvm-cov] Attempt to appease an older builderVedant Kumar2016-07-151-1/+3
| | | | | | | | | | It's using a version of clang which can't (or won't) deduce an implicit conversion from a SmallString to a StringRef. Write the conversion out explicitly: http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/8574 llvm-svn: 275647
* [llvm-cov] Attempt to appease Windows botsVedant Kumar2016-07-151-1/+2
| | | | | | | | | They appear to reject r275640 because stdin is held open during an ExecuteAndWait in which it's redirected: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/8390 llvm-svn: 275642
* [llvm-cov] Optionally use a symbol demangler when preparing reportsVedant Kumar2016-07-152-5/+120
| | | | | | | | | | Add an option to specify a symbol demangler (as well as options to the demangler). This can be used to make reports more human-readable. This option is especially useful in -output-dir mode, since it isn't as easy to manually pipe reports into a demangler in this mode. llvm-svn: 275640
* [llvm-cov] Document a few private fields of CodeCoverageTool (NFC)Vedant Kumar2016-07-152-1/+4
| | | | llvm-svn: 275639
* [llvm-cov] Improve error messagesVedant Kumar2016-07-151-4/+4
| | | | | | | While we're at it, extend an existing test to make sure that error messages look reasonable. llvm-svn: 275520
* [llvm-cov] Fix a use-after-freeVedant Kumar2016-07-151-1/+1
| | | | | | | | | | | Taking a lock before appending to a vector does no good unless threads reading from the vector also take the lock, because the vector could be re-sized. I don't have a good isolated test for this. I found the issue with ASan while testing a large project. I'm working on a bot that does this. llvm-svn: 275516
* [llvm-cov] Clean up an awkward capture-by-reference (NFC)Vedant Kumar2016-07-151-2/+2
| | | | | | | | Writing `for (StringRef &SourceFile : ...)` is strange to begin with. Subsequently capturing "SourceFile" by reference is even stranger. Just copy the StringRef, since that's cheap to do. llvm-svn: 275515
* [Coverage] Mark a few more methods const (NFC)Vedant Kumar2016-07-151-11/+11
| | | | llvm-svn: 275514
* [llvm-cov] Use a thread pool to speed up report generation (NFC)Vedant Kumar2016-07-131-24/+75
| | | | | | | | | | | | | | It's safe to print out source coverage views using multiple threads when using the -output-dir mode of the `llvm-cov show` sub-command. While testing this on my development machine, I observed that the speed up is roughly linear with the number of available cores. Avg. time for `llvm-cov show ./llvm-as -show-line-counts-or-regions`: 1 thread: 7.79s user 0.33s system 98% cpu 8.228 total 4 threads: 7.82s user 0.34s system 283% cpu 2.880 total llvm-svn: 275321
* Minor formatting change, NFCVedant Kumar2016-07-061-7/+3
| | | | | | | The rest of llvm-cov does not use LLVM_ATTRIBUTE_UNUSED. Leave unused params unnamed to be consistent. llvm-svn: 274694
* [llvm-cov] Add support for creating html reportsVedant Kumar2016-07-066-1/+538
| | | | | | | | Based on a patch by Harlan Haskins! Differential Revision: http://reviews.llvm.org/D18278 llvm-svn: 274688
* [llvm-cov] Use relative paths to file reports in -output-dir modeVedant Kumar2016-06-292-5/+11
| | | | | | This makes it possible to e.g copy a report to another filesystem. llvm-svn: 274173
* Use LLVM_ATTRIBUTE_UNUSED instead of void casts; NFCVedant Kumar2016-06-291-7/+7
| | | | llvm-svn: 274139
* [llvm-cov] Do not allow ".." to escape the coverage sub-directoryVedant Kumar2016-06-291-2/+3
| | | | | | | | | | | In -output-dir mode, file reports are placed into a "coverage" directory. If filenames in the coverage mapping contain "..", they might escape out of this directory. Fix the problem by removing ".." from source filenames (expand the path component). llvm-svn: 274135
* [llvm-cov] Minor cleanups to prepare for the html format patchVedant Kumar2016-06-295-31/+77
| | | | | | | | | | | | - Add renderView{Header,Footer}, renderLineSuffix, and hasSubViews to support creating tables with nested views. - Move the 'Format' cl::opt to make it easier to extend. - Just create one function view file, instead of overwriting the same file for every new function. Add a regression test for this. llvm-svn: 274086
* Fix "not all control paths return a value" warning on MSVCSimon Pilgrim2016-06-281-0/+1
| | | | llvm-svn: 274065
* [llvm-cov] Create an index of reports in -output-dir modeVedant Kumar2016-06-285-93/+151
| | | | | | | | | | This index lists the reports available in the 'coverage' sub-directory. This will help navigate coverage output from large projects. This commit factors the file creation code out of SourceCoverageView and into CoveragePrinter. llvm-svn: 274029
* [llvm-cov] Minor cleanups (NFC)Vedant Kumar2016-06-281-2/+2
| | | | | | | | - Test the '-o' alias for -output-dir. - Use a helper method in a conditional. - Add a period. llvm-svn: 274028
* [llvm-cov] Avoid copying file paths multiple times (NFC)Vedant Kumar2016-06-283-4/+15
| | | | llvm-svn: 274027
* [llvm-cov] Rename ShowFormat to Format (NFC)Vedant Kumar2016-06-283-4/+4
| | | | | | | This makes it a bit more generic, in case we want to emit summary reports in different formats in the future. llvm-svn: 274026
* [llvm-cov] Move a check into a helper method (NFC)Vedant Kumar2016-06-282-1/+4
| | | | llvm-svn: 274025
* Fix "not all control paths return a value" warning on MSVCSimon Pilgrim2016-06-281-0/+1
| | | | llvm-svn: 274011
* [llvm-cov] Simplify; NFCVedant Kumar2016-06-281-4/+2
| | | | llvm-svn: 273988
* Reapply "[llvm-cov] Add an -output-dir option for the show sub-command""Vedant Kumar2016-06-286-6/+124
| | | | | | | | | | | | | | | Passing -output-dir path/to/dir to llvm-cov show creates path/to/dir if it doesn't already exist, and prints reports into that directory. In function view mode, all views are written into path/to/dir/functions.$EXTENSION. In file view mode, all views are written into path/to/dir/coverage/$PATH.$EXTENSION. Changes since the initial commit: - Avoid accidentally closing stdout twice. llvm-svn: 273985
* Revert "[llvm-cov] Add an -output-dir option for the show sub-command"Vedant Kumar2016-06-286-116/+6
| | | | | | | This reverts commit r273971. test/profile/instrprof-visibility.cpp is failing because of an uncaught error in SafelyCloseFileDescriptor. llvm-svn: 273978
* [llvm-cov] Add an -output-dir option for the show sub-commandVedant Kumar2016-06-286-6/+116
| | | | | | | | | | | Passing -output-dir path/to/dir to llvm-cov show creates path/to/dir if it doesn't already exist, and prints reports into that directory. In function view mode, all views are written into path/to/dir/functions.$EXTENSION. In file view mode, all views are written into path/to/dir/coverage/$PATH.$EXTENSION. llvm-svn: 273971
* [llvm-cov] clang-format a line, NFCVedant Kumar2016-06-281-1/+2
| | | | llvm-svn: 273969
* [llvm-cov] Add a format option for the 'show' sub-command (mostly NFC)Vedant Kumar2016-06-283-2/+18
| | | | llvm-svn: 273968
* [llvm-cov] Simplify the way expansion views are rendered (NFC)Vedant Kumar2016-06-264-35/+38
| | | | | | | | | If a sub-view has already been rendered, it's helpful to re-render the expansion site before rendering the next expansion view. Make this fact explicit in the rendering interface, instead of hiding it behind an awkward Optional<LineRef> parameter. llvm-svn: 273789
* [llvm-cov] Make an API more consistent, NFCVedant Kumar2016-06-254-12/+14
| | | | | | | Make renderExpansionView() look a bit more like renderLine(), and clarify its doxygen comment. llvm-svn: 273773
* [llvm-cov] Flesh out some doxygen comments, NFCVedant Kumar2016-06-254-16/+20
| | | | llvm-svn: 273772
OpenPOWER on IntegriCloud