diff options
Diffstat (limited to 'lib/Parse')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 1 | ||||
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 3 | ||||
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 3 | ||||
-rw-r--r-- | lib/Parse/ParseExprCXX.cpp | 2 | ||||
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 10 | ||||
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 5 | ||||
-rw-r--r-- | lib/Parse/ParseTemplate.cpp | 4 | ||||
-rw-r--r-- | lib/Parse/ParseTentative.cpp | 3 |
8 files changed, 11 insertions, 20 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 8e334c3069..355ba022f6 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1724,7 +1724,6 @@ ParseStructDeclaration(DeclSpec &DS, FieldCallback &Fields) { } // Parse the common specifier-qualifiers-list piece. - SourceLocation DSStart = Tok.getLocation(); ParseSpecifierQualifierList(DS); // If there are no declarators, this is a free-standing declaration diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index fcd629fe70..20e2b8b0be 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -1443,7 +1443,6 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS, return; } - SourceLocation DSStart = Tok.getLocation(); // decl-specifier-seq: // Parse the common declaration-specifiers piece. ParsingDeclSpec DS(*this, TemplateDiags); @@ -1931,7 +1930,7 @@ bool Parser::ParseExceptionSpecification(SourceLocation &EndLoc, bool &hasAnyExceptionSpec) { assert(Tok.is(tok::kw_throw) && "expected throw"); - SourceLocation ThrowLoc = ConsumeToken(); + ConsumeToken(); if (!Tok.is(tok::l_paren)) { return Diag(Tok, diag::err_expected_lparen_after) << "throw"; diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 7133b61022..f48b7a5faa 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -566,7 +566,6 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, ParenParseOption ParenExprType = (isUnaryExpression && !getLang().CPlusPlus)? CompoundLiteral : CastExpr; ParsedType CastTy; - SourceLocation LParenLoc = Tok.getLocation(); SourceLocation RParenLoc; { @@ -641,7 +640,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, (Actions.getTypeName(II, ILoc, getCurScope()) || // Allow the base to be 'super' if in an objc-method. (&II == Ident_super && getCurScope()->isInObjcMethodScope()))) { - SourceLocation DotLoc = ConsumeToken(); + ConsumeToken(); if (Tok.isNot(tok::identifier)) { Diag(Tok, diag::err_expected_property_name); diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index aa638bb077..8b12650a47 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -824,7 +824,7 @@ bool Parser::ParseCXXCondition(ExprResult &ExprOut, // '=' assignment-expression if (isTokenEqualOrMistypedEqualEqual( diag::err_invalid_equalequal_after_declarator)) { - SourceLocation EqualLoc = ConsumeToken(); + ConsumeToken(); ExprResult AssignExpr(ParseAssignmentExpression()); if (!AssignExpr.isInvalid()) Actions.AddInitializerToDecl(DeclOut, AssignExpr.take()); diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 2d293c5aeb..af53d7d592 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -150,7 +150,9 @@ Decl *Parser::ParseObjCAtInterfaceDeclaration(SourceLocation atLoc, SourceLocation nameLoc = ConsumeToken(); if (Tok.is(tok::l_paren) && !isKnownToBeTypeSpecifier(GetLookAheadToken(1))) { // we have a category. - SourceLocation lparenLoc = ConsumeParen(); + // TODO(dgregor): Use the return value from the next line to provide better + // recovery. + ConsumeParen(); SourceLocation categoryLoc, rparenLoc; IdentifierInfo *categoryId = 0; if (Tok.is(tok::code_completion)) { @@ -1298,7 +1300,7 @@ Decl *Parser::ParseObjCAtImplementationDeclaration( if (Tok.is(tok::l_paren)) { // we have a category implementation. - SourceLocation lparenLoc = ConsumeParen(); + ConsumeParen(); SourceLocation categoryLoc, rparenLoc; IdentifierInfo *categoryId = 0; @@ -1418,7 +1420,7 @@ Decl *Parser::ParseObjCAtAliasDeclaration(SourceLocation atLoc) { Decl *Parser::ParseObjCPropertySynthesize(SourceLocation atLoc) { assert(Tok.isObjCAtKeyword(tok::objc_synthesize) && "ParseObjCPropertyDynamic(): Expected '@synthesize'"); - SourceLocation loc = ConsumeToken(); // consume synthesize + ConsumeToken(); // consume synthesize while (true) { if (Tok.is(tok::code_completion)) { @@ -1473,7 +1475,7 @@ Decl *Parser::ParseObjCPropertySynthesize(SourceLocation atLoc) { Decl *Parser::ParseObjCPropertyDynamic(SourceLocation atLoc) { assert(Tok.isObjCAtKeyword(tok::objc_dynamic) && "ParseObjCPropertyDynamic(): Expected '@dynamic'"); - SourceLocation loc = ConsumeToken(); // consume dynamic + ConsumeToken(); // consume dynamic while (true) { if (Tok.is(tok::code_completion)) { Actions.CodeCompleteObjCPropertyDefinition(getCurScope(), ObjCImpDecl); diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 113b2661b0..3a6f80da2d 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -545,12 +545,9 @@ bool Parser::ParseParenExprOrCondition(ExprResult &ExprResult, Decl *&DeclResult, SourceLocation Loc, bool ConvertToBoolean) { - bool ParseError = false; - SourceLocation LParenLoc = ConsumeParen(); if (getLang().CPlusPlus) - ParseError = ParseCXXCondition(ExprResult, DeclResult, Loc, - ConvertToBoolean); + ParseCXXCondition(ExprResult, DeclResult, Loc, ConvertToBoolean); else { ExprResult = ParseExpression(); DeclResult = 0; diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index 93f5c9ba43..05cdd5c87f 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -531,7 +531,7 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) { << PP.getSpelling(Tok); return 0; } - SourceLocation ClassLoc = ConsumeToken(); + ConsumeToken(); // Parse the ellipsis, if given. SourceLocation EllipsisLoc; @@ -595,8 +595,6 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) { /// parameter-declaration Decl * Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position) { - SourceLocation StartLoc = Tok.getLocation(); - // Parse the declaration-specifiers (i.e., the type). // FIXME: The type should probably be restricted in some way... Not all // declarators (parts of declarators?) are accepted for parameters. diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp index c6e6784f6c..bec201ce23 100644 --- a/lib/Parse/ParseTentative.cpp +++ b/lib/Parse/ParseTentative.cpp @@ -111,10 +111,7 @@ bool Parser::isCXXSimpleDeclaration() { // We need tentative parsing... TentativeParsingAction PA(*this); - TPR = TryParseSimpleDeclaration(); - SourceLocation TentativeParseLoc = Tok.getLocation(); - PA.Revert(); // In case of an error, let the declaration parsing code handle it. |