aboutsummaryrefslogtreecommitdiff
path: root/lib/DebugInfo/PDB/Native
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DebugInfo/PDB/Native')
-rw-r--r--lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp4
-rw-r--r--lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp2
-rw-r--r--lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp4
-rw-r--r--lib/DebugInfo/PDB/Native/Hash.cpp5
-rw-r--r--lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp29
-rw-r--r--lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp24
-rw-r--r--lib/DebugInfo/PDB/Native/NativeSession.cpp10
-rw-r--r--lib/DebugInfo/PDB/Native/NativeTypeEnum.cpp4
-rw-r--r--lib/DebugInfo/PDB/Native/NativeTypeFunctionSig.cpp6
-rw-r--r--lib/DebugInfo/PDB/Native/PDBFile.cpp18
-rw-r--r--lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp17
-rw-r--r--lib/DebugInfo/PDB/Native/TpiHashing.cpp6
-rw-r--r--lib/DebugInfo/PDB/Native/TpiStream.cpp2
-rw-r--r--lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp2
14 files changed, 65 insertions, 68 deletions
diff --git a/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp b/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp
index 20b6c6142547..419734771ccd 100644
--- a/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp
+++ b/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp
@@ -180,12 +180,12 @@ Error DbiModuleDescriptorBuilder::commit(BinaryStreamWriter &ModiWriter,
void DbiModuleDescriptorBuilder::addDebugSubsection(
std::shared_ptr<DebugSubsection> Subsection) {
assert(Subsection);
- C13Builders.push_back(llvm::make_unique<DebugSubsectionRecordBuilder>(
+ C13Builders.push_back(std::make_unique<DebugSubsectionRecordBuilder>(
std::move(Subsection), CodeViewContainer::Pdb));
}
void DbiModuleDescriptorBuilder::addDebugSubsection(
const DebugSubsectionRecord &SubsectionContents) {
- C13Builders.push_back(llvm::make_unique<DebugSubsectionRecordBuilder>(
+ C13Builders.push_back(std::make_unique<DebugSubsectionRecordBuilder>(
SubsectionContents, CodeViewContainer::Pdb));
}
diff --git a/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp b/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
index b7ade0072ee5..0e00c2f7ff98 100644
--- a/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
+++ b/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
@@ -114,7 +114,7 @@ Expected<DbiModuleDescriptorBuilder &>
DbiStreamBuilder::addModuleInfo(StringRef ModuleName) {
uint32_t Index = ModiList.size();
ModiList.push_back(
- llvm::make_unique<DbiModuleDescriptorBuilder>(ModuleName, Index, Msf));
+ std::make_unique<DbiModuleDescriptorBuilder>(ModuleName, Index, Msf));
return *ModiList.back();
}
diff --git a/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp b/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
index 8ed5b8b44c59..432f1e9b24d3 100644
--- a/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
+++ b/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
@@ -183,8 +183,8 @@ void GSIHashStreamBuilder::finalizeBuckets(uint32_t RecordZeroOffset) {
}
GSIStreamBuilder::GSIStreamBuilder(msf::MSFBuilder &Msf)
- : Msf(Msf), PSH(llvm::make_unique<GSIHashStreamBuilder>()),
- GSH(llvm::make_unique<GSIHashStreamBuilder>()) {}
+ : Msf(Msf), PSH(std::make_unique<GSIHashStreamBuilder>()),
+ GSH(std::make_unique<GSIHashStreamBuilder>()) {}
GSIStreamBuilder::~GSIStreamBuilder() {}
diff --git a/lib/DebugInfo/PDB/Native/Hash.cpp b/lib/DebugInfo/PDB/Native/Hash.cpp
index b5c139ecbec0..7fb6b4bd5d31 100644
--- a/lib/DebugInfo/PDB/Native/Hash.cpp
+++ b/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/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp b/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp
index f17ff5bb01f2..2f6a5bc3d574 100644
--- a/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp
+++ b/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp
@@ -46,30 +46,31 @@ public:
uint64_t getCodeByteSize() const override { return Entry.FileSize; }
std::string getFileName() const override {
- auto Name = Strings.getStringForID(Entry.FileNI);
- assert(Name && "InjectedSourceStream should have rejected this");
- return *Name;
+ StringRef Ret = cantFail(Strings.getStringForID(Entry.FileNI),
+ "InjectedSourceStream should have rejected this");
+ return Ret;
}
std::string getObjectFileName() const override {
- auto ObjName = Strings.getStringForID(Entry.ObjNI);
- assert(ObjName && "InjectedSourceStream should have rejected this");
- return *ObjName;
+ StringRef Ret = cantFail(Strings.getStringForID(Entry.ObjNI),
+ "InjectedSourceStream should have rejected this");
+ return Ret;
}
std::string getVirtualFileName() const override {
- auto VName = Strings.getStringForID(Entry.VFileNI);
- assert(VName && "InjectedSourceStream should have rejected this");
- return *VName;
+ StringRef Ret = cantFail(Strings.getStringForID(Entry.VFileNI),
+ "InjectedSourceStream should have rejected this");
+ return Ret;
}
uint32_t getCompression() const override { return Entry.Compression; }
std::string getCode() const override {
// Get name of stream storing the data.
- auto VName = Strings.getStringForID(Entry.VFileNI);
- assert(VName && "InjectedSourceStream should have rejected this");
- std::string StreamName = ("/src/files/" + *VName).str();
+ StringRef VName =
+ cantFail(Strings.getStringForID(Entry.VFileNI),
+ "InjectedSourceStream should have rejected this");
+ std::string StreamName = ("/src/files/" + VName).str();
// Find stream with that name and read its data.
// FIXME: Consider validating (or even loading) all this in
@@ -104,14 +105,14 @@ std::unique_ptr<IPDBInjectedSource>
NativeEnumInjectedSources::getChildAtIndex(uint32_t N) const {
if (N >= getChildCount())
return nullptr;
- return make_unique<NativeInjectedSource>(std::next(Stream.begin(), N)->second,
+ return std::make_unique<NativeInjectedSource>(std::next(Stream.begin(), N)->second,
File, Strings);
}
std::unique_ptr<IPDBInjectedSource> NativeEnumInjectedSources::getNext() {
if (Cur == Stream.end())
return nullptr;
- return make_unique<NativeInjectedSource>((Cur++)->second, File, Strings);
+ return std::make_unique<NativeInjectedSource>((Cur++)->second, File, Strings);
}
void NativeEnumInjectedSources::reset() { Cur = Stream.begin(); }
diff --git a/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp b/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp
index 8e43cf24495a..2ad552470b61 100644
--- a/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp
+++ b/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp
@@ -30,68 +30,68 @@ void NativeRawSymbol::dump(raw_ostream &OS, int Indent,
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildren(PDB_SymType Type) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildren(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildrenByAddr(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags, uint32_t Section, uint32_t Offset) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildrenByVA(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags, uint64_t VA) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags, uint32_t RVA) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findInlineFramesByAddr(uint32_t Section,
uint32_t Offset) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findInlineFramesByRVA(uint32_t RVA) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findInlineFramesByVA(uint64_t VA) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumLineNumbers>
NativeRawSymbol::findInlineeLines() const {
- return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
+ return std::make_unique<NullEnumerator<IPDBLineNumber>>();
}
std::unique_ptr<IPDBEnumLineNumbers>
NativeRawSymbol::findInlineeLinesByAddr(uint32_t Section, uint32_t Offset,
uint32_t Length) const {
- return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
+ return std::make_unique<NullEnumerator<IPDBLineNumber>>();
}
std::unique_ptr<IPDBEnumLineNumbers>
NativeRawSymbol::findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const {
- return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
+ return std::make_unique<NullEnumerator<IPDBLineNumber>>();
}
std::unique_ptr<IPDBEnumLineNumbers>
NativeRawSymbol::findInlineeLinesByVA(uint64_t VA, uint32_t Length) const {
- return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
+ return std::make_unique<NullEnumerator<IPDBLineNumber>>();
}
void NativeRawSymbol::getDataBytes(SmallVector<uint8_t, 32> &bytes) const {
diff --git a/lib/DebugInfo/PDB/Native/NativeSession.cpp b/lib/DebugInfo/PDB/Native/NativeSession.cpp
index 8a49cb1c5963..b45a5881dcb5 100644
--- a/lib/DebugInfo/PDB/Native/NativeSession.cpp
+++ b/lib/DebugInfo/PDB/Native/NativeSession.cpp
@@ -59,18 +59,18 @@ NativeSession::~NativeSession() = default;
Error NativeSession::createFromPdb(std::unique_ptr<MemoryBuffer> Buffer,
std::unique_ptr<IPDBSession> &Session) {
StringRef Path = Buffer->getBufferIdentifier();
- auto Stream = llvm::make_unique<MemoryBufferByteStream>(
+ auto Stream = std::make_unique<MemoryBufferByteStream>(
std::move(Buffer), llvm::support::little);
- auto Allocator = llvm::make_unique<BumpPtrAllocator>();
- auto File = llvm::make_unique<PDBFile>(Path, std::move(Stream), *Allocator);
+ auto Allocator = std::make_unique<BumpPtrAllocator>();
+ auto File = std::make_unique<PDBFile>(Path, std::move(Stream), *Allocator);
if (auto EC = File->parseFileHeaders())
return EC;
if (auto EC = File->parseStreamData())
return EC;
Session =
- llvm::make_unique<NativeSession>(std::move(File), std::move(Allocator));
+ std::make_unique<NativeSession>(std::move(File), std::move(Allocator));
return Error::success();
}
@@ -202,7 +202,7 @@ NativeSession::getInjectedSources() const {
consumeError(Strings.takeError());
return nullptr;
}
- return make_unique<NativeEnumInjectedSources>(*Pdb, *ISS, *Strings);
+ return std::make_unique<NativeEnumInjectedSources>(*Pdb, *ISS, *Strings);
}
std::unique_ptr<IPDBEnumSectionContribs>
diff --git a/lib/DebugInfo/PDB/Native/NativeTypeEnum.cpp b/lib/DebugInfo/PDB/Native/NativeTypeEnum.cpp
index 9f5e86281a23..26ccb7daece0 100644
--- a/lib/DebugInfo/PDB/Native/NativeTypeEnum.cpp
+++ b/lib/DebugInfo/PDB/Native/NativeTypeEnum.cpp
@@ -163,14 +163,14 @@ void NativeTypeEnum::dump(raw_ostream &OS, int Indent,
std::unique_ptr<IPDBEnumSymbols>
NativeTypeEnum::findChildren(PDB_SymType Type) const {
if (Type != PDB_SymType::Data)
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
const NativeTypeEnum *ClassParent = nullptr;
if (!Modifiers)
ClassParent = this;
else
ClassParent = UnmodifiedType;
- return llvm::make_unique<NativeEnumEnumEnumerators>(Session, *ClassParent);
+ return std::make_unique<NativeEnumEnumEnumerators>(Session, *ClassParent);
}
PDB_SymType NativeTypeEnum::getSymTag() const { return PDB_SymType::Enum; }
diff --git a/lib/DebugInfo/PDB/Native/NativeTypeFunctionSig.cpp b/lib/DebugInfo/PDB/Native/NativeTypeFunctionSig.cpp
index 405303469c18..f98a4c3043eb 100644
--- a/lib/DebugInfo/PDB/Native/NativeTypeFunctionSig.cpp
+++ b/lib/DebugInfo/PDB/Native/NativeTypeFunctionSig.cpp
@@ -65,7 +65,7 @@ private:
std::unique_ptr<PDBSymbol> wrap(std::unique_ptr<PDBSymbol> S) const {
if (!S)
return nullptr;
- auto NTFA = llvm::make_unique<NativeTypeFunctionArg>(Session, std::move(S));
+ auto NTFA = std::make_unique<NativeTypeFunctionArg>(Session, std::move(S));
return PDBSymbol::create(Session, std::move(NTFA));
}
NativeSession &Session;
@@ -133,9 +133,9 @@ void NativeTypeFunctionSig::dump(raw_ostream &OS, int Indent,
std::unique_ptr<IPDBEnumSymbols>
NativeTypeFunctionSig::findChildren(PDB_SymType Type) const {
if (Type != PDB_SymType::FunctionArg)
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
- auto NET = llvm::make_unique<NativeEnumTypes>(Session,
+ auto NET = std::make_unique<NativeEnumTypes>(Session,
/* copy */ ArgList.ArgIndices);
return std::unique_ptr<IPDBEnumSymbols>(
new NativeEnumFunctionArgs(Session, std::move(NET)));
diff --git a/lib/DebugInfo/PDB/Native/PDBFile.cpp b/lib/DebugInfo/PDB/Native/PDBFile.cpp
index 983031dfcb78..9ac226b89139 100644
--- a/lib/DebugInfo/PDB/Native/PDBFile.cpp
+++ b/lib/DebugInfo/PDB/Native/PDBFile.cpp
@@ -264,7 +264,7 @@ Expected<GlobalsStream &> PDBFile::getPDBGlobalsStream() {
safelyCreateIndexedStream(DbiS->getGlobalSymbolStreamIndex());
if (!GlobalS)
return GlobalS.takeError();
- auto TempGlobals = llvm::make_unique<GlobalsStream>(std::move(*GlobalS));
+ auto TempGlobals = std::make_unique<GlobalsStream>(std::move(*GlobalS));
if (auto EC = TempGlobals->reload())
return std::move(EC);
Globals = std::move(TempGlobals);
@@ -277,7 +277,7 @@ Expected<InfoStream &> PDBFile::getPDBInfoStream() {
auto InfoS = safelyCreateIndexedStream(StreamPDB);
if (!InfoS)
return InfoS.takeError();
- auto TempInfo = llvm::make_unique<InfoStream>(std::move(*InfoS));
+ auto TempInfo = std::make_unique<InfoStream>(std::move(*InfoS));
if (auto EC = TempInfo->reload())
return std::move(EC);
Info = std::move(TempInfo);
@@ -290,7 +290,7 @@ Expected<DbiStream &> PDBFile::getPDBDbiStream() {
auto DbiS = safelyCreateIndexedStream(StreamDBI);
if (!DbiS)
return DbiS.takeError();
- auto TempDbi = llvm::make_unique<DbiStream>(std::move(*DbiS));
+ auto TempDbi = std::make_unique<DbiStream>(std::move(*DbiS));
if (auto EC = TempDbi->reload(this))
return std::move(EC);
Dbi = std::move(TempDbi);
@@ -303,7 +303,7 @@ Expected<TpiStream &> PDBFile::getPDBTpiStream() {
auto TpiS = safelyCreateIndexedStream(StreamTPI);
if (!TpiS)
return TpiS.takeError();
- auto TempTpi = llvm::make_unique<TpiStream>(*this, std::move(*TpiS));
+ auto TempTpi = std::make_unique<TpiStream>(*this, std::move(*TpiS));
if (auto EC = TempTpi->reload())
return std::move(EC);
Tpi = std::move(TempTpi);
@@ -319,7 +319,7 @@ Expected<TpiStream &> PDBFile::getPDBIpiStream() {
auto IpiS = safelyCreateIndexedStream(StreamIPI);
if (!IpiS)
return IpiS.takeError();
- auto TempIpi = llvm::make_unique<TpiStream>(*this, std::move(*IpiS));
+ auto TempIpi = std::make_unique<TpiStream>(*this, std::move(*IpiS));
if (auto EC = TempIpi->reload())
return std::move(EC);
Ipi = std::move(TempIpi);
@@ -337,7 +337,7 @@ Expected<PublicsStream &> PDBFile::getPDBPublicsStream() {
safelyCreateIndexedStream(DbiS->getPublicSymbolStreamIndex());
if (!PublicS)
return PublicS.takeError();
- auto TempPublics = llvm::make_unique<PublicsStream>(std::move(*PublicS));
+ auto TempPublics = std::make_unique<PublicsStream>(std::move(*PublicS));
if (auto EC = TempPublics->reload())
return std::move(EC);
Publics = std::move(TempPublics);
@@ -356,7 +356,7 @@ Expected<SymbolStream &> PDBFile::getPDBSymbolStream() {
if (!SymbolS)
return SymbolS.takeError();
- auto TempSymbols = llvm::make_unique<SymbolStream>(std::move(*SymbolS));
+ auto TempSymbols = std::make_unique<SymbolStream>(std::move(*SymbolS));
if (auto EC = TempSymbols->reload())
return std::move(EC);
Symbols = std::move(TempSymbols);
@@ -370,7 +370,7 @@ Expected<PDBStringTable &> PDBFile::getStringTable() {
if (!NS)
return NS.takeError();
- auto N = llvm::make_unique<PDBStringTable>();
+ auto N = std::make_unique<PDBStringTable>();
BinaryStreamReader Reader(**NS);
if (auto EC = N->reload(Reader))
return std::move(EC);
@@ -391,7 +391,7 @@ Expected<InjectedSourceStream &> PDBFile::getInjectedSourceStream() {
if (!Strings)
return Strings.takeError();
- auto IJ = llvm::make_unique<InjectedSourceStream>(std::move(*IJS));
+ auto IJ = std::make_unique<InjectedSourceStream>(std::move(*IJS));
if (auto EC = IJ->reload(*Strings))
return std::move(EC);
InjectedSources = std::move(IJ);
diff --git a/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
index 8f5a048ea4b5..aa3288724390 100644
--- a/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
+++ b/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"
@@ -42,7 +42,7 @@ Error PDBFileBuilder::initialize(uint32_t BlockSize) {
auto ExpectedMsf = MSFBuilder::create(Allocator, BlockSize);
if (!ExpectedMsf)
return ExpectedMsf.takeError();
- Msf = llvm::make_unique<MSFBuilder>(std::move(*ExpectedMsf));
+ Msf = std::make_unique<MSFBuilder>(std::move(*ExpectedMsf));
return Error::success();
}
@@ -50,25 +50,25 @@ MSFBuilder &PDBFileBuilder::getMsfBuilder() { return *Msf; }
InfoStreamBuilder &PDBFileBuilder::getInfoBuilder() {
if (!Info)
- Info = llvm::make_unique<InfoStreamBuilder>(*Msf, NamedStreams);
+ Info = std::make_unique<InfoStreamBuilder>(*Msf, NamedStreams);
return *Info;
}
DbiStreamBuilder &PDBFileBuilder::getDbiBuilder() {
if (!Dbi)
- Dbi = llvm::make_unique<DbiStreamBuilder>(*Msf);
+ Dbi = std::make_unique<DbiStreamBuilder>(*Msf);
return *Dbi;
}
TpiStreamBuilder &PDBFileBuilder::getTpiBuilder() {
if (!Tpi)
- Tpi = llvm::make_unique<TpiStreamBuilder>(*Msf, StreamTPI);
+ Tpi = std::make_unique<TpiStreamBuilder>(*Msf, StreamTPI);
return *Tpi;
}
TpiStreamBuilder &PDBFileBuilder::getIpiBuilder() {
if (!Ipi)
- Ipi = llvm::make_unique<TpiStreamBuilder>(*Msf, StreamIPI);
+ Ipi = std::make_unique<TpiStreamBuilder>(*Msf, StreamIPI);
return *Ipi;
}
@@ -78,7 +78,7 @@ PDBStringTableBuilder &PDBFileBuilder::getStringTableBuilder() {
GSIStreamBuilder &PDBFileBuilder::getGsiBuilder() {
if (!Gsi)
- Gsi = llvm::make_unique<GSIStreamBuilder>(*Msf);
+ Gsi = std::make_unique<GSIStreamBuilder>(*Msf);
return *Gsi;
}
@@ -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/lib/DebugInfo/PDB/Native/TpiHashing.cpp b/lib/DebugInfo/PDB/Native/TpiHashing.cpp
index b21b82bf76fd..b71b2b158144 100644
--- a/lib/DebugInfo/PDB/Native/TpiHashing.cpp
+++ b/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();
}
diff --git a/lib/DebugInfo/PDB/Native/TpiStream.cpp b/lib/DebugInfo/PDB/Native/TpiStream.cpp
index 8ee7f897b8bb..ac19db03fab2 100644
--- a/lib/DebugInfo/PDB/Native/TpiStream.cpp
+++ b/lib/DebugInfo/PDB/Native/TpiStream.cpp
@@ -112,7 +112,7 @@ Error TpiStream::reload() {
HashStream = std::move(*HS);
}
- Types = llvm::make_unique<LazyRandomTypeCollection>(
+ Types = std::make_unique<LazyRandomTypeCollection>(
TypeRecords, getNumTypeRecords(), getTypeIndexOffsets());
return Error::success();
}
diff --git a/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp b/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
index 6b308453c2de..4f10f8524a9b 100644
--- a/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
+++ b/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
@@ -135,7 +135,7 @@ Error TpiStreamBuilder::finalizeMsfLayout() {
reinterpret_cast<const uint8_t *>(HashBuffer.data()),
calculateHashBufferSize());
HashValueStream =
- llvm::make_unique<BinaryByteStream>(Bytes, llvm::support::little);
+ std::make_unique<BinaryByteStream>(Bytes, llvm::support::little);
}
return Error::success();
}