summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/GSI.cpp6
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/GSI.h2
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/GSI.cpp b/llvm/lib/DebugInfo/PDB/Native/GSI.cpp
index b219fe275f7..d77676dbd1c 100644
--- a/llvm/lib/DebugInfo/PDB/Native/GSI.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/GSI.cpp
@@ -29,6 +29,7 @@ static Error checkHashHdrVersion(const GSIHashHeader *HashHdr) {
}
Error readGSIHashBuckets(FixedStreamArray<support::ulittle32_t> &HashBuckets,
+ ArrayRef<uint8_t> &HashBitmap,
const GSIHashHeader *HashHdr,
BinaryStreamReader &Reader) {
if (auto EC = checkHashHdrVersion(HashHdr))
@@ -36,15 +37,14 @@ Error readGSIHashBuckets(FixedStreamArray<support::ulittle32_t> &HashBuckets,
// Before the actual hash buckets, there is a bitmap of length determined by
// IPHR_HASH.
- ArrayRef<uint8_t> Bitmap;
size_t BitmapSizeInBits = alignTo(IPHR_HASH + 1, 32);
uint32_t NumBitmapEntries = BitmapSizeInBits / 8;
- if (auto EC = Reader.readBytes(Bitmap, NumBitmapEntries))
+ if (auto EC = Reader.readBytes(HashBitmap, NumBitmapEntries))
return joinErrors(std::move(EC),
make_error<RawError>(raw_error_code::corrupt_file,
"Could not read a bitmap."));
uint32_t NumBuckets = 0;
- for (uint8_t B : Bitmap)
+ for (uint8_t B : HashBitmap)
NumBuckets += countPopulation(B);
// Hash buckets follow.
diff --git a/llvm/lib/DebugInfo/PDB/Native/GSI.h b/llvm/lib/DebugInfo/PDB/Native/GSI.h
index 9e63bc83548..ce2b301b3cc 100644
--- a/llvm/lib/DebugInfo/PDB/Native/GSI.h
+++ b/llvm/lib/DebugInfo/PDB/Native/GSI.h
@@ -41,7 +41,7 @@ namespace pdb {
static const unsigned IPHR_HASH = 4096;
/// Header of the hash tables found in the globals and publics sections.
-/// Based on GSIHashHeader in
+/// Based on GSIHashHdr in
/// https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.h
struct GSIHashHeader {
enum : unsigned {
diff --git a/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp b/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp
index 9c3e654f808..3b4e18de8f9 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp
@@ -75,7 +75,7 @@ Error PublicsStream::reload() {
if (auto EC = readGSIHashRecords(HashRecords, HashHdr, Reader))
return EC;
- if (auto EC = readGSIHashBuckets(HashBuckets, HashHdr, Reader))
+ if (auto EC = readGSIHashBuckets(HashBuckets, HashBitmap, HashHdr, Reader))
return EC;
NumBuckets = HashBuckets.size();
OpenPOWER on IntegriCloud