diff options
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 6315339774..a322a81aaf 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -320,7 +320,7 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) { // as an identifier in ParseObjCMessageExpressionBody. i.e., we support: // [foo meth:0 and:0]; // [foo not_eq]; - if (getLangOpts().ObjC1 && getLangOpts().CPlusPlus && + if (getLangOpts().ObjC && getLangOpts().CPlusPlus && Tok.isOneOf(tok::colon, tok::r_square) && OpToken.getIdentifierInfo() != nullptr) { PP.EnterToken(Tok); @@ -957,7 +957,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, SourceLocation ILoc = ConsumeToken(); // Support 'Class.property' and 'super.property' notation. - if (getLangOpts().ObjC1 && Tok.is(tok::period) && + if (getLangOpts().ObjC && Tok.is(tok::period) && (Actions.getTypeName(II, ILoc, getCurScope()) || // Allow the base to be 'super' if in an objc-method. (&II == Ident_super && getCurScope()->isInObjcMethodScope()))) { @@ -987,7 +987,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, // the token sequence is ill-formed. However, if there's a ':' or ']' after // that identifier, this is probably a message send with a missing open // bracket. Treat it as such. - if (getLangOpts().ObjC1 && &II == Ident_super && !InMessageExpression && + if (getLangOpts().ObjC && &II == Ident_super && !InMessageExpression && getCurScope()->isInObjcMethodScope() && ((Tok.is(tok::identifier) && (NextToken().is(tok::colon) || NextToken().is(tok::r_square))) || @@ -1002,7 +1002,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, // send that's missing the opening '['. Recovery // appropriately. Also take this path if we're performing code // completion after an Objective-C class name. - if (getLangOpts().ObjC1 && + if (getLangOpts().ObjC && ((Tok.is(tok::identifier) && !InMessageExpression) || Tok.is(tok::code_completion))) { const Token& Next = NextToken(); @@ -1429,7 +1429,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, } case tok::l_square: if (getLangOpts().CPlusPlus11) { - if (getLangOpts().ObjC1) { + if (getLangOpts().ObjC) { // C++11 lambda expressions and Objective-C message sends both start with a // square bracket. There are three possibilities here: // we have a valid lambda expression, we have an invalid lambda @@ -1443,7 +1443,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, Res = ParseLambdaExpression(); break; } - if (getLangOpts().ObjC1) { + if (getLangOpts().ObjC) { Res = ParseObjCMessageExpression(); break; } @@ -1511,7 +1511,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { // If we see identifier: after an expression, and we're not already in a // message send, then this is probably a message send with a missing // opening bracket '['. - if (getLangOpts().ObjC1 && !InMessageExpression && + if (getLangOpts().ObjC && !InMessageExpression && (NextToken().is(tok::colon) || NextToken().is(tok::r_square))) { LHS = ParseObjCMessageExpressionBody(SourceLocation(), SourceLocation(), nullptr, LHS.get()); @@ -1529,7 +1529,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { // actually another message send. In this case, do some look-ahead to see // if the contents of the square brackets are obviously not a valid // expression and recover by pretending there is no suffix. - if (getLangOpts().ObjC1 && Tok.isAtStartOfLine() && + if (getLangOpts().ObjC && Tok.isAtStartOfLine() && isSimpleObjCMessageExpression()) return LHS; @@ -1793,7 +1793,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { // FIXME: Add support for explicit call of template constructor. SourceLocation TemplateKWLoc; UnqualifiedId Name; - if (getLangOpts().ObjC2 && OpKind == tok::period && + if (getLangOpts().ObjC && OpKind == tok::period && Tok.is(tok::kw_class)) { // Objective-C++: // After a '.' in a member access expression, treat the keyword @@ -2339,7 +2339,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr, } // Diagnose use of bridge casts in non-arc mode. - bool BridgeCast = (getLangOpts().ObjC2 && + bool BridgeCast = (getLangOpts().ObjC && Tok.isOneOf(tok::kw___bridge, tok::kw___bridge_transfer, tok::kw___bridge_retained, @@ -2449,7 +2449,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr, // this is probably an Objective-C message send where the leading '[' is // missing. Recover as if that were the case. if (!DeclaratorInfo.isInvalidType() && Tok.is(tok::identifier) && - !InMessageExpression && getLangOpts().ObjC1 && + !InMessageExpression && getLangOpts().ObjC && (NextToken().is(tok::colon) || NextToken().is(tok::r_square))) { TypeResult Ty; { @@ -2535,7 +2535,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr, } // Reject the cast of super idiom in ObjC. - if (Tok.is(tok::identifier) && getLangOpts().ObjC1 && + if (Tok.is(tok::identifier) && getLangOpts().ObjC && Tok.getIdentifierInfo() == Ident_super && getCurScope()->isInObjcMethodScope() && GetLookAheadToken(1).isNot(tok::period)) { |