summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov
Commit message (Collapse)AuthorAgeFilesLines
...
* Try to fix the MSVC buildVedant Kumar2016-06-251-2/+2
| | | | | | | | | There's some kind of issue with using "constexpr unsigned" in an anonymous namespace. http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/13395 llvm-svn: 273770
* [llvm-cov] Separate presentation logic from formatting logic, NFCVedant Kumar2016-06-256-201/+363
| | | | | | | | | | 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] Use getOptions() instead of Options in SourceCoverageView, NFCVedant Kumar2016-06-241-14/+16
| | | | | | | A lot of this code is going to move into the text-based coverage renderer, and won't be able to use Options directly. Use the getter. llvm-svn: 273635
* [llvm-cov] Add SourceNames to SourceCoverageViews, NFCVedant Kumar2016-06-243-16/+37
| | | | | | | | | | | | | 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
* [llvm-cov] Rename SourceCoverageView::LineCoverageInfo to LineCoverageStats, NFCVedant Kumar2016-06-242-25/+25
| | | | | | | | | | | | Pull LineCoverageInfo out of SourceCoverageView and rename it so that it doesn't conflict with another class of the same name in CoverageSummaryInfo.h. This cuts down on the amount of code we have to move into a `protected` section of SourceCoverageView for the upcoming html patch. It also makes the code a bit clearer: having two LineCoverageInfo's is strange. llvm-svn: 273633
* NFC, add an "end namespace" comment for consistencyVedant Kumar2016-06-231-1/+2
| | | | llvm-svn: 273577
* Search for llvm-symbolizer binary in the same directory as argv[0], beforeRichard Smith2016-06-094-23/+8
| | | | | | | 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
* [llvm-cov] Use string getters (NFC)Vedant Kumar2016-06-021-2/+3
| | | | llvm-svn: 271537
* 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
* [Coverage] Ensure that coverage mapping data has an expected alignment in ↵Igor Kudrin2016-05-181-1/+5
| | | | | | | | | | | | | 'covmapping' files. Coverage mapping data is organized in a sequence of blocks, each of which is expected to be aligned by 8 bytes. This feature is used when reading those blocks, see VersionedCovMapFuncRecordReader::readFunctionRecords(). If a misaligned covearge mapping data has more than one block, it causes llvm-cov to fail. Differential Revision: http://reviews.llvm.org/D20285 llvm-svn: 269887
* 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-296-7/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D19333 llvm-svn: 268089
* [llvm-cov] Don't emit 'nan%' in reportsVedant Kumar2016-04-291-0/+6
| | | | llvm-svn: 267971
* Thread Expected<...> up from createMachOObjectFile() to allow llvm-objdump ↵Kevin Enderby2016-04-061-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to produce a real error message Produce the first specific error message for a malformed Mach-O file describing the problem instead of the generic message for object_error::parse_failed of "Invalid data was encountered while parsing the file”.  Many more good error messages will follow after this first one. This is built on Lang Hames’ great work of adding the ’Error' class for structured error handling and threading Error through MachOObjectFile construction. And making createMachOObjectFile return Expected<...> . So to to get the error to the llvm-obdump tool, I changed the stack of these methods to also return Expected<...> : object::ObjectFile::createObjectFile() object::SymbolicFile::createSymbolicFile() object::createBinary() Then finally in ParseInputMachO() in MachODump.cpp the error can be reported and the specific error message can be printed in llvm-objdump and can be seen in the existing test case for the existing malformed binary but with the updated error message. Converting these interfaces to Expected<> from ErrorOr<> does involve touching a number of places. To contain the changes for now use of errorToErrorCode() and errorOrToExpected() are used where the callers are yet to be converted. Also there some were bugs in the existing code that did not deal with the old ErrorOr<> return values. So now with Expected<> since they must be checked and the error handled, I added a TODO and a comment: “// TODO: Actually report errors helpfully” and a call something like consumeError(ObjOrErr.takeError()) so the buggy code will not crash since needed to deal with the Error. Note there is one fix also needed to lld/COFF/InputFiles.cpp that goes along with this that I will commit right after this. So expect lld not to built after this commit and before the next one. llvm-svn: 265606
* Remove autoconf supportChris Bieneman2016-01-261-17/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* [llvm-cov] Adjust column widths for function and file reportsVedant Kumar2015-10-211-9/+13
| | | | | | | | Previously, we only expanded function and filename column widths when rendering file reports. This commit makes the change for function reports as well. llvm-svn: 250900
* Rename one of our two llvm::GCOVOptions classes to llvm::GCOV::Options. We usedRichard Smith2015-10-141-3/+3
| | | | | | | to get away with this because llvm/Support/GCOV.h was an implementation detail of the llvm-gcov tool, but it's now being used by FDO. llvm-svn: 250258
* [llvm-cov] Disable name and path truncationVedant Kumar2015-09-142-6/+22
| | | | | | | | | | | Change the output of llvm-cov s.t it does not truncate function names and file paths when printing coverage reports. Differential Revision: http://reviews.llvm.org/D12647 rdar://22531141 llvm-svn: 247635
* [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
* llvm-cov: Make llvm-cov --version DTRTJustin Bogner2015-06-031-0/+8
| | | | | | | | In r233132 we started requiring a subcommand in llvm-cov, but this made `llvm-cov --version` invalid, which is kind of silly. Print version information in this case, as most people would expect. llvm-svn: 238897
* 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
* InstrProf: Fix display of large numbers in llvm-covJustin Bogner2015-05-131-21/+25
| | | | | | | | llvm-cov was truncating numbers that were larger than a particular fixed width, which is as confusing as it is useless. Instead, we use engineering notation with SI prefix for magnitude. llvm-svn: 237307
* 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: Require a subcommand when invoked as llvm-covJustin Bogner2015-03-241-16/+16
| | | | | | | | | | | | | | A while ago llvm-cov gained support for clang's instrumentation based profiling in addition to its gcov support, and subcommands were added to choose which behaviour to use. When no subcommand was specified, we fell back to gcov compatibility with a warning that a subcommand would be required in the future. Now, we require the subcommand. Note that if the basename of llvm-cov is gcov (via symlink or hardlink, for example), we still use the gcov compatible behaviour with no subcommand required. llvm-svn: 233132
* 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
* 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
* Make helper functions static.Benjamin Kramer2015-03-092-4/+5
| | | | | | Found by -Wmissing-prototypes. NFC. llvm-svn: 231664
* InstrProf: Teach llvm-cov to show the max count instead of the lastJustin Bogner2015-02-231-4/+3
| | | | | | | | | | | | When multiple regions start on the same line, llvm-cov was just showing the count of the last one as the line count. This can be confusing and misleading for things like one-liner loops, where the count at the end isn't very interesting, or even "if" statements with an opening brace at the end of the line. Instead, use the maximum of all of the region start counts. llvm-svn: 230263
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-151-1/+1
| | | | | | requiring the macro. NFC; LLVM edition. llvm-svn: 229340
* llvm-cov: Actually use the command line arguments when reportingJustin Bogner2015-02-143-12/+12
| | | | | | | | 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-148-170/+69
| | | | | | | | | | | | | | 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
* llvm-cov: Don't use llvm::outs() in library codeJustin Bogner2015-01-231-1/+1
| | | | | | | Nothing in lib/ should be using llvm::outs() directly. Thread it in from the caller instead. llvm-svn: 226961
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-146-15/+15
| | | | | | | | | | | 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-173-3/+0
| | | | llvm-svn: 224413
* llvm-cov: Sink some reporting logic into CoverageMappingJustin Bogner2014-11-143-39/+11
| | | | | | | | 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
* [Object] Modify OwningBinary's interface to separate inspection from ownership.Lang Hames2014-10-311-1/+1
| | | | | | | | The getBinary and getBuffer method now return ordinary pointers of appropriate const-ness. Ownership is transferred by calling takeBinary(), which returns a pair of the Binary and a MemoryBuffer. llvm-svn: 221003
* llvm-cov: Follow LLVM naming conventionsJustin Bogner2014-10-304-22/+21
| | | | | | 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: Very basic top level helpJustin Bogner2014-10-301-11/+17
| | | | llvm-svn: 220926
OpenPOWER on IntegriCloud