diff options
author | Zachary Turner <zturner@google.com> | 2018-05-17 21:49:25 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2018-05-17 21:49:25 +0000 |
commit | 1de9fce15152a410aa082f4f38d52c41f01fece1 (patch) | |
tree | a165062f389d080f03c850b2cee74742657abdd3 /llvm/lib | |
parent | 5b5350ddee0957db31812f544655f06570fa436d (diff) | |
download | bcm5719-llvm-1de9fce15152a410aa082f4f38d52c41f01fece1.tar.gz bcm5719-llvm-1de9fce15152a410aa082f4f38d52c41f01fece1.zip |
Revert "[pdb] Change /DEBUG:GHASH to emit 8 byte hashes."
A few tests haven't been properly updated, so reverting while
I have time to investigate proper fixes.
llvm-svn: 332672
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/CodeView/TypeHashing.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp | 20 |
3 files changed, 12 insertions, 21 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 2dcfbf48a32..ef279417b7e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -589,7 +589,7 @@ void CodeViewDebug::emitTypeGlobalHashes() { OS.AddComment("Section Version"); OS.EmitIntValue(0, 2); OS.AddComment("Hash Algorithm"); - OS.EmitIntValue(uint16_t(GlobalTypeHashAlg::SHA1_8), 2); + OS.EmitIntValue(uint16_t(GlobalTypeHashAlg::SHA1), 2); TypeIndex TI(TypeIndex::FirstNonSimpleIndex); for (const auto &GHR : TypeTable.hashes()) { @@ -602,7 +602,7 @@ void CodeViewDebug::emitTypeGlobalHashes() { OS.AddComment(Comment); ++TI; } - assert(GHR.Hash.size() == 8); + assert(GHR.Hash.size() % 20 == 0); StringRef S(reinterpret_cast<const char *>(GHR.Hash.data()), GHR.Hash.size()); OS.EmitBinaryData(S); diff --git a/llvm/lib/DebugInfo/CodeView/TypeHashing.cpp b/llvm/lib/DebugInfo/CodeView/TypeHashing.cpp index a51770959ac..c2f8cd5466a 100644 --- a/llvm/lib/DebugInfo/CodeView/TypeHashing.cpp +++ b/llvm/lib/DebugInfo/CodeView/TypeHashing.cpp @@ -18,9 +18,10 @@ using namespace llvm::codeview; LocallyHashedType DenseMapInfo<LocallyHashedType>::Empty{0, {}}; LocallyHashedType DenseMapInfo<LocallyHashedType>::Tombstone{hash_code(-1), {}}; -static std::array<uint8_t, 8> EmptyHash = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; -static std::array<uint8_t, 8> TombstoneHash = { - {0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; +static std::array<uint8_t, 20> EmptyHash; +static std::array<uint8_t, 20> TombstoneHash = { + {0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; GloballyHashedType DenseMapInfo<GloballyHashedType>::Empty{EmptyHash}; GloballyHashedType DenseMapInfo<GloballyHashedType>::Tombstone{TombstoneHash}; @@ -70,5 +71,5 @@ GloballyHashedType::hashType(ArrayRef<uint8_t> RecordData, auto TrailingBytes = RecordData.drop_front(Off); S.update(TrailingBytes); - return {S.final().take_back(8)}; + return {S.final()}; } diff --git a/llvm/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp b/llvm/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp index a55c3c2ce67..bbbd7c06772 100644 --- a/llvm/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp +++ b/llvm/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp @@ -13,8 +13,6 @@ //===----------------------------------------------------------------------===// #include "llvm/ObjectYAML/CodeViewYAMLTypeHashing.h" - -#include "llvm/BinaryFormat/COFF.h" #include "llvm/Support/BinaryByteStream.h" #include "llvm/Support/BinaryStreamReader.h" #include "llvm/Support/BinaryStreamWriter.h" @@ -48,20 +46,16 @@ StringRef ScalarTraits<GlobalHash>::input(StringRef Scalar, void *Ctx, DebugHSection llvm::CodeViewYAML::fromDebugH(ArrayRef<uint8_t> DebugH) { assert(DebugH.size() >= 8); - assert((DebugH.size() - 8) % 8 == 0); + assert((DebugH.size() - 8) % 20 == 0); BinaryStreamReader Reader(DebugH, llvm::support::little); DebugHSection DHS; cantFail(Reader.readInteger(DHS.Magic)); cantFail(Reader.readInteger(DHS.Version)); cantFail(Reader.readInteger(DHS.HashAlgorithm)); - assert(DHS.Magic == COFF::DEBUG_SECTION_MAGIC && "Invalid .debug$H section!"); - assert(DHS.Version == 1 && "Invalid .debug$H version!"); - assert(DHS.HashAlgorithm == 1 && "Invalid .debug$H algorithm!"); - while (Reader.bytesRemaining() != 0) { ArrayRef<uint8_t> S; - cantFail(Reader.readBytes(S, 8)); + cantFail(Reader.readBytes(S, 20)); DHS.Hashes.emplace_back(S); } assert(Reader.bytesRemaining() == 0); @@ -70,23 +64,19 @@ DebugHSection llvm::CodeViewYAML::fromDebugH(ArrayRef<uint8_t> DebugH) { ArrayRef<uint8_t> llvm::CodeViewYAML::toDebugH(const DebugHSection &DebugH, BumpPtrAllocator &Alloc) { - uint32_t Size = 8 + 8 * DebugH.Hashes.size(); + uint32_t Size = 8 + 20 * DebugH.Hashes.size(); uint8_t *Data = Alloc.Allocate<uint8_t>(Size); MutableArrayRef<uint8_t> Buffer(Data, Size); BinaryStreamWriter Writer(Buffer, llvm::support::little); - assert(DebugH.Magic == COFF::DEBUG_SECTION_MAGIC && "Invalid .debug$H section!"); - assert(DebugH.Version == 1 && "Invalid .debug$H version!"); - assert(DebugH.HashAlgorithm == 1 && "Invalid .debug$H algorithm!"); - cantFail(Writer.writeInteger(DebugH.Magic)); cantFail(Writer.writeInteger(DebugH.Version)); cantFail(Writer.writeInteger(DebugH.HashAlgorithm)); - SmallString<8> Hash; + SmallString<20> Hash; for (const auto &H : DebugH.Hashes) { Hash.clear(); raw_svector_ostream OS(Hash); H.Hash.writeAsBinary(OS); - assert((Hash.size() == 8) && "Invalid hash size!"); + assert((Hash.size() == 20) && "Invalid hash size!"); cantFail(Writer.writeFixedString(Hash)); } assert(Writer.bytesRemaining() == 0); |