summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/GCOV.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove more superfluous .str() and replace std::string concatenation with Twine.Yaron Keren2015-03-301-1/+1
| | | | | | Following r233392, http://llvm.org/viewvc/llvm-project?rev=233392&view=rev. llvm-svn: 233555
* Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used.Benjamin Kramer2015-03-231-0/+1
| | | | llvm-svn: 232998
* [gcov] Move formatBranchInfo into an anonymous namespace.Benjamin Kramer2015-03-231-1/+1
| | | | | | NFC. llvm-svn: 232949
* llvm-cov: Warn instead of error if a .gcda has arcs from an exit blockJustin Bogner2015-03-171-1/+3
| | | | | | Patch by Vanderson M. Rosario. Thanks! llvm-svn: 232443
* llvm-cov: Don't use llvm::outs() in library codeJustin Bogner2015-01-231-41/+43
| | | | | | | Nothing in lib/ should be using llvm::outs() directly. Thread it in from the caller instead. llvm-svn: 226961
* llvm-cov: Use range-for (NFC)Justin Bogner2015-01-231-49/+21
| | | | llvm-svn: 226960
* llvm-cov: clang-format the GCOV files (NFC)Justin Bogner2015-01-231-85/+133
| | | | llvm-svn: 226952
* GCOV: Make sure that function idents in the .gcda and .gcno matchJustin Bogner2014-11-061-1/+2
| | | | | | | | | | | | | | When generating gcov compatible profiling, we sometimes skip emitting data for functions for one reason or another. However, this was emitting different function IDs in the .gcno and .gcda files, because the .gcno case was using the loop index before skipping functions and the .gcda the array index after. This resulted in completely invalid gcov data. This fixes the problem by making the .gcno loop track the ID separately from the loop index. llvm-svn: 221441
* Modernize raw_fd_ostream's constructor a bit.Rafael Espindola2014-08-251-5/+5
| | | | | | | | | | Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error. A create static method would be even better, but this patch is already a bit too big. llvm-svn: 216393
* Update the MemoryBuffer API to use ErrorOr.Rafael Espindola2014-07-061-2/+6
| | | | llvm-svn: 212405
* Remove 'using std::errro_code' from lib.Rafael Espindola2014-06-131-2/+1
| | | | llvm-svn: 210871
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-121-0/+1
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* Remove system_error.h.Rafael Espindola2014-06-121-1/+1
| | | | | | | This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
* llvm-cov: Explicitly namespace llvm::make_unique to keep MSVC happyJustin Bogner2014-05-071-4/+2
| | | | | | | | This is a followup to r208171, where a call to make_unique was disambiguated for MSVC. Disambiguate two more calls, and remove the comment about it since this is what we do everywhere. llvm-svn: 208219
* Work-around MSVS build breakage due to r208148Timur Iskhodzhanov2014-05-071-2/+4
| | | | llvm-svn: 208171
* llvm-cov: Handle missing source files as GCOV doesJustin Bogner2014-05-071-13/+29
| | | | | | | | | | | If the source files referenced by a gcno file are missing, gcov outputs a coverage file where every line is simply /*EOF*/. This also occurs for lines in the coverage that are past the end of a file that is found. This change mimics gcov. llvm-svn: 208149
* llvm-cov: Implement --no-outputJustin Bogner2014-05-071-15/+43
| | | | | | | | In gcov, there's a -n/--no-output option, which disables the writing of any .gcov files, so that it emits only the summary info on stdout. This implements the same behaviour in llvm-cov. llvm-svn: 208148
* llvm-cov: Fix handling of line zero appearing in a line tableJustin Bogner2014-05-021-6/+18
| | | | | | | | | | | | | Reading line tables in llvm-cov was pretty broken, but would happen to work as long as no line in the table was 0. It's not clear to me whether a line of zero *should* show up in these tables, but deciding to read a string in the middle of the line table is certainly the wrong thing to do if it does. I've also added some comments, as trying to figure out what this block of code was doing was fairly unpleasant. llvm-svn: 207866
* llvm-cov: Add support for gcov's --long-file-names optionJustin Bogner2014-04-231-5/+9
| | | | | | | | GCOV provides an option to prepend output file names with the source file name, to disambiguate between covered data that's included from multiple sources. Add a flag to llvm-cov that does the same. llvm-svn: 207035
* Use unique_ptr to manage ownership of GCOVFunctions, Blocks, and Edges.David Blaikie2014-04-211-36/+21
| | | | llvm-svn: 206796
* llvm-cov: Handle functions with no line numberJustin Bogner2014-03-261-0/+5
| | | | | | | | | Functions may in an instrumented binary but not in the original source when they're inserted by the compiler or the runtime. These functions aren't meaningful to the user, so teach llvm-cov to skip over them instead of crashing. llvm-svn: 204863
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-2/+1
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-241-1/+1
| | | | | | | | | After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) llvm-svn: 202052
* Don't make F_None the default.Rafael Espindola2014-02-241-1/+1
| | | | | | This will make it easier to switch the default to being binary files. llvm-svn: 202042
* llvm-cov: Fix include order in GCOV.cppJustin Bogner2014-02-041-3/+3
| | | | llvm-svn: 200796
* llvm-cov: Implement the preserve-paths flagJustin Bogner2014-02-041-10/+49
| | | | | | | | | | | | | | | | Until now, when a path in a gcno file included a directory, we would emit our .gcov file in that directory, whereas gcov always emits the file in the current directory. In doing so, this implements gcov's strange name-mangling -p flag, which is needed to avoid clobbering files when two with the same name exist in different directories. The path mangling is a bit ugly and only handles unix-like paths, but it's simple, and it doesn't make any guesses as to how it should behave outside of what gcov documents. If we decide this should be cross platform later, we can consider the compatibility implications then. llvm-svn: 200754
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-1/+1
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* GCOV.cpp: Fix format strings, %lf. Don't use %lf to double.NAKAMURA Takumi2013-12-191-3/+3
| | | | llvm-svn: 197663
* llvm-cov: Added -f option for function summaries.Yuchen Wu2013-12-191-15/+81
| | | | | | | | | | | Similar to the file summaries, the function summaries output line, branching and call statistics. The file summaries have been moved outside the initial loop so that all of the function summaries can be outputted before file summaries. Also updated test cases. llvm-svn: 197633
* llvm-cov: Print coverage summary to STDOUT.Yuchen Wu2013-12-181-3/+38
| | | | | | | | | | | | File summaries will now be optionally outputted which will give line, branching and call coverage info. Unfortunately, clang's current instrumentation does not give enough information to deduce function calls, something that gcc is able to do. Thus, no calls are always outputted to be consistent with gcov output. Also updated tests. llvm-svn: 197606
* llvm-cov: s/(.*)Executed/\1Exec/Yuchen Wu2013-12-181-3/+3
| | | | llvm-svn: 197595
* llvm-cov: Added -c option for branch counts.Yuchen Wu2013-12-181-11/+30
| | | | | | | | | This will cause llvm-cov to output branch counts instead of branch probabilities. -b must be enabled. Also updated tests. llvm-svn: 197594
* llvm-cov: Added -u option for unconditional branch info.Yuchen Wu2013-12-161-8/+18
| | | | | | | | | Outputs branch information for unconditional branches in addition to conditional branches. -b option must be enabled. Also updated tests. llvm-svn: 197432
* llvm-cov: Removed extra semicolon from ;;.Yuchen Wu2013-12-161-1/+1
| | | | llvm-svn: 197418
* llvm-cov: Added -b option for branch probabilities.Yuchen Wu2013-12-131-22/+135
| | | | | | | | | | | This option tells llvm-cov to print out branch probabilities when a basic block contains multiple branches. It also prints out some function summary info including the number of times the function enters, the percent of time it returns, and how many blocks were executed. Also updated tests. llvm-svn: 197198
* GCOV.cpp: Use PRIu64 instead of %lu.NAKAMURA Takumi2013-12-101-1/+1
| | | | llvm-svn: 196882
* llvm-cov: Added -a option for block data.Yuchen Wu2013-12-101-3/+30
| | | | | | | | | | | | | | | Similar to gcov, llvm-cov will now print out the block count at the end of each block. Multiple blocks can end on the same line. One computational difference is by using -a, llvm-cov will no longer simply add the block counts together to form a line count. Instead, it will take the maximum of the block counts on that line. This has a similar effect to what gcov does, but generates more correct counts in certain scenarios. Also updated tests. llvm-svn: 196856
* llvm-cov: Further improved error messages.Yuchen Wu2013-12-051-5/+7
| | | | llvm-svn: 196542
* llvm-cov: Conformed headers.Yuchen Wu2013-12-051-1/+1
| | | | llvm-svn: 196541
* llvm-cov: Changed extension from .llcov to .gcov.Yuchen Wu2013-12-051-1/+1
| | | | llvm-svn: 196530
* Un-revert r196358: "llvm-cov: Added support for function checksums."Daniel Jasper2013-12-041-3/+9
| | | | | | And add the proper fix. llvm-svn: 196367
* Revert r196358: "llvm-cov: Added support for function checksums."Daniel Jasper2013-12-041-9/+3
| | | | | | | This currently breaks clang/test/CodeGen/code-coverage.c. The root cause is that the newly introduced access to Funcs[j] is out of bounds. llvm-svn: 196365
* llvm-cov: Added support for function checksums.Yuchen Wu2013-12-041-3/+9
| | | | | | | The function checksums are hashed from the concatenation of the function name and line number. llvm-svn: 196358
* llvm-cov: Added checks for ident, checksum, name.Yuchen Wu2013-12-041-15/+45
| | | | | | | Added additional checks for the Identifier, CfgChecksum and Name for each GCOVFunction. Also added function names in error messages. llvm-svn: 196356
* llvm-cov: Capitalized GCNO and GCDA for consistency.Yuchen Wu2013-12-041-5/+5
| | | | llvm-svn: 196354
* llvm-cov: Split GCOVFile's read into GCNO and GCDA.Yuchen Wu2013-12-041-52/+55
| | | | | | | | This splits the file-scope read() function into readGCNO() and readGCDA(). Also broke file format read into functions that first read the file type, then check the version. llvm-svn: 196353
* llvm-cov: Cleaned up print() function slightly.Yuchen Wu2013-12-031-9/+7
| | | | | | Changed while to for loop. Removed unnecessary if statement. llvm-svn: 196194
* llvm-cov: Removed output to STDOUT/specified file.Yuchen Wu2013-12-031-2/+7
| | | | | | | | | | | | Instead of asking the user to specify a single file to output coverage info and defaulting to STDOUT, llvm-cov now creates files for each source file with a naming system of: <source filename> + ".llcov". This is what gcov does and although it can clutter the working directory with numerous coverage files, it will be easier to hook the llvm-cov output to tools which operate on this assumption (such as lcov). llvm-svn: 196184
* llvm-cov: Store blocks rather than counts per line.Yuchen Wu2013-12-031-7/+13
| | | | | | | | | Each line stores all the blocks that execute on that line, instead of only storing the line counts previously accumulated. This provides more information for each line, and will be useful for options in enabling block and branch information. llvm-svn: 196177
* llvm-cov: Added edge struct for traversal in block.Yuchen Wu2013-12-031-12/+39
| | | | | | | | | | | | | Added GCOVEdge which are simple structs owned by the GCOVFunction that stores the source and destination GCOVBlocks, as well as the counts. Changed GCOVBlocks so that it stores a vector of source GCOVEdges and a vector of destination GCOVEdges, rather than just the block number. Storing the block number was only useful for knowing the number of edges and for debug info. Using a struct is useful for traversing the edges, especially back edges which may be needed later. llvm-svn: 196175
OpenPOWER on IntegriCloud