1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Fix memory leak in unit test.

The StringPool entries are destroyed with the allocator, the string pool
itself is not.

llvm-svn: 289207
This commit is contained in:
Benjamin Kramer 2016-12-09 13:12:30 +00:00
parent a09a3f7ead
commit 87d6393262
2 changed files with 3 additions and 3 deletions

View File

@ -203,7 +203,7 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) {
MC->setDwarfVersion(Version);
Asm->setDwarfVersion(Version);
StringPool = new DwarfStringPool(Allocator, *Asm, StringRef());
StringPool = llvm::make_unique<DwarfStringPool>(Allocator, *Asm, StringRef());
return Error::success();
}

View File

@ -170,9 +170,9 @@ class Generator {
MCStreamer *MS; // Owned by AsmPrinter
std::unique_ptr<TargetMachine> TM;
std::unique_ptr<AsmPrinter> Asm;
DwarfStringPool *StringPool; // Owned by Allocator
std::vector<std::unique_ptr<CompileUnit>> CompileUnits;
BumpPtrAllocator Allocator;
std::unique_ptr<DwarfStringPool> StringPool; // Entries owned by Allocator.
std::vector<std::unique_ptr<CompileUnit>> CompileUnits;
DIEAbbrevSet Abbreviations;
SmallString<4096> FileBytes;