diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2018-10-30 20:31:30 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2018-10-30 20:31:30 +0000 |
commit | fa98390b3c3144c7cd446621526ca04c075435d8 (patch) | |
tree | f9c611a2729575b3822b5c0721b4a56f673c4ec2 /clang/lib/Parse/ParseDecl.cpp | |
parent | fe09a20f09a290274ea81d1703d4106e06a11f94 (diff) | |
download | llvm-fa98390b3c3144c7cd446621526ca04c075435d8.zip llvm-fa98390b3c3144c7cd446621526ca04c075435d8.tar.gz llvm-fa98390b3c3144c7cd446621526ca04c075435d8.tar.bz2 |
NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)
We haven't supported compiling ObjC1 for a long time (and never will again), so
there isn't any reason to keep these separate. This patch replaces
LangOpts::ObjC1 and LangOpts::ObjC2 with LangOpts::ObjC.
Differential revision: https://reviews.llvm.org/D53547
llvm-svn: 345637
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 643ddfa..af7bbfc9 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -754,7 +754,7 @@ void Parser::ParseNullabilityTypeSpecifiers(ParsedAttributes &attrs) { case tok::kw__Null_unspecified: { IdentifierInfo *AttrName = Tok.getIdentifierInfo(); SourceLocation AttrNameLoc = ConsumeToken(); - if (!getLangOpts().ObjC1) + if (!getLangOpts().ObjC) Diag(AttrNameLoc, diag::ext_nullability) << AttrName; attrs.addNew(AttrName, AttrNameLoc, nullptr, AttrNameLoc, nullptr, 0, @@ -3290,7 +3290,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, // Objective-C supports type arguments and protocol references // following an Objective-C object or object pointer // type. Handle either one of them. - if (Tok.is(tok::less) && getLangOpts().ObjC1) { + if (Tok.is(tok::less) && getLangOpts().ObjC) { SourceLocation NewEndLoc; TypeResult NewTypeRep = parseObjCTypeArgsAndProtocolQualifiers( Loc, TypeRep, /*consumeLastToken=*/true, @@ -3812,7 +3812,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, // GCC ObjC supports types like "<SomeProtocol>" as a synonym for // "id<SomeProtocol>". This is hopelessly old fashioned and dangerous, // but we support it. - if (DS.hasTypeSpecifier() || !getLangOpts().ObjC1) + if (DS.hasTypeSpecifier() || !getLangOpts().ObjC) goto DoneWithDeclSpec; SourceLocation StartLoc = Tok.getLocation(); @@ -4273,7 +4273,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS, SourceRange Range; BaseType = ParseTypeName(&Range); - if (!getLangOpts().ObjC2) { + if (!getLangOpts().ObjC) { if (getLangOpts().CPlusPlus11) Diag(StartLoc, diag::warn_cxx98_compat_enum_fixed_underlying_type); else if (getLangOpts().CPlusPlus) @@ -4740,7 +4740,7 @@ bool Parser::isTypeSpecifierQualifier() { // GNU ObjC bizarre protocol extension: <proto1,proto2> with implicit 'id'. case tok::less: - return getLangOpts().ObjC1; + return getLangOpts().ObjC; case tok::kw___cdecl: case tok::kw___stdcall: @@ -4791,7 +4791,7 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) { case tok::identifier: // foo::bar // Unfortunate hack to support "Class.factoryMethod" notation. - if (getLangOpts().ObjC1 && NextToken().is(tok::period)) + if (getLangOpts().ObjC && NextToken().is(tok::period)) return false; if (TryAltiVecVectorToken()) return true; @@ -4921,7 +4921,7 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) { // GNU ObjC bizarre protocol extension: <proto1,proto2> with implicit 'id'. case tok::less: - return getLangOpts().ObjC1; + return getLangOpts().ObjC; // typedef-name case tok::annot_typename: @@ -5762,7 +5762,7 @@ void Parser::ParseDirectDeclarator(Declarator &D) { if (D.getContext() == DeclaratorContext::MemberContext) { // Objective-C++: Detect C++ keywords and try to prevent further errors by // treating these keyword as valid member names. - if (getLangOpts().ObjC1 && getLangOpts().CPlusPlus && + if (getLangOpts().ObjC && getLangOpts().CPlusPlus && Tok.getIdentifierInfo() && Tok.getIdentifierInfo()->isCPlusPlusKeyword(getLangOpts())) { Diag(getMissingDeclaratorIdLoc(D, Tok.getLocation()), |