Index: clang-tidy/google/AvoidCStyleCastsCheck.cpp =================================================================== --- clang-tidy/google/AvoidCStyleCastsCheck.cpp +++ clang-tidy/google/AvoidCStyleCastsCheck.cpp @@ -101,7 +101,7 @@ // The rest of this check is only relevant to C++. // We also disable it for Objective-C++. - if (!getLangOpts().CPlusPlus || getLangOpts().ObjC1 || getLangOpts().ObjC2) + if (!getLangOpts().CPlusPlus || getLangOpts().ObjC) return; // Ignore code inside extern "C" {} blocks. if (!match(expr(hasAncestor(linkageSpecDecl())), *CastExpr, *Result.Context) Index: clang-tidy/google/AvoidThrowingObjCExceptionCheck.cpp =================================================================== --- clang-tidy/google/AvoidThrowingObjCExceptionCheck.cpp +++ clang-tidy/google/AvoidThrowingObjCExceptionCheck.cpp @@ -20,9 +20,8 @@ void AvoidThrowingObjCExceptionCheck::registerMatchers(MatchFinder *Finder) { // this check should only be applied to ObjC sources. - if (!getLangOpts().ObjC1 && !getLangOpts().ObjC2) { + if (!getLangOpts().ObjC) return; - } Finder->addMatcher(objcThrowStmt().bind("throwStmt"), this); Finder->addMatcher( Index: clang-tidy/google/GlobalVariableDeclarationCheck.cpp =================================================================== --- clang-tidy/google/GlobalVariableDeclarationCheck.cpp +++ clang-tidy/google/GlobalVariableDeclarationCheck.cpp @@ -55,9 +55,9 @@ void GlobalVariableDeclarationCheck::registerMatchers(MatchFinder *Finder) { // The relevant Style Guide rule only applies to Objective-C. - if (!getLangOpts().ObjC1 && !getLangOpts().ObjC2) { + if (!getLangOpts().ObjC) return; - } + // need to add two matchers since we need to bind different ids to distinguish // constants and variables. Since bind() can only be called on node matchers, // we cannot make it in one matcher. Index: clang-tidy/objc/AvoidNSErrorInitCheck.cpp =================================================================== --- clang-tidy/objc/AvoidNSErrorInitCheck.cpp +++ clang-tidy/objc/AvoidNSErrorInitCheck.cpp @@ -19,9 +19,9 @@ void AvoidNSErrorInitCheck::registerMatchers(MatchFinder *Finder) { // this check should only be applied to ObjC sources. - if (!getLangOpts().ObjC1 && !getLangOpts().ObjC2) { + if (!getLangOpts().ObjC) return; - } + Finder->addMatcher(objcMessageExpr(hasSelector("init"), hasReceiverType(asString("NSError *"))) .bind("nserrorInit"), Index: clang-tidy/objc/ForbiddenSubclassingCheck.cpp =================================================================== --- clang-tidy/objc/ForbiddenSubclassingCheck.cpp +++ clang-tidy/objc/ForbiddenSubclassingCheck.cpp @@ -78,9 +78,9 @@ void ForbiddenSubclassingCheck::registerMatchers(MatchFinder *Finder) { // this check should only be applied to ObjC sources. - if (!getLangOpts().ObjC1 && !getLangOpts().ObjC2) { + if (!getLangOpts().ObjC) return; - } + Finder->addMatcher( objcInterfaceDecl( isSubclassOf( Index: clang-tidy/objc/PropertyDeclarationCheck.cpp =================================================================== --- clang-tidy/objc/PropertyDeclarationCheck.cpp +++ clang-tidy/objc/PropertyDeclarationCheck.cpp @@ -201,9 +201,9 @@ void PropertyDeclarationCheck::registerMatchers(MatchFinder *Finder) { // this check should only be applied to ObjC sources. - if (!getLangOpts().ObjC1 && !getLangOpts().ObjC2) { + if (!getLangOpts().ObjC) return; - } + if (IncludeDefaultAcronyms) { EscapedAcronyms.reserve(llvm::array_lengthof(DefaultSpecialAcronyms) + SpecialAcronyms.size());