MC: Destroy Macro instances.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109720 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2010-07-29 01:51:55 +00:00
parent e6cbfa6b09
commit 56491303a6

View File

@ -279,6 +279,13 @@ AsmParser::AsmParser(const Target &T, SourceMgr &_SM, MCContext &_Ctx,
}
AsmParser::~AsmParser() {
assert(ActiveMacros.empty() && "Unexpected active macro instantiation!");
// Destroy any macros.
for (StringMap<Macro*>::iterator it = MacroMap.begin(),
ie = MacroMap.end(); it != ie; ++it)
delete it->getValue();
delete PlatformParser;
delete GenericParser;
}