summaryrefslogtreecommitdiff
path: root/lib/ProfileData/InstrProfReader.cpp
Commit message (Collapse)AuthorAge
* Renaming SwapByteOrder() to getSwappedBytes()Artyom Skrobov2014-06-14
| | | | | | | | The next commit will add swapByteOrder(), acting in-place git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210973 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove 'using std::errro_code' from lib.Rafael Espindola2014-06-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210871 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-12
| | | | | | This should make sure that most new uses use the std prefix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210835 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Allow multiple profiles in RawInstrProfReaderJustin Bogner2014-05-16
| | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208938 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing a cast-qual warning. getBufferStart() and getBufferEnd() both return ↵Aaron Ballman2014-05-01
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207774 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Treat missing function counts as malformedJustin Bogner2014-04-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207172 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Don't forward declare ComputeHash and make it static inlineJustin Bogner2014-04-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206663 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Add support for the indexed instrprof formatJustin Bogner2014-04-18
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206656 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Silence spurious warnings in GCC 4.8Duncan P. N. Exon Smith2014-03-24
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204580 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Check pointer size in raw profileDuncan P. N. Exon Smith2014-03-23
| | | | | | | | | | | | | | | 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> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204557 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Move constructor to the headerDuncan P. N. Exon Smith2014-03-21
| | | | | | | | Fixes 80-column violation at the same time. <rdar://problem/15950346> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204516 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Change magic number to have non-text charactersDuncan P. N. Exon Smith2014-03-21
| | | | | | | | | Include non-text characters in the magic number so that text files can't match. <rdar://problem/15950346> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204513 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Use move semantics with unique_ptrDuncan P. N. Exon Smith2014-03-21
| | | | | | <rdar://problem/15950346> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204512 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Detect magic numbers in a more scalable wayDuncan P. N. Exon Smith2014-03-21
| | | | | | | | No functionality change. <rdar://problem/15950346> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204511 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Actually detect bad headersDuncan P. N. Exon Smith2014-03-21
| | | | | | <rdar://problem/15950346> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204510 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Read raw binary profile in llvm-profdataDuncan P. N. Exon Smith2014-03-21
| | | | | | | | | | | | | | 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> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204496 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Introduce the InstrProfReader interface and a text readerJustin Bogner2014-03-21
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204482 91177308-0d34-0410-b5e6-96231b3b80d8