summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/CodeCoverage.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-cov] Error-out when an unsupported format is used (PR32087)Vedant Kumar2017-02-281-1/+8
| | | | llvm-svn: 296487
* [llvm-cov] Respect Windows line endings when parsing demangled symbols.Igor Kudrin2017-02-191-1/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D30096 llvm-svn: 295605
* [llvm-cov] Don't show function summaries when filtering by filename (fixes ↵Vedant Kumar2017-02-051-1/+5
| | | | | | PR31395) llvm-svn: 294137
* [llvm-cov] Demangle symbols in function summaries (fixes PR31394)Vedant Kumar2017-02-051-1/+1
| | | | llvm-svn: 294136
* [llvm-cov] Refactor logic for storing demangled symbols, NFCVedant Kumar2017-02-051-15/+6
| | | | llvm-svn: 294135
* [llvm-cov] Fix a comment, NFCVedant Kumar2017-02-051-1/+1
| | | | llvm-svn: 294134
* Apply clang-tidy's 'performance-faster-string-find' check to LLVM.Benjamin Kramer2016-11-301-1/+1
| | | | | | No functionality change intended. llvm-svn: 288235
* Fix spelling mistakes in Tools/Tests comments. NFC.Simon Pilgrim2016-11-201-1/+1
| | | | | | Identified by Pedro Giffuni in PR27636. llvm-svn: 287489
* [llvm-cov] Don't use colored output until we know it's supportedVedant Kumar2016-10-251-2/+2
| | | | | | | | | CodeCoverageTool::error() depends on CoverageViewOptions::Colors being initialized. Should fix: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/56 llvm-svn: 285103
* [llvm-cov] Add support for loading coverage from multiple objectsVedant Kumar2016-10-251-9/+23
| | | | | | Differential Revision: https://reviews.llvm.org/D25086 llvm-svn: 285088
* [llvm-cov] Do not print out the filename of the object fileVedant Kumar2016-10-251-10/+2
| | | | | | | | | 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
* Remove TimeValue usage from llvm/SupportPavel Labath2016-10-241-1/+2
| | | | | | | | | | | | | | | | | Summary: This is a follow-up to D25416. It removes all usages of TimeValue from llvm/Support library (except for the actual TimeValue declaration), and replaces them with appropriate usages of std::chrono. To facilitate this, I have added small utility functions for converting time points and durations into appropriate OS-specific types (FILETIME, struct timespec, ...). Reviewers: zturner, mehdi_amini Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25730 llvm-svn: 284966
* [llvm-cov] Don't spawn a thread unless ThreadCount > 1Vedant Kumar2016-10-191-27/+39
| | | | | | | | | | | | Initializing a ThreadPool with ThreadCount = 1 spawns a thread even though we don't need to. This is at least slower than it needs to be, and at worst may somehow be exacerbating PR30735 (llvm-cov times out on ARM bots). As a follow-up, I'll try to add logic to llvm::ThreadPool to avoid spawning a thread when ThreadCount = 1. llvm-svn: 284621
* Turn cl::values() (for enum) from a vararg function to using C++ variadic ↵Mehdi Amini2016-10-081-2/+1
| | | | | | | | | | | | | | | template The core of the change is supposed to be NFC, however it also fixes what I believe was an undefined behavior when calling: va_start(ValueArgs, Desc); with Desc being a StringRef. Differential Revision: https://reviews.llvm.org/D25342 llvm-svn: 283671
* [llvm-cov] Factor out logic to remove unmapped inputs (NFC)Vedant Kumar2016-09-231-5/+13
| | | | llvm-svn: 282286
* [llvm-cov] Filter away source files that aren't in the coverage mappingVedant Kumar2016-09-231-3/+19
| | | | | | | | ... 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
* [llvm-cov] Get rid of all invalid filename referencesVedant Kumar2016-09-231-13/+9
| | | | | | | | | | | | | | 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
* [llvm-cov] Document some fields in a class (NFC)Vedant Kumar2016-09-221-4/+15
| | | | llvm-svn: 282203
* [llvm-cov] Add the ability to specify directories of input source filesVedant Kumar2016-09-221-10/+56
| | | | | | | | | 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-cov] Demangle names for hidden instantiation viewsVedant Kumar2016-09-201-3/+4
| | | | llvm-svn: 282020
* [llvm-cov] Hide instantiation views for unexecuted functionsVedant Kumar2016-09-151-14/+16
| | | | | | | | 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
* [llvm-cov] Emit a summary in the report directory's indexVedant Kumar2016-09-091-1/+1
| | | | | | | | llvm-cov writes out an index file in '-output-dir' mode, albeit not a very informative one. Try to fix that by using the CoverageReport API to include some basic summary information in the index file. llvm-svn: 281011
* [llvm-cov] Use less space to describe source namesVedant Kumar2016-09-081-4/+4
| | | | | | | | In r279628, we made SourceCoverageView list the binary associated with a view and started adding labels (e.g "Source: foo" or "Function: bar") to everything. Condense this information a bit to unclutter reports. llvm-svn: 280896
* [llvm-cov] Clean up the summary class, delete dead code (NFC)Vedant Kumar2016-09-061-1/+1
| | | | llvm-svn: 280764
* [llvm-cov] Add the project summary to the text coverage report for each ↵Ying Yi2016-09-061-1/+1
| | | | | | | | | | source file. This patch is a spin-off from https://reviews.llvm.org/D23922. It extends the text view to preserve the same feature as the html view. Differential Revision: https://reviews.llvm.org/D24241 llvm-svn: 280756
* [llvm-cov] Use the native path in the coverage report.Ying Yi2016-08-301-0/+1
| | | | | | | | | | | 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-241-5/+31
| | | | | | | | | | | | 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] 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-041-0/+5
| | | | | | | | | | | 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
* Retry: [llvm-cov] Add support for exporting coverage data to JSONVedant Kumar2016-07-261-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | 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-261-35/+1
| | | | | | | | | 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-261-1/+35
| | | | | | | | | | | | | | | | | | | | 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] Re-write a very opaque comment (NFC)Vedant Kumar2016-07-181-1/+1
| | | | llvm-svn: 275843
* [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-151-5/+115
| | | | | | | | | | 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-151-0/+3
| | | | 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
* [llvm-cov] Add support for creating html reportsVedant Kumar2016-07-061-0/+10
| | | | | | | | Based on a patch by Harlan Haskins! Differential Revision: http://reviews.llvm.org/D18278 llvm-svn: 274688
* [llvm-cov] Minor cleanups to prepare for the html format patchVedant Kumar2016-06-291-19/+25
| | | | | | | | | | | | - 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
* [llvm-cov] Create an index of reports in -output-dir modeVedant Kumar2016-06-281-5/+14
| | | | | | | | | | 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-281-2/+13
| | | | llvm-svn: 274027
* [llvm-cov] Rename ShowFormat to Format (NFC)Vedant Kumar2016-06-281-2/+2
| | | | | | | 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] Simplify; NFCVedant Kumar2016-06-281-4/+2
| | | | llvm-svn: 273988
OpenPOWER on IntegriCloud