diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-14 22:11:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-14 22:11:41 +0000 |
commit | c215bd659d8266a1d6b66ce231a63405a4c61daf (patch) | |
tree | 8691ff644071b1d3baf76493d963075719d8dab4 /Lex/MacroExpander.cpp | |
parent | b5e240fa9e852b758032b28488a083c546cf6123 (diff) |
expose an iterator interface to getReplacementTokens instead of the datastructure itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39860 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Lex/MacroExpander.cpp')
-rw-r--r-- | Lex/MacroExpander.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lex/MacroExpander.cpp b/Lex/MacroExpander.cpp index a45efbd86e..45d4611233 100644 --- a/Lex/MacroExpander.cpp +++ b/Lex/MacroExpander.cpp @@ -240,8 +240,8 @@ MacroExpander::MacroExpander(LexerToken &Tok, MacroArgs *Actuals, InstantiateLoc(Tok.getLocation()), AtStartOfLine(Tok.isAtStartOfLine()), HasLeadingSpace(Tok.hasLeadingSpace()) { - MacroTokens = &Macro->getReplacementTokens()[0]; - NumMacroTokens = Macro->getReplacementTokens().size(); + MacroTokens = &*Macro->tokens_begin(); + NumMacroTokens = Macro->tokens_end()-Macro->tokens_begin(); // If this is a function-like macro, expand the arguments and change // MacroTokens to point to the expanded tokens. @@ -275,7 +275,7 @@ MacroExpander::MacroExpander(const LexerToken *TokArray, unsigned NumToks, MacroExpander::~MacroExpander() { // If this was a function-like macro that actually uses its arguments, delete // the expanded tokens. - if (Macro && MacroTokens != &Macro->getReplacementTokens()[0]) + if (Macro && MacroTokens != &*Macro->tokens_begin()) delete [] MacroTokens; // MacroExpander owns its formal arguments. |