diff options
author | Xinliang David Li <davidxl@google.com> | 2015-10-28 19:34:04 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2015-10-28 19:34:04 +0000 |
commit | cf4a128c6e560a60c6ea6a8f77a48650e24eb768 (patch) | |
tree | 6e81e2aa8eca5559d198725b9a2de24530c4c095 /llvm/include | |
parent | fe44b10735036aa0b60a690897445938e65e2a62 (diff) | |
download | bcm5719-llvm-cf4a128c6e560a60c6ea6a8f77a48650e24eb768.tar.gz bcm5719-llvm-cf4a128c6e560a60c6ea6a8f77a48650e24eb768.zip |
[PGO] RawProf Reader code cleanup
Add a couple of helper methods to make the primary
raw profile reader interface's implementation more
readable. It also hides more format details. This
patch has no functional change.
llvm-svn: 251546
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/ProfileData/InstrProfReader.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/llvm/ProfileData/InstrProfReader.h b/llvm/include/llvm/ProfileData/InstrProfReader.h index e4dfc386000..031b64b7872 100644 --- a/llvm/include/llvm/ProfileData/InstrProfReader.h +++ b/llvm/include/llvm/ProfileData/InstrProfReader.h @@ -156,6 +156,13 @@ private: IntT swap(IntT Int) const { return ShouldSwapBytes ? sys::getSwappedBytes(Int) : Int; } + + std::error_code readName(InstrProfRecord &Record); + std::error_code readFuncHash(InstrProfRecord &Record); + std::error_code readRawCounts(InstrProfRecord &Record); + bool atEnd() const { return Data == DataEnd; } + void advanceData() { Data++; } + const uint64_t *getCounter(IntPtrT CounterPtr) const { ptrdiff_t Offset = (swap(CounterPtr) - CountersDelta) / sizeof(uint64_t); return CountersStart + Offset; |