[llvm-commits] [llvm] r109720 - /llvm/trunk/lib/MC/MCParser/AsmParser.cpp
Daniel Dunbar
daniel at zuster.org
Wed Jul 28 18:51:55 PDT 2010
Author: ddunbar
Date: Wed Jul 28 20:51:55 2010
New Revision: 109720
URL: http://llvm.org/viewvc/llvm-project?rev=109720&view=rev
Log:
MC: Destroy Macro instances.
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=109720&r1=109719&r2=109720&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Wed Jul 28 20:51:55 2010
@@ -279,6 +279,13 @@
}
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;
}
More information about the llvm-commits
mailing list