aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/CoverageMappingReader.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-10-31[Object] Modify OwningBinary's interface to separate inspection from ownership.Lang Hames1-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
2014-10-10Reduce double set lookups. NFC.Benjamin Kramer1-2/+2
llvm-svn: 219505
2014-10-08Remove bogus std::error_code returns form SectionRef.Rafael Espindola1-1/+2
There are two methods in SectionRef that can fail: * getName: The index into the string table can be invalid. * getContents: The section might point to invalid contents. Every other method will always succeed and returning and std::error_code just complicates the code. For example, a section can have an invalid alignment, but if we are able to get to the section structure at all and create a SectionRef, we will always be able to read that invalid alignment. llvm-svn: 219314
2014-09-20llvm-cov: Move some reader debug output out of the tool.Justin Bogner1-0/+15
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
2014-08-22llvm-cov: add code coverage tool that's based on coverage mapping format and ↵Alex Lorenz1-26/+71
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
2014-08-21Coverage Mapping: add function's hash to coverage function records.Alex Lorenz1-2/+4
The profile data format was recently updated and the new indexing api requires the code coverage tool to know the function's hash as well as the function's name to get the execution counts for a function. Differential Revision: http://reviews.llvm.org/D4994 llvm-svn: 216207
2014-08-19Don't own the buffer in object::Binary.Rafael Espindola1-5/+8
Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too. Keeping this ownership would make supporting IR inside native objects particularly painful. This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer. This patch introduces a few new types. * MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer. The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how. llvm-svn: 216002
2014-08-04Coverage: add HasCodeBefore flag to a mapping region.Alex Lorenz1-6/+10
This flag will be used by the coverage tool to help compute the execution counts for each line in a source file. Differential Revision: http://reviews.llvm.org/D4746 llvm-svn: 214740
2014-07-31Use std::unique_ptr to make the ownership explicit.Rafael Espindola1-2/+2
llvm-svn: 214377
2014-07-29Coverage: improve efficiency of the counter propagation to the expansion ↵Alex Lorenz1-8/+12
regions. This patch reduces the complexity of the two inner loops in order to speed up the loading of coverage data for very large functions. llvm-svn: 214228
2014-07-25coverage: remove empty mapping regionsAlex Lorenz1-3/+0
This patch removes the empty coverage mapping regions. Those regions were produced by clang's old mapping region generation algorithm, but the new algorithm doesn't generate them. llvm-svn: 213981
2014-07-25Fix a warning in CoverageMappingReader.cppEhsan Akhgari1-1/+1
llvm-svn: 213920
2014-07-24Add code coverage mapping data, reader, and writer.Alex Lorenz1-0/+482
This patch implements the data structures, the reader and the writers for the new code coverage mapping system. The new code coverage mapping system uses the instrumentation based profiling to provide code coverage analysis. llvm-svn: 213910