summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-05-17 21:49:25 +0000
committerZachary Turner <zturner@google.com>2018-05-17 21:49:25 +0000
commit1de9fce15152a410aa082f4f38d52c41f01fece1 (patch)
treea165062f389d080f03c850b2cee74742657abdd3 /llvm/lib/ObjectYAML
parent5b5350ddee0957db31812f544655f06570fa436d (diff)
downloadbcm5719-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/ObjectYAML')
-rw-r--r--llvm/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp20
1 files changed, 5 insertions, 15 deletions
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);
OpenPOWER on IntegriCloud