summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData
Commit message (Collapse)AuthorAgeFilesLines
...
* llvm-cov: Try to appease MSVC after r217404Justin Bogner2014-09-081-2/+2
| | | | llvm-svn: 217406
* llvm-cov: Use ErrorOr rather than an error_code* (NFC)Justin Bogner2014-09-081-24/+17
| | | | llvm-svn: 217404
* Make some helpers static or move into the llvm namespace.Benjamin Kramer2014-09-031-1/+2
| | | | llvm-svn: 217077
* llvm-cov: add code coverage tool that's based on coverage mapping format and ↵Alex Lorenz2014-08-221-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
* Coverage Mapping: add function's hash to coverage function records.Alex Lorenz2014-08-211-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
* Don't own the buffer in object::Binary.Rafael Espindola2014-08-191-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
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-3/+3
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* Coverage: add HasCodeBefore flag to a mapping region.Alex Lorenz2014-08-042-7/+15
| | | | | | | | | 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
* InstrProf: Allow multiple functions with the same nameJustin Bogner2014-08-013-40/+82
| | | | | | | | | | | | | | | | | | | | | | | This updates the instrumentation based profiling format so that when we have multiple functions with the same name (but different function hashes) we keep all of them instead of rejecting the later ones. There are a number of scenarios where this can come up where it's more useful to keep multiple function profiles: * Name collisions in unrelated libraries that are profiled together. * Multiple "main" functions from multiple tools built against a common library. * Combining profiles from different build configurations (ie, asserts and no-asserts) The profile format now stores the number of counters between the hash and the counts themselves, so that multiple sets of counts can be stored. Since this is backwards incompatible, I've bumped the format version and added some trivial logic to skip this when reading the old format. llvm-svn: 214585
* Use std::unique_ptr to make the ownership explicit.Rafael Espindola2014-07-311-2/+2
| | | | llvm-svn: 214377
* llvm-profdata: Clean up and reorganize some testsJustin Bogner2014-07-291-2/+2
| | | | | | | | This moves some tests around to make it clearer what's being tested, and adds very rudimentary comment syntax to the text input format to make specifying this kind of test a little bit simpler. llvm-svn: 214235
* Coverage: improve efficiency of the counter propagation to the expansion ↵Alex Lorenz2014-07-291-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
* Coverage: fix the missing output stream in recursive call to ↵Alex Lorenz2014-07-291-2/+2
| | | | | | CoverageMappingContext::dump llvm-svn: 214206
* coverage: remove empty mapping regionsAlex Lorenz2014-07-252-8/+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
* Fix a warning in CoverageMappingReader.cppEhsan Akhgari2014-07-251-1/+1
| | | | llvm-svn: 213920
* Add code coverage mapping data, reader, and writer.Alex Lorenz2014-07-243-0/+828
| | | | | | | | | 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
* Add code coverage mapping data, reader, and writer.Alex Lorenz2014-07-242-1/+4
| | | | | | | | | 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: 213909
* Update the MemoryBuffer API to use ErrorOr.Rafael Espindola2014-07-061-1/+4
| | | | llvm-svn: 212405
* Renaming SwapByteOrder() to getSwappedBytes()Artyom Skrobov2014-06-141-1/+1
| | | | | | The next commit will add swapByteOrder(), acting in-place llvm-svn: 210973
* Remove unused and odd code.Rafael Espindola2014-06-131-6/+0
| | | | | | | | This code was never being used and any use of it would look fairly strange. For example, it would try to map a object_error::parse_failed to std::errc::invalid_argument. llvm-svn: 210912
* Remove 'using std::errro_code' from lib.Rafael Espindola2014-06-131-19/+22
| | | | llvm-svn: 210871
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-122-3/+5
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* Don't import error_category into the llvm namespace.Rafael Espindola2014-06-121-2/+2
| | | | llvm-svn: 210733
* Don't import error_condition into the llvm namespace.Rafael Espindola2014-06-121-2/+3
| | | | llvm-svn: 210731
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards. The cases where the general idea needed some tweaking: * std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch. * Template specialization had to be moved to the std namespace in this patch set already. * The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time. Despite these shortcomings I think this is still a good thing. Some reasons: * The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++. llvm-svn: 210687
* Mark a few functions noexcept.Rafael Espindola2014-06-101-2/+2
| | | | | | This reduces the difference between std::error_code and llvm::error_code. llvm-svn: 210591
* Use an enum class.Rafael Espindola2014-06-031-2/+2
| | | | | | Might also fix the windows build. llvm-svn: 210077
* There is no std::errc::success, remove the llvm one.Rafael Espindola2014-05-311-1/+1
| | | | llvm-svn: 209960
* ProfileData: Allow multiple profiles in RawInstrProfReaderJustin Bogner2014-05-161-4/+29
| | | | | | | | | | | | | | | | | | | Allow multiple raw profiles to coexist in a single .profraw file, given the following conditions: - Zero padding at the end of or between profiles will be skipped. - Each profile must start with a valid header. - Mixing endianness or pointer sizes in concatenated profiles files is not allowed. This is needed to handle cases where a program's shared libraries are profiled as well as the main executable itself, as we'll need to emit each executable's counters. Combining the tables in the runtime would be expensive for the instrumented program. rdar://16918688 llvm-svn: 208938
* Fixing a cast-qual warning. getBufferStart() and getBufferEnd() both return ↵Aaron Ballman2014-05-011-2/+3
| | | | | | | | a const char *, so casting to non-const was triggering a warning (even though the assignment and usage was always const anyway). No functional changes intended. llvm-svn: 207774
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-291-0/+1
| | | | | | necessary. llvm-svn: 207593
* [C++11] Add 'override' keywords and remove 'virtual'. Additionally add ↵Craig Topper2014-04-291-1/+1
| | | | | | 'final' and leave 'virtual' on some methods that are marked virtual without overriding anything and have no obvious overrides themselves. llvm-svn: 207511
* ProfileData: Treat missing function counts as malformedJustin Bogner2014-04-251-2/+6
| | | | llvm-svn: 207172
* ProfileData: Avoid unnecessary copies of CounterDataJustin Bogner2014-04-231-6/+6
| | | | | | | | We're currently copying CounterData from InstrProfWriter into the OnDiskHashTable, even though we don't need to, and then carelessly leaking those copies. A const pointer is much better here. llvm-svn: 207009
* ProfileData: Remove an extra semicolonJustin Bogner2014-04-191-1/+1
| | | | | | Spotted by Nick Lewycky in review, thanks! llvm-svn: 206708
* OnDiskHashTable: Audit types and use offset_type consistentlyJustin Bogner2014-04-191-4/+4
| | | | llvm-svn: 206675
* ProfileData: Don't forward declare ComputeHash and make it static inlineJustin Bogner2014-04-182-1/+6
| | | | llvm-svn: 206663
* ProfileData: Add support for the indexed instrprof formatJustin Bogner2014-04-184-17/+245
| | | | | | | | This adds support for an indexed instrumentation based profiling format, which is just a small header and an on disk hash table. This format will be used by clang's -fprofile-instr-use= for PGO. llvm-svn: 206656
* InstrProf: Silence spurious warnings in GCC 4.8Duncan P. N. Exon Smith2014-03-241-9/+13
| | | | | | No functionality change. llvm-svn: 204580
* InstrProf: Check pointer size in raw profileDuncan P. N. Exon Smith2014-03-231-11/+40
| | | | | | | | | | | | | | | Since the profile can come from 32-bit machines, we need to check the pointer size. Change the magic number to facilitate this. Adds tests for reading 32-bit and 64-bit binaries (both big- and little-endian). The tests write a binary using printf in RUN lines (like raw-magic-but-no-header.test). Assuming the bots don't complain, this seems like a better way forward for testing RawInstrProfReader than committing binary files. <rdar://problem/16400648> llvm-svn: 204557
* [CMake] LLVMProfileData: No need to add LINK_LIBS here. LLVMBuild should do.NAKAMURA Takumi2014-03-231-4/+1
| | | | llvm-svn: 204553
* InstrProf: Move constructor to the headerDuncan P. N. Exon Smith2014-03-211-3/+0
| | | | | | | | Fixes 80-column violation at the same time. <rdar://problem/15950346> llvm-svn: 204516
* InstrProf: Change magic number to have non-text charactersDuncan P. N. Exon Smith2014-03-211-8/+8
| | | | | | | | | Include non-text characters in the magic number so that text files can't match. <rdar://problem/15950346> llvm-svn: 204513
* InstrProf: Use move semantics with unique_ptrDuncan P. N. Exon Smith2014-03-211-4/+4
| | | | | | <rdar://problem/15950346> llvm-svn: 204512
* InstrProf: Detect magic numbers in a more scalable wayDuncan P. N. Exon Smith2014-03-211-34/+32
| | | | | | | | No functionality change. <rdar://problem/15950346> llvm-svn: 204511
* InstrProf: Actually detect bad headersDuncan P. N. Exon Smith2014-03-212-7/+7
| | | | | | <rdar://problem/15950346> llvm-svn: 204510
* InstrProf: Read raw binary profile in llvm-profdataDuncan P. N. Exon Smith2014-03-211-4/+106
| | | | | | | | | | | | | | Read a raw binary profile that corresponds to a memory dump from the runtime profile. The test is a binary file generated from cfe/trunk/test/Profile/c-general.c with the new compiler-rt runtime and the matching text version of the input. It includes instructions on how to regenerate. <rdar://problem/15950346> llvm-svn: 204496
* ProfileData: Avoid brace initialization, windows doesn't like itJustin Bogner2014-03-211-1/+3
| | | | llvm-svn: 204494
* ProfileData: Introduce InstrProfWriter using the naive text formatJustin Bogner2014-03-213-0/+65
| | | | | | | | | | | This isn't a format we'll want to write out in practice, but moving it to the writer library simplifies llvm-profdata and isolates it from further changes to the format. This also allows us to update the tests to not rely on the text output format. llvm-svn: 204489
* ProfileData: Introduce the InstrProfReader interface and a text readerJustin Bogner2014-03-215-0/+183
This introduces the ProfileData library and updates llvm-profdata to use this library for reading profiles. InstrProfReader is an abstract base class that will be subclassed for both the raw instrprof data from compiler-rt and the efficient instrprof format that will be used for PGO. llvm-svn: 204482
OpenPOWER on IntegriCloud