Home | History | Annotate | Download | only in MCParser

Lines Matching defs:Macro

47 /// \brief Helper class for tracking macro definitions.
48 struct Macro {
54 Macro(StringRef N, StringRef B, const std::vector<StringRef> &P) :
58 /// \brief Helper class for storing information about an active macro
61 /// The macro being instantiated.
62 const Macro *TheMacro;
64 /// The macro instantiation with substitutions.
74 MacroInstantiation(const Macro *M, SMLoc IL, SMLoc EL,
109 StringMap<Macro*> MacroMap;
111 /// ActiveMacros - Stack of active macro instantiations.
114 /// Boolean tracking whether macro substitution is enabled.
180 bool HandleMacroEntry(StringRef Name, SMLoc NameLoc, const Macro *M);
323 // Macro directives.
328 AddDirectiveHandler<&GenericAsmParser::ParseDirectiveMacro>(".macro");
411 assert(ActiveMacros.empty() && "Unexpected active macro instantiation!");
414 for (StringMap<Macro*>::iterator it = MacroMap.begin(),
423 // Print the active macro instantiation stack.
427 "while in macro instantiation");
1119 // If macros are enabled, check to see if this is a macro instantiation.
1121 if (const Macro *M = MacroMap.lookup(IDVal))
1411 // This macro has no parameters, look for $0, $1, etc.
1419 // This macro has parameters, look for \foo, \bar, etc.
1471 // FIXME: We should error at the macro definition.
1485 // We include the .endmacro in the buffer as our queue to exit the macro
1491 MacroInstantiation::MacroInstantiation(const Macro *M, SMLoc IL, SMLoc EL,
1498 const Macro *M) {
1499 // Arbitrarily limit macro nesting depth, to match 'as'. We can eliminate
1504 // Parse the macro instantiation arguments.
1510 return TokError("unexpected token in macro instantiation");
1536 // Macro instantiation is lexical, unfortunately. We construct a new buffer
1537 // to hold the macro body with substitutions.
1547 // Create the macro instantiation object and add to the current macro
1554 // Jump to the macro instantiation and prime the lexer.
2918 /// ::= .macro name [parameters]
2940 return TokError("unexpected token in '.macro' directive");
2947 // Lex the macro definition.
2970 return Error(DirectiveLoc, "macro '" + Name + "' is already defined");
2976 getParser().MacroMap[Name] = new Macro(Name, Body, Parameters);
2988 // If we are inside a macro instantiation, terminate the current
2996 // .endmacro directives are handled during the macro definition parsing.
2998 "no current macro definition");