diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-10-16 06:06:51 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-10-16 06:06:51 +0000 |
| commit | af63531ac3be8d1e3ef96c879aadec182b4d6451 (patch) | |
| tree | 67ff1ea159bd12ce892896b57af79fac4f2f0cb7 /clang/Parse/ParseExpr.cpp | |
| parent | 30f910e88e5c28955bbd91b8d9a306a5d5ef2356 (diff) | |
| download | bcm5719-llvm-af63531ac3be8d1e3ef96c879aadec182b4d6451.tar.gz bcm5719-llvm-af63531ac3be8d1e3ef96c879aadec182b4d6451.zip | |
Make ConsumeToken return the loc of the consumed token to simplify clients
llvm-svn: 38994
Diffstat (limited to 'clang/Parse/ParseExpr.cpp')
| -rw-r--r-- | clang/Parse/ParseExpr.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/Parse/ParseExpr.cpp b/clang/Parse/ParseExpr.cpp index cd4e948ba57..77edcf9dc04 100644 --- a/clang/Parse/ParseExpr.cpp +++ b/clang/Parse/ParseExpr.cpp @@ -329,8 +329,7 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, unsigned MinPrec) { } // Eat the colon. - ColonLoc = Tok.getLocation(); - ConsumeToken(); + ColonLoc = ConsumeToken(); } // Parse another leaf here for the RHS of the operator. @@ -617,8 +616,8 @@ Parser::ExprResult Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { if (Tok.getKind() != tok::comma) break; - CommaLocs.push_back(Tok.getLocation()); - ConsumeToken(); // Next argument. + // Move to the next argument, remember where the comma was. + CommaLocs.push_back(ConsumeToken()); } } @@ -635,9 +634,8 @@ Parser::ExprResult Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { } case tok::arrow: // postfix-expression: p-e '->' identifier case tok::period: { // postfix-expression: p-e '.' identifier - SourceLocation OpLoc = Tok.getLocation(); tok::TokenKind OpKind = Tok.getKind(); - ConsumeToken(); // Eat the "." or "->" token. + SourceLocation OpLoc = ConsumeToken(); // Eat the "." or "->" token. if (Tok.getKind() != tok::identifier) { Diag(Tok, diag::err_expected_ident); @@ -720,11 +718,10 @@ Parser::ExprResult Parser::ParseSizeofAlignofExpression() { /// Parser::ExprResult Parser::ParseBuiltinPrimaryExpression() { ExprResult Res(false); - SourceLocation StartLoc = Tok.getLocation(); const IdentifierInfo *BuiltinII = Tok.getIdentifierInfo(); tok::TokenKind T = Tok.getKind(); - ConsumeToken(); // Eat the builtin identifier. + SourceLocation StartLoc = ConsumeToken(); // Eat the builtin identifier. // All of these start with an open paren. if (Tok.getKind() != tok::l_paren) { |

