summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp b/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
index e734aebf47f..e6d915fcaee 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
@@ -41,8 +41,9 @@ public:
};
}
-RawSession::RawSession(std::unique_ptr<PDBFile> PdbFile)
- : Pdb(std::move(PdbFile)) {}
+RawSession::RawSession(std::unique_ptr<PDBFile> PdbFile,
+ std::unique_ptr<BumpPtrAllocator> Allocator)
+ : Pdb(std::move(PdbFile)), Allocator(std::move(Allocator)) {}
RawSession::~RawSession() {}
@@ -58,13 +59,15 @@ Error RawSession::createFromPdb(StringRef Path,
std::unique_ptr<MemoryBuffer> Buffer = std::move(*ErrorOrBuffer);
auto Stream = llvm::make_unique<InputByteStream>(std::move(Buffer));
- std::unique_ptr<PDBFile> File(new PDBFile(std::move(Stream)));
+ auto Allocator = llvm::make_unique<BumpPtrAllocator>();
+ auto File = llvm::make_unique<PDBFile>(std::move(Stream), *Allocator);
if (auto EC = File->parseFileHeaders())
return EC;
if (auto EC = File->parseStreamData())
return EC;
- Session.reset(new RawSession(std::move(File)));
+ Session =
+ llvm::make_unique<RawSession>(std::move(File), std::move(Allocator));
return Error::success();
}
OpenPOWER on IntegriCloud