This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE345637: NFC: Remove the ObjC1/ObjC2 distinction from clang
(and related projects) (authored by epilk, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D53547?vs=170703&id=171778#toc
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D53547
Files:
clang-tidy/google/AvoidCStyleCastsCheck.cpp
clang-tidy/google/AvoidThrowingObjCExceptionCheck.cpp
clang-tidy/google/GlobalVariableDeclarationCheck.cpp
clang-tidy/objc/AvoidNSErrorInitCheck.cpp
clang-tidy/objc/ForbiddenSubclassingCheck.cpp
clang-tidy/objc/PropertyDeclarationCheck.cpp
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/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/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/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/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());
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/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/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/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/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/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());
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(
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits