summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/CodeCoverage.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* llvm-cov: Continue trying to appease a botJustin Bogner2015-03-191-1/+4
| | | | | | | | | | | This bot doesn't like me. I don't know why: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/24425 Move the color option enum's definition out of the function that creates the cl::opt. llvm-svn: 232700
* llvm-cov: Try to appease a botJustin Bogner2015-03-191-2/+2
| | | | | | | | | | | | | | The clang-hexagon elf bot was complaining that "Option 'color' registered more than once!": http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/24425 I don't understand why this error is happening, and I don't see it on any other bots or on my own machine, so I'm kind of grasping at straws. Try using an unscoped enum and specifying a cl::init to see if they help. llvm-svn: 232698
* llvm-cov: Only emit colour by default if the output is a ttyJustin Bogner2015-03-191-10/+14
| | | | | | | This replaces the -no-color flag with a -color={auto|always|never} option, with auto as the default, which is much saner. llvm-svn: 232693
* InstrProf: Teach llvm-cov to handle universal binaries when given -archJustin Bogner2015-03-111-1/+17
| | | | llvm-svn: 231902
* llvm-cov: Actually use the command line arguments when reportingJustin Bogner2015-02-141-9/+8
| | | | | | | | This code didn't really make sense as is. If a filename is passed in, the user obviously wants the coverage *for that file*, not *for everything*. llvm-svn: 229217
* llvm-cov: Simplify coverage reports, fixing PR22575 in the processJustin Bogner2015-02-141-4/+1
| | | | | | | | | | | | | | PR22575 occurred because we were unsafely storing references into a std::vector. If the vector moved because it grew, we'd be left iterating through garbage memory. This avoids the issue by simplifying the logic to gather coverage information as we go, rather than storing it and iterating over it. I'm relying on the existing tests showing that this is semantically NFC, since it's difficult to hit the issue this fixes without relatively large covered programs. llvm-svn: 229215
* InstrProf: Remove an unused header (NFC)Justin Bogner2015-02-021-1/+0
| | | | llvm-svn: 227881
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-141-7/+7
| | | | | | | | | | | utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
* Remove unused includes and out of date comment. NFC.Rafael Espindola2014-12-171-1/+0
| | | | llvm-svn: 224413
* llvm-cov: Sink some reporting logic into CoverageMappingJustin Bogner2014-11-141-1/+1
| | | | | | | | This teaches CoverageMapping::getCoveredFunctions to filter to a particular file and uses that to replace most of the logic found in llvm-cov report. llvm-svn: 221962
* llvm-cov: Follow LLVM naming conventionsJustin Bogner2014-10-301-2/+2
| | | | | | This renames a few things that are using an unusual naming convention. llvm-svn: 220929
* llvm-cov: Don't manually parse an option for no reasonJustin Bogner2014-10-301-18/+5
| | | | | | | | We're using cl::opt here, but for some reason we're reading out one particular option by hand instead. This makes -help and the like behave rather poorly, so let's not do it this way. llvm-svn: 220928
* llvm-cov: Allow creating CoverageMappings from filenamesJustin Bogner2014-09-201-18/+1
| | | | llvm-svn: 218185
* llvm-cov: Disentangle the coverage data logic from the display (NFC)Justin Bogner2014-09-201-273/+96
| | | | | | | | | | This splits the logic for actually looking up coverage information from the logic that displays it. These were tangled rather thoroughly so this change is a bit large, but it mostly consists of moving things around. The coverage lookup logic itself now lives in the library, rather than being spread between the library and the tool. llvm-svn: 218184
* llvm-cov: Move some reader debug output out of the tool.Justin Bogner2014-09-201-11/+0
| | | | | | | This debug output is really for testing CoverageMappingReader, not the llvm-cov tool. Move it to where it can be more useful. llvm-svn: 218183
* llvm-cov: Return unique_ptrs instead of filling objects (NFC)Justin Bogner2014-09-191-53/+62
| | | | | | | Having create* functions return the object they create is more readable than using an in-out parameter. llvm-svn: 218139
* llvm-cov: Generalize -filename-equivalenceJustin Bogner2014-09-191-29/+51
| | | | | | | | | | | | | | The filename-equivalence flag allows you to show coverage when your source files don't have the same full paths as those that generated the data. This is mostly useful for writing tests in a cross-platform way. This wasn't triggering in cases where the filename was derived directly from the coverage data, which meant certain types of test case were impossible to write. This patch fixes that, and following patches involve tests that need this. llvm-svn: 218108
* llvm-cov: Simplify FunctionInstantiationSetCollector (NFC)Justin Bogner2014-09-181-28/+15
| | | | | | | | | - Replace std::unordered_map with DenseMap - Use std::pair instead of manually combining two unsigneds - Assert if insert is called with invalid arguments - Avoid an unnecessary copy of a std::vector llvm-svn: 218074
* llvm-cov: Push some more debug output into the View (NFC)Justin Bogner2014-09-171-24/+0
| | | | llvm-svn: 217984
* llvm-cov: Rework the API for getting the coverage of a file (NFC)Justin Bogner2014-09-171-12/+12
| | | | | | | | | | | | This encapsulates how we handle the coverage regions of a file or function. In the old model, the user had to deal with nested regions, so they needed to maintain their own auxiliary data structures to get any useful information out of this. The new API provides a sequence of non-overlapping coverage segments, which makes it possible to render coverage information in a single pass and avoids a fair amount of extra work. llvm-svn: 217975
* llvm-cov: Distinguish expansion/instantiation from SourceCoverageViewJustin Bogner2014-09-171-6/+14
| | | | | | | | | | | | | SourceCoverageView currently has "Kind" and a list of child views, all of which must have either an expansion or an instantiation Kind. In addition to being an error-prone design, this makes it awkward to differentiate between the two child types and adds a number of optionally used members to the type. Split the subview types into their own separate objects, and maintain lists of each rather than one combined "Children" list. llvm-svn: 217940
* llvm-cov: Make debug output more consistentJustin Bogner2014-09-151-4/+4
| | | | | | | | This changes the debug output of the llvm-cov tool to consistently write to stderr, and moves the highlighting output closer to where it's relevant. llvm-svn: 217838
* llvm-cov: Clean up some redundancy in the view API (NFC)Justin Bogner2014-09-151-11/+4
| | | | | | | This removes the need to pass a starting and ending line when creating a SourceCoverageView, since these are easy to determine. llvm-svn: 217746
* llvm-cov: Move FunctionCoverageMapping into CoverageMapping.h (NFC)Justin Bogner2014-09-121-1/+0
| | | | llvm-svn: 217657
* Revert "llvm-cov: Remove an overly system specific test"Justin Bogner2014-09-111-1/+1
| | | | | | | | | | This fixes a call to sys::fs::equivalent that should've been to CodeCoverageTool::equivalentFiles, which lets us restore the test of r217476 that was removed in r217478. This reverts r217478, but the test works this time. llvm-svn: 217646
* llvm-cov: Combine two types that were nearly identical (NFC)Justin Bogner2014-09-091-1/+2
| | | | | | | | | llvm-cov had a SourceRange type that was nearly identical to a CountedRegion except that it shaved off a couple of fields. There aren't likely to be enough of these for the minor memory savings to be worth the extra complexity here. llvm-svn: 217417
* llvm-cov: Rename MappingRegion to coverage::CountedRegion (NFC)Justin Bogner2014-09-091-30/+30
| | | | | | | This name was too similar to CoverageMappingRegion, and the type really belongs in the coverage library anyway. llvm-svn: 217416
* llvm-cov: Use ErrorOr rather than an error_code* (NFC)Justin Bogner2014-09-081-4/+4
| | | | llvm-svn: 217404
* llvm-cov: Remove dead codeJustin Bogner2014-09-081-3/+3
| | | | | | | FunctionCoverageMapping::PrettyName was from a version of the tool during review, and isn't actually used currently. llvm-svn: 217398
* llvm-cov: Don't pointlessly create a unique_ptr (NFC)Justin Bogner2014-09-041-9/+7
| | | | | | | There's no ownership going on here, and no reason to heap allocate this object. llvm-svn: 217113
* llvm-cov: add code coverage tool that's based on coverage mapping format and ↵Alex Lorenz2014-08-221-0/+709
clang's pgo. This commit expands llvm-cov's functionality by adding support for a new code coverage tool that uses LLVM's coverage mapping format and clang's instrumentation based profiling. The gcov compatible tool can be invoked by supplying the 'gcov' command as the first argument, or by modifying the tool's name to end with 'gcov'. Differential Revision: http://reviews.llvm.org/D4445 llvm-svn: 216300
OpenPOWER on IntegriCloud