summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/PDB')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/Hash.cpp5
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp5
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/TpiHashing.cpp6
3 files changed, 6 insertions, 10 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/Hash.cpp b/llvm/lib/DebugInfo/PDB/Native/Hash.cpp
index b5c139ecbec..7fb6b4bd5d3 100644
--- a/llvm/lib/DebugInfo/PDB/Native/Hash.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/Hash.cpp
@@ -8,8 +8,8 @@
#include "llvm/DebugInfo/PDB/Native/Hash.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/CRC.h"
#include "llvm/Support/Endian.h"
-#include "llvm/Support/JamCRC.h"
#include <cstdint>
using namespace llvm;
@@ -79,7 +79,6 @@ uint32_t pdb::hashStringV2(StringRef Str) {
// Corresponds to `SigForPbCb` in langapi/shared/crc32.h.
uint32_t pdb::hashBufferV8(ArrayRef<uint8_t> Buf) {
JamCRC JC(/*Init=*/0U);
- JC.update(makeArrayRef<char>(reinterpret_cast<const char *>(Buf.data()),
- Buf.size()));
+ JC.update(Buf);
return JC.getCRC();
}
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
index abeb7ae99c9..aa328872439 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
@@ -22,7 +22,7 @@
#include "llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h"
#include "llvm/Support/BinaryStream.h"
#include "llvm/Support/BinaryStreamWriter.h"
-#include "llvm/Support/JamCRC.h"
+#include "llvm/Support/CRC.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/xxhash.h"
@@ -174,8 +174,7 @@ Error PDBFileBuilder::finalizeMsfLayout() {
if (!InjectedSources.empty()) {
for (const auto &IS : InjectedSources) {
JamCRC CRC(0);
- CRC.update(makeArrayRef(IS.Content->getBufferStart(),
- IS.Content->getBufferSize()));
+ CRC.update(arrayRefFromStringRef(IS.Content->getBuffer()));
SrcHeaderBlockEntry Entry;
::memset(&Entry, 0, sizeof(SrcHeaderBlockEntry));
diff --git a/llvm/lib/DebugInfo/PDB/Native/TpiHashing.cpp b/llvm/lib/DebugInfo/PDB/Native/TpiHashing.cpp
index b21b82bf76f..b71b2b15814 100644
--- a/llvm/lib/DebugInfo/PDB/Native/TpiHashing.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/TpiHashing.cpp
@@ -10,7 +10,7 @@
#include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
#include "llvm/DebugInfo/PDB/Native/Hash.h"
-#include "llvm/Support/JamCRC.h"
+#include "llvm/Support/CRC.h"
using namespace llvm;
using namespace llvm::codeview;
@@ -124,8 +124,6 @@ Expected<uint32_t> llvm::pdb::hashTypeRecord(const CVType &Rec) {
// Run CRC32 over the bytes. This corresponds to `hashBufv8`.
JamCRC JC(/*Init=*/0U);
- ArrayRef<char> Bytes(reinterpret_cast<const char *>(Rec.data().data()),
- Rec.data().size());
- JC.update(Bytes);
+ JC.update(Rec.data());
return JC.getCRC();
}
OpenPOWER on IntegriCloud