AsmParser: Store MacroLikeBodies on the side so they don't get leaked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187702 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2013-08-04 09:06:29 +00:00
parent 8a7f9de9d4
commit a2b0c335d8

View File

@ -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::ParseMacroLikeBody(SMLoc DirectiveLoc) {
// 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,