From: Zachary Turner Date: Tue, 9 Oct 2018 17:58:51 +0000 (+0000) Subject: [PDB] Fix failure on big endian machines. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7dd12b7a8ef05e7802e244f87c632fd72838f4f;p=platform%2Fupstream%2Fllvm.git [PDB] Fix failure on big endian machines. We changed an ArrayRef to an ArrayRef, but it needs to be an ArrayRef. We also change ArrayRef<> to FixedStreamArray<>. Technically an ArrayRef<> will work, but it can cause a copy in the underlying implementation if the memory is not contiguous, and there's no reason not to use a FixedStreamArray<>. Thanks to nemanjai@ and thakis@ for helping me track this down and confirm the fix. llvm-svn: 344063 --- diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h index 97d8197..7f84564 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h +++ b/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h @@ -52,7 +52,7 @@ class GSIHashTable { public: const GSIHashHeader *HashHdr; FixedStreamArray HashRecords; - ArrayRef HashBitmap; + FixedStreamArray HashBitmap; FixedStreamArray HashBuckets; std::array BucketMap; diff --git a/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp b/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp index 786804b..b03c6c3 100644 --- a/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp @@ -121,7 +121,8 @@ static Error readGSIHashRecords(FixedStreamArray &HashRecords, static Error readGSIHashBuckets(FixedStreamArray &HashBuckets, - ArrayRef &HashBitmap, const GSIHashHeader *HashHdr, + FixedStreamArray &HashBitmap, + const GSIHashHeader *HashHdr, MutableArrayRef BucketMap, BinaryStreamReader &Reader) { if (auto EC = checkHashHdrVersion(HashHdr)) diff --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp index e94decc..7f309f4 100644 --- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp +++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp @@ -1708,11 +1708,6 @@ Error DumpOutputStyle::dumpSymbolsFromGSI(const GSIHashTable &Table, // Return early if we aren't dumping public hash table and address map info. if (HashExtras) { - ArrayRef BitmapBytes( - reinterpret_cast(Table.HashBitmap.data()), - Table.HashBitmap.size() * sizeof(uint32_t)); - P.formatBinary("Hash Bitmap", BitmapBytes, 0); - P.formatLine("Hash Entries"); { AutoIndent Indent2(P);