diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-04-19 00:33:15 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-04-19 00:33:15 +0000 |
commit | 55c1e1bd26b57ef524eff3524a350a59e33a04c5 (patch) | |
tree | 71a9a1ff5db8056b956495245edd747f5e12f451 /include | |
parent | e382065b82e0a4858019c7ca4ce1c11227c7bd67 (diff) | |
download | llvm-55c1e1bd26b57ef524eff3524a350a59e33a04c5.tar.gz llvm-55c1e1bd26b57ef524eff3524a350a59e33a04c5.tar.bz2 llvm-55c1e1bd26b57ef524eff3524a350a59e33a04c5.tar.xz |
OnDiskHashTable: Audit types and use offset_type consistently
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ProfileData/InstrProfReader.h | 4 | ||||
-rw-r--r-- | include/llvm/Support/OnDiskHashTable.h | 13 |
2 files changed, 9 insertions, 8 deletions
diff --git a/include/llvm/ProfileData/InstrProfReader.h b/include/llvm/ProfileData/InstrProfReader.h index 18a7e43437..3bb482e20f 100644 --- a/include/llvm/ProfileData/InstrProfReader.h +++ b/include/llvm/ProfileData/InstrProfReader.h @@ -227,11 +227,11 @@ public: return std::make_pair(KeyLen, DataLen); } - StringRef ReadKey(const unsigned char *D, unsigned N) { + StringRef ReadKey(const unsigned char *D, offset_type N) { return StringRef((const char *)D, N); } - InstrProfRecord ReadData(StringRef K, const unsigned char *D, unsigned N) { + InstrProfRecord ReadData(StringRef K, const unsigned char *D, offset_type N) { if (N < 2 * sizeof(uint64_t) || N % sizeof(uint64_t)) { // The data is corrupt, don't try to read it. CountBuffer.clear(); diff --git a/include/llvm/Support/OnDiskHashTable.h b/include/llvm/Support/OnDiskHashTable.h index 289f7922f2..14bfd9ad4f 100644 --- a/include/llvm/Support/OnDiskHashTable.h +++ b/include/llvm/Support/OnDiskHashTable.h @@ -48,10 +48,11 @@ namespace llvm { /// static std::pair<offset_type, offset_type> /// EmitKeyDataLength(raw_ostream &Out, key_type_ref Key, data_type_ref Data); /// /// Write Key to Out. KeyLen is the length from EmitKeyDataLength. -/// static void EmitKey(raw_ostream &Out, key_type_ref Key, unsigned KeyLen); +/// static void EmitKey(raw_ostream &Out, key_type_ref Key, +/// offset_type KeyLen); /// /// Write Data to Out. DataLen is the length from EmitKeyDataLength. /// static void EmitData(raw_ostream &Out, key_type_ref Key, -/// data_type_ref Data, unsigned DataLen); +/// data_type_ref Data, offset_type DataLen); /// }; /// \endcode template <typename Info> class OnDiskChainedHashTableGenerator { @@ -227,11 +228,11 @@ public: /// /// Read the key from Buffer, given the KeyLen as reported from /// /// ReadKeyDataLength. /// const internal_key_type &ReadKey(const unsigned char *Buffer, -/// unsigned KeyLen); +/// offset_type KeyLen); /// /// Read the data for Key from Buffer, given the DataLen as reported from /// /// ReadKeyDataLength. /// data_type ReadData(StringRef Key, const unsigned char *Buffer, -/// unsigned DataLen); +/// offset_type DataLen); /// }; /// \endcode template <typename Info> class OnDiskChainedHashTable { @@ -268,12 +269,12 @@ public: class iterator { internal_key_type Key; const unsigned char *const Data; - const unsigned Len; + const offset_type Len; Info *InfoObj; public: iterator() : Data(0), Len(0) {} - iterator(const internal_key_type K, const unsigned char *D, unsigned L, + iterator(const internal_key_type K, const unsigned char *D, offset_type L, Info *InfoObj) : Key(K), Data(D), Len(L), InfoObj(InfoObj) {} |