[PATCH] D53547: NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)
Phabricator via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 30 13:33:55 PDT 2018
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(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53547.171778.patch
Type: text/x-patch
Size: 3737 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181030/74e13043/attachment.bin>
More information about the cfe-commits
mailing list