diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2013-11-18 08:17:37 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2013-11-18 08:17:37 +0000 |
commit | 8fe2475a4b4c00475709c13d43eb9a57cce87cbc (patch) | |
tree | ee31d7240f621a1deca475ea9b1944743af78f8a /lib/Parse/ParseObjc.cpp | |
parent | c315f01a133d6af3e01f253dd4f03e7bec9848db (diff) | |
download | clang-8fe2475a4b4c00475709c13d43eb9a57cce87cbc.tar.gz clang-8fe2475a4b4c00475709c13d43eb9a57cce87cbc.tar.bz2 clang-8fe2475a4b4c00475709c13d43eb9a57cce87cbc.tar.xz |
Replaced bool parameters in SkipUntil function with single bit-based parameter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194994 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 1dc71f1f82..86f38cfee3 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -403,7 +403,7 @@ void Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey, // method definitions. if (ExpectAndConsumeSemi(diag::err_expected_semi_after_method_proto)) { // We didn't find a semi and we error'ed out. Skip until a ';' or '@'. - SkipUntil(tok::at, /*StopAtSemi=*/true, /*DontConsume=*/true); + SkipUntil(tok::at, StopAtSemi | StopBeforeMatch); if (Tok.is(tok::semi)) ConsumeToken(); } @@ -476,7 +476,7 @@ void Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey, // or something like that. Diag(AtLoc, diag::err_objc_illegal_interface_qual); // Skip until we see an '@' or '}' or ';'. - SkipUntil(tok::r_brace, tok::at); + SkipUntil(tok::r_brace, tok::at, StopAtSemi); break; case tok::objc_implementation: @@ -628,7 +628,7 @@ void Parser::ParseObjCPropertyAttribute(ObjCDeclSpec &DS) { if (!SelIdent) { Diag(Tok, diag::err_objc_expected_selector_for_getter_setter) << IsSetter; - SkipUntil(tok::r_paren); + SkipUntil(tok::r_paren, StopAtSemi); return; } @@ -646,7 +646,7 @@ void Parser::ParseObjCPropertyAttribute(ObjCDeclSpec &DS) { } } else { Diag(AttrName, diag::err_objc_expected_property_attr) << II; - SkipUntil(tok::r_paren); + SkipUntil(tok::r_paren, StopAtSemi); return; } @@ -943,7 +943,7 @@ ParsedType Parser::ParseObjCTypeName(ObjCDeclSpec &DS, else if (Tok.getLocation() == TypeStartLoc) { // If we didn't eat any tokens, then this isn't a type. Diag(Tok, diag::err_expected_type); - SkipUntil(tok::r_paren); + SkipUntil(tok::r_paren, StopAtSemi); } else { // Otherwise, we found *something*, but didn't get a ')' in the right // place. Emit an error then return what we have as the type. @@ -1020,7 +1020,7 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc, Diag(Tok, diag::err_expected_selector_for_method) << SourceRange(mLoc, Tok.getLocation()); // Skip until we get a ; or @. - SkipUntil(tok::at, true /*StopAtSemi*/, true /*don't consume*/); + SkipUntil(tok::at, StopAtSemi | StopBeforeMatch); return 0; } @@ -1199,7 +1199,7 @@ ParseObjCProtocolReferences(SmallVectorImpl<Decl *> &Protocols, if (Tok.isNot(tok::identifier)) { Diag(Tok, diag::err_expected_ident); - SkipUntil(tok::greater); + SkipUntil(tok::greater, StopAtSemi); return true; } ProtocolIdents.push_back(std::make_pair(Tok.getIdentifierInfo(), @@ -1372,7 +1372,7 @@ void Parser::ParseObjCClassInstanceVariables(Decl *interfaceDecl, } else { Diag(Tok, diag::err_expected_semi_decl_list); // Skip to end of block or statement - SkipUntil(tok::r_brace, true, true); + SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); } } HelperActionsForIvarDeclarations(interfaceDecl, atLoc, @@ -1534,7 +1534,7 @@ Parser::ParseObjCAtImplementationDeclaration(SourceLocation AtLoc) { } if (Tok.isNot(tok::r_paren)) { Diag(Tok, diag::err_expected_rparen); - SkipUntil(tok::r_paren, false); // don't stop at ';' + SkipUntil(tok::r_paren); // don't stop at ';' return DeclGroupPtrTy(); } rparenLoc = ConsumeParen(); @@ -1809,7 +1809,7 @@ Parser::ParseObjCSynchronizedStmt(SourceLocation atLoc) { Diag(Tok, diag::err_expected_rparen); // Skip forward until we see a left brace, but don't consume it. - SkipUntil(tok::l_brace, true, true); + SkipUntil(tok::l_brace, StopAtSemi | StopBeforeMatch); } // Require a compound statement. @@ -1899,7 +1899,7 @@ StmtResult Parser::ParseObjCTryStmt(SourceLocation atLoc) { if (Tok.is(tok::r_paren)) RParenLoc = ConsumeParen(); else // Skip over garbage, until we get to ')'. Eat the ')'. - SkipUntil(tok::r_paren, true, false); + SkipUntil(tok::r_paren, StopAtSemi); StmtResult CatchBody(true); if (Tok.is(tok::l_brace)) @@ -2032,7 +2032,7 @@ Decl *Parser::ParseObjCMethodDefinition() { Diag(Tok, diag::err_expected_method_body); // Skip over garbage, until we get to '{'. Don't eat the '{'. - SkipUntil(tok::l_brace, true, true); + SkipUntil(tok::l_brace, StopAtSemi | StopBeforeMatch); // If we didn't find the '{', bail out. if (Tok.isNot(tok::l_brace)) @@ -2041,7 +2041,7 @@ Decl *Parser::ParseObjCMethodDefinition() { if (!MDecl) { ConsumeBrace(); - SkipUntil(tok::r_brace, /*StopAtSemi=*/false); + SkipUntil(tok::r_brace); return 0; } @@ -2351,7 +2351,7 @@ ExprResult Parser::ParseObjCMessageExpression() { bool IsExpr; void *TypeOrExpr = NULL; if (ParseObjCXXMessageReceiver(IsExpr, TypeOrExpr)) { - SkipUntil(tok::r_square); + SkipUntil(tok::r_square, StopAtSemi); return ExprError(); } @@ -2379,7 +2379,7 @@ ExprResult Parser::ParseObjCMessageExpression() { case Sema::ObjCClassMessage: if (!ReceiverType) { - SkipUntil(tok::r_square); + SkipUntil(tok::r_square, StopAtSemi); return ExprError(); } @@ -2397,7 +2397,7 @@ ExprResult Parser::ParseObjCMessageExpression() { // Otherwise, an arbitrary expression can be the receiver of a send. ExprResult Res(ParseExpression()); if (Res.isInvalid()) { - SkipUntil(tok::r_square); + SkipUntil(tok::r_square, StopAtSemi); return Res; } @@ -2483,7 +2483,7 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc, // We must manually skip to a ']', otherwise the expression skipper will // stop at the ']' when it skips to the ';'. We want it to skip beyond // the enclosing expression. - SkipUntil(tok::r_square); + SkipUntil(tok::r_square, StopAtSemi); return ExprError(); } @@ -2520,7 +2520,7 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc, // We must manually skip to a ']', otherwise the expression skipper will // stop at the ']' when it skips to the ';'. We want it to skip beyond // the enclosing expression. - SkipUntil(tok::r_square); + SkipUntil(tok::r_square, StopAtSemi); return Res; } @@ -2564,7 +2564,7 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc, // We must manually skip to a ']', otherwise the expression skipper will // stop at the ']' when it skips to the ';'. We want it to skip beyond // the enclosing expression. - SkipUntil(tok::r_square); + SkipUntil(tok::r_square, StopAtSemi); return Res; } @@ -2577,7 +2577,7 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc, // We must manually skip to a ']', otherwise the expression skipper will // stop at the ']' when it skips to the ';'. We want it to skip beyond // the enclosing expression. - SkipUntil(tok::r_square); + SkipUntil(tok::r_square, StopAtSemi); return ExprError(); } @@ -2589,7 +2589,7 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc, // We must manually skip to a ']', otherwise the expression skipper will // stop at the ']' when it skips to the ';'. We want it to skip beyond // the enclosing expression. - SkipUntil(tok::r_square); + SkipUntil(tok::r_square, StopAtSemi); return ExprError(); } @@ -2715,7 +2715,7 @@ ExprResult Parser::ParseObjCArrayLiteral(SourceLocation AtLoc) { // We must manually skip to a ']', otherwise the expression skipper will // stop at the ']' when it skips to the ';'. We want it to skip beyond // the enclosing expression. - SkipUntil(tok::r_square); + SkipUntil(tok::r_square, StopAtSemi); return Res; } @@ -2750,7 +2750,7 @@ ExprResult Parser::ParseObjCDictionaryLiteral(SourceLocation AtLoc) { // We must manually skip to a '}', otherwise the expression skipper will // stop at the '}' when it skips to the ';'. We want it to skip beyond // the enclosing expression. - SkipUntil(tok::r_brace); + SkipUntil(tok::r_brace, StopAtSemi); return KeyExpr; } } @@ -2759,7 +2759,7 @@ ExprResult Parser::ParseObjCDictionaryLiteral(SourceLocation AtLoc) { ConsumeToken(); } else { Diag(Tok, diag::err_expected_colon); - SkipUntil(tok::r_brace); + SkipUntil(tok::r_brace, StopAtSemi); return ExprError(); } @@ -2768,7 +2768,7 @@ ExprResult Parser::ParseObjCDictionaryLiteral(SourceLocation AtLoc) { // We must manually skip to a '}', otherwise the expression skipper will // stop at the '}' when it skips to the ';'. We want it to skip beyond // the enclosing expression. - SkipUntil(tok::r_brace); + SkipUntil(tok::r_brace, StopAtSemi); return ValueExpr; } |