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:
parent
a09a3f7ead
commit
87d6393262
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user