mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-25 00:29:20 +00:00
COFFObjectWriter: Don't leak COFFSymbols and COFFSections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109745 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
82bd5eaa71
commit
808ecfce6a
@ -131,6 +131,7 @@ public:
|
||||
symbol_map SymbolMap;
|
||||
|
||||
WinCOFFObjectWriter(raw_ostream &OS);
|
||||
~WinCOFFObjectWriter();
|
||||
|
||||
COFFSymbol *createSymbol(llvm::StringRef Name);
|
||||
COFFSection *createSection(llvm::StringRef Name);
|
||||
@ -275,6 +276,13 @@ WinCOFFObjectWriter::WinCOFFObjectWriter(raw_ostream &OS)
|
||||
Header.Machine = 0x14C; // x86
|
||||
}
|
||||
|
||||
WinCOFFObjectWriter::~WinCOFFObjectWriter() {
|
||||
for (symbols::iterator I = Symbols.begin(), E = Symbols.end(); I != E; ++I)
|
||||
delete *I;
|
||||
for (sections::iterator I = Sections.begin(), E = Sections.end(); I != E; ++I)
|
||||
delete *I;
|
||||
}
|
||||
|
||||
COFFSymbol *WinCOFFObjectWriter::createSymbol(llvm::StringRef Name) {
|
||||
return createCOFFEntity<COFFSymbol>(Name, Symbols);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user