summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/CodeCoverage.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Reapply "[llvm-cov] Add an -output-dir option for the show sub-command""Vedant Kumar2016-06-281-5/+34
| | | | | | | | | | | | | | | 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-281-34/+5
| | | | | | | 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-281-5/+34
| | | | | | | | | | | 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-281-0/+8
| | | | llvm-svn: 273968
* [llvm-cov] Separate presentation logic from formatting logic, NFCVedant Kumar2016-06-251-16/+12
| | | | | | | | | | This makes it easier to add renderers for new kinds of output formats. - Define and document a pure-virtual coverage rendering interface. - Move the text-based rendering logic into its a new file. - Re-work the API to better reflect the presentation/formatting split. llvm-svn: 273767
* [llvm-cov] Fix two warningsVedant Kumar2016-06-241-5/+5
| | | | | | | | | They were using output streams inconsistently. One also had a grammar bug. I noticed these while trying to pare down D18278. llvm-svn: 273642
* [llvm-cov] Add SourceNames to SourceCoverageViews, NFCVedant Kumar2016-06-241-11/+10
| | | | | | | | | | | | | A SourceName can be a file or a function. It makes sense to attach this information to a SourceCoverageView, seeing as views (1) already point to the text corresponding to the relevant source code and (2) are already used to render that text along with the SourceNames. This is a nice cleanup which is independent of the upcoming html patch. While we're at it, document the fields in SourceCoverageView. llvm-svn: 273634
* Search for llvm-symbolizer binary in the same directory as argv[0], beforeRichard Smith2016-06-091-8/+0
| | | | | | | looking for it along $PATH. This allows installs of LLVM tools outside of $PATH to find the symbolizer and produce pretty backtraces if they crash. llvm-svn: 272232
* Apply most suggestions of clang-tidy's performance-unnecessary-value-paramBenjamin Kramer2016-06-081-1/+1
| | | | | | | Avoids unnecessary copies. All changes audited & pass tests with asan. No functional change intended. llvm-svn: 272190
* Retry^3 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"Vedant Kumar2016-05-191-3/+2
| | | | | | | | | | | | | | | Transition InstrProf and Coverage over to the stricter Error/Expected interface. Changes since the initial commit: - Fix error message printing in llvm-profdata. - Check errors in loadTestingFormat() + annotateAllFunctions(). - Defer error handling in InstrProfIterator to InstrProfReader. - Remove the base ProfError class to work around an MSVC ICE. Differential Revision: http://reviews.llvm.org/D19901 llvm-svn: 270020
* Revert "Retry^2 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC""Vedant Kumar2016-05-161-2/+3
| | | | | | | | This reverts commit r269694. MSVC says: error C2086: 'char llvm::ProfErrorInfoBase<enum llvm::instrprof_error>::ID' : redefinition llvm-svn: 269700
* Retry^2 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"Vedant Kumar2016-05-161-3/+2
| | | | | | | | | | | | | | | Transition InstrProf and Coverage over to the stricter Error/Expected interface. Changes since the initial commit: - Address undefined-var-template warning. - Fix error message printing in llvm-profdata. - Check errors in loadTestingFormat() + annotateAllFunctions(). - Defer error handling in InstrProfIterator to InstrProfReader. Differential Revision: http://reviews.llvm.org/D19901 llvm-svn: 269694
* Revert "Retry "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC""Chandler Carruth2016-05-141-2/+3
| | | | | | | This reverts commit r269491. It triggers warnings with Clang, breaking builds for -Werror users including several build bots. llvm-svn: 269547
* Retry "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"Vedant Kumar2016-05-131-3/+2
| | | | | | | | | | | | | | Transition InstrProf and Coverage over to the stricter Error/Expected interface. Changes since the initial commit: - Fix error message printing in llvm-profdata. - Check errors in loadTestingFormat() + annotateAllFunctions(). - Defer error handling in InstrProfIterator to InstrProfReader. Differential Revision: http://reviews.llvm.org/D19901 llvm-svn: 269491
* Revert "(HEAD -> master, origin/master, origin/HEAD) [ProfileData] (llvm) ↵Vedant Kumar2016-05-131-2/+3
| | | | | | | | Use Error in InstrProf and Coverage, NFC" This reverts commit r269462. It fails two llvm-profdata tests. llvm-svn: 269466
* [ProfileData] (llvm) Use Error in InstrProf and Coverage, NFCVedant Kumar2016-05-131-3/+2
| | | | | | | | | Transition InstrProf and Coverage over to the stricter Error/Expected interface. Differential Revision: http://reviews.llvm.org/D19901 llvm-svn: 269462
* Move coverage related code into a separate library.Easwaran Raman2016-04-291-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D19333 llvm-svn: 268089
* [Object] Search for architecures by name in ↵Frederic Riss2015-06-221-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | MachOUniversalBinary::getObjectForArch() The reason we need to search by name rather than by Triple::ArchType is to handle subarchitecture correclty. There is no different ArchType for the x86_64h architecture (it identifies itself as x86_64), or for the various ARM subarches. The only way to get to the subarch slice in an universal binary is to search by name. This issue led to hard to debug and transient symbolication failures in Asan tests (it mostly works, because the files are very similar). This also affects the Profiling infrastucture as it is the other user of that API. Reviewers: samsonov, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10604 llvm-svn: 240339
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-2/+1
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
* llvm-cov: Warn if object file is newer than profileJustin Bogner2015-05-041-0/+13
| | | | | | | Looking at coverage with an out of date profile can be confusing. Provide a little hint that something might be wrong. llvm-svn: 236408
* llvm-cov: Rename -color={always|never} to -use-color[=0]Justin Bogner2015-03-191-14/+6
| | | | | | | | | | | | | This is an ugly hack to fix the configure --enable-shared build. It turns out that *every cl::opt in LLVM* shows up in *every tool* in that configuration, which is hopelessly broken. This skirts around the issue by not colliding with another option's name, for now. I've also simplified the option implementation - the other "color" option used cl::boolOrDefault and was much nicer than what I'd written before. llvm-svn: 232704
OpenPOWER on IntegriCloud