[llvm] r187702 - AsmParser: Store MacroLikeBodies on the side so they don't get leaked.
Benjamin Kramer
benny.kra at googlemail.com
Sun Aug 4 02:06:29 PDT 2013
Author: d0k
Date: Sun Aug 4 04:06:29 2013
New Revision: 187702
URL: http://llvm.org/viewvc/llvm-project?rev=187702&view=rev
Log:
AsmParser: Store MacroLikeBodies on the side so they don't get leaked.
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=187702&r1=187701&r2=187702&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Sun Aug 4 04:06:29 2013
@@ -149,6 +149,9 @@ private:
/// ActiveMacros - Stack of active macro instantiations.
std::vector<MacroInstantiation*> ActiveMacros;
+ /// MacroLikeBodies - List of bodies of anonymous macros.
+ std::deque<MCAsmMacro> MacroLikeBodies;
+
/// Boolean tracking whether macro substitution is enabled.
unsigned MacrosEnabledFlag : 1;
@@ -3858,7 +3861,8 @@ MCAsmMacro *AsmParser::ParseMacroLikeBod
// We Are Anonymous.
StringRef Name;
MCAsmMacroParameters Parameters;
- return new MCAsmMacro(Name, Body, Parameters);
+ MacroLikeBodies.push_back(MCAsmMacro(Name, Body, Parameters));
+ return &MacroLikeBodies.back();
}
void AsmParser::InstantiateMacroLikeBody(MCAsmMacro *M, SMLoc DirectiveLoc,
More information about the llvm-commits
mailing list