[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-25 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore created this revision. Herald added subscribers: cfe-commits, jdoerfert, xazax.hun, mgorny. Herald added a project: clang. stephanemoore edited the summary of this revision. This check aims to address a relatively common benign error where Objective-C subclass initializers call -self

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-26 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 192312. stephanemoore added a comment. Removed usage of `auto` with a nonobvious type in isSubclassOf matcher. Added backticks around `NSObject` in docs. Synchronized check description in release notes and check documentation. Repository: rG LLVM Git

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-26 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 192315. stephanemoore marked 5 inline comments as done. stephanemoore added a comment. Fix diagnostic format string to actually use the message's method declaration. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-26 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 192316. stephanemoore marked an inline comment as done. stephanemoore added a comment. Enclose -self in backticks in release notes and check documentation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D598

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-26 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 192317. stephanemoore added a comment. Enclose -self in backticks in check documentation (overlooked in previous attempt). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59806/new/ https://reviews.llvm.or

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-26 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp:57 +/// \endcode +AST_MATCHER_P(ObjCImplementationDecl, isSubclassOf, + ast_matchers::internal::Matcher, aaron.ballman wrote: > This matcher seems l

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-26 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 192373. stephanemoore added a comment. Use double backticks rather than single backticks for symbols in documentation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59806/new/ https://reviews.llvm.org/D59

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-26 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked 2 inline comments as done. stephanemoore added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:113 + + Finds invocations of `-self` on super instances in initializers of subclasses + of `NSObject` and recommends calling a superclass ini

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-26 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked 2 inline comments as done. stephanemoore added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp:110 + "invoke a superclass initializer?") + << Message->getMethodDecl() + << FixItHint::Cr

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-26 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 192383. stephanemoore added a comment. Update tests to match updated diagnostic. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59806/new/ https://reviews.llvm.org/D59806 Files: clang-tools-extra/clang-

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-29 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. In D59806#1447929 , @jordan_rose wrote: > I don't think there's ever a reason to call `[super self]`, and doing so > through a macro could easily indicate a bug. Agreed. The only relatively common usage of -[NSObject self

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-29 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 192938. stephanemoore added a comment. Add test cases with `[super self]` expanded from macros. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59806/new/ https://reviews.llvm.org/D59806 Files: clang-too

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-03-29 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked 3 inline comments as done. stephanemoore added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp:112 + << Message->getMethodDecl() + << FixItHint::CreateReplacement(Message->getSourceRange(), +

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-04-02 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 193340. stephanemoore marked an inline comment as done. stephanemoore added a comment. Add a test case where a macro emits just `self` in the message expression. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-04-02 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp:112 + << Message->getMethodDecl() + << FixItHint::CreateReplacement(Message->getSourceRange(), + StringRef("[super init]")); --

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-04-04 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore planned changes to this revision. stephanemoore marked an inline comment as done. stephanemoore added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp:112 + << Message->getMethodDecl() + << FixItHint::CreateReplacement(Mess

[PATCH] D60263: [clang-format] Preserve include blocks in ObjC Google style

2019-04-10 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. Looks good to me. Comment at: cfe/trunk/lib/Format/Format.cpp:881 +// "Regroup" doesn't work well for ObjC yet (main header heuristic, +// relationship between ObjC standard library headers and other heades, +// #imports, etc.) ---

[PATCH] D60543: [clang] Add matcher for subclasses of Objective-C interfaces πŸ”

2019-04-10 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. stephanemoore added a reviewer: aaron.ballman. This change adds a new AST matcher to detect Objective-C classes that are subclasses of matching Objective-C interfaces. Test Notes: Ran clang

[PATCH] D60543: [clang] Add matcher for subclasses of Objective-C interfaces πŸ”

2019-04-10 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked an inline comment as done. stephanemoore added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:1479 +/// \endcode +AST_MATCHER_P(ObjCInterfaceDecl, isSubclassOfInterface, + internal::Matcher, I am still

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-04-12 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 194995. stephanemoore added a comment. Update check to avoid emitting a fix if the expression is in a macro. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59806/new/ https://reviews.llvm.org/D59806 Files

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-04-12 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 194996. stephanemoore marked 3 inline comments as done. stephanemoore added a comment. Add `CHECK-FIXES` to verify code is preserved for scenarios that should not have fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-04-12 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 194997. stephanemoore marked 4 inline comments as done. stephanemoore added a comment. Check if either the receiver or selector are in macro locations. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59806/n

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-04-12 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 194998. stephanemoore added a comment. Fix some formatting issues. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59806/new/ https://reviews.llvm.org/D59806 Files: clang-tools-extra/clang-tidy/objc/CMak

[PATCH] D60543: [clang] Add matcher for subclasses of Objective-C interfaces πŸ”

2019-04-15 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore planned changes to this revision. stephanemoore added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:1479 +/// \endcode +AST_MATCHER_P(ObjCInterfaceDecl, isSubclassOfInterface, + internal::Matcher, aaron.ball

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-04-15 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp:57 +/// \endcode +AST_MATCHER_P(ObjCImplementationDecl, isSubclassOf, + ast_matchers::internal::Matcher, stephanemoore wrote: > aaron.ballman wrote:

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-04-16 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. In D59806#1469257 , @aaron.ballman wrote: > LGTM! You can either land this now and refactor after the AST matcher lands, > or you can wait until the AST matcher lands and land this patch after -- your > call. I will plan

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers πŸ”

2019-04-17 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL358620: [clang-tidy] Add a check for [super self] in initializers πŸ” (authored by stephanemoore, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to comm

[PATCH] D61350: [clang-tidy] New check calling out uses of +new in Objective-C code

2019-05-07 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore accepted this revision. stephanemoore added a comment. Looks good to me once the comments from other reviewers have been addressed. I added a couple suggestions as well. Comment at: clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp:112 + Resu

[PATCH] D57207: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-02 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE352968: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ (authored by stephanemoore, committed by ). Herald added a project: clang. Changed prior to commit: https://reviews.ll

[PATCH] D57207: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-02 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked an inline comment as done. stephanemoore added inline comments. Comment at: test/clang-tidy/google-objc-function-naming.m:3 +#import + It turns out importing is problematic and breaks the build (though everything built successfully for m

[PATCH] D57207: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-08 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked an inline comment as done. stephanemoore added inline comments. Comment at: test/clang-tidy/google-objc-function-naming.m:3 +#import + aaron.ballman wrote: > stephanemoore wrote: > > It turns out importing is problematic and breaks the bu

[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-11 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore created this revision. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. Implicit functions are outside the control of source authors and should be exempt from style restrictions. Tested via running clang tools tests. This is an amended followup to ht

[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-11 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked an inline comment as done. stephanemoore added inline comments. Comment at: clang-tools-extra/test/clang-tidy/google-objc-function-naming.m:10 +// function would be declared in a system header. +int printf(const char *, ...); // NOLINT(google-objc-function-n

[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-12 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 186566. stephanemoore added a comment. Create a new header stdio.h under //test/clang-tidy/Inputs/Headers/ to contain declaration of `printf` and import the new header to `google-objc-function-naming.m`. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-12 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 186567. stephanemoore marked 2 inline comments as done. stephanemoore added a comment. Add a comment to the new stdio.h. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58095/new/ https://reviews.llvm.org/D

[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-12 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added inline comments. Comment at: clang-tools-extra/test/clang-tidy/google-objc-function-naming.m:10 +// function would be declared in a system header. +int printf(const char *, ...); // NOLINT(google-objc-function-naming) + aaron.ballman wrote: >

[PATCH] D57080: [clang-tidy] Delete obsolete objc-property-declaration options βœ‚οΈ

2019-02-12 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 186572. stephanemoore added a comment. Herald added a project: clang. Migrated patch to LLVM monorepo. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57080/new/ https://reviews.llvm.org/D57080 Files: cl

[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-12 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked an inline comment as done. stephanemoore added inline comments. Comment at: clang-tools-extra/test/clang-tidy/Inputs/Headers/stdio.h:1 +#ifndef _STDIO_H_ +#define _STDIO_H_ stephanemoore wrote: > I noticed that some of the other example heade

[PATCH] D57080: [clang-tidy] Delete obsolete objc-property-declaration options βœ‚οΈ

2019-02-15 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL354195: [clang-tidy] Delete obsolete objc-property-declaration options βœ‚οΈ (authored by stephanemoore, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior t

[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-19 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 187512. stephanemoore added a comment. Added licensing preamble to stdio.h Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58095/new/ https://reviews.llvm.org/D58095 Files: clang-tools-extra/clang-tidy/g

[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-19 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked 4 inline comments as done. stephanemoore added inline comments. Comment at: clang-tools-extra/test/clang-tidy/Inputs/Headers/stdio.h:1 +#ifndef _STDIO_H_ +#define _STDIO_H_ aaron.ballman wrote: > aaron.ballman wrote: > > stephanemoore wrote:

[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-20 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. stephanemoore marked an inline comment as done. Closed by commit rCTE354534: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ (authored by stephanemoore, committed by ). Changed prior to commit: h

[PATCH] D58095: [clang-tidy] Make google-objc-function-naming ignore implicit functions πŸ™ˆ

2019-02-22 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. Thanks for the review! Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58095/new/ https://reviews.llvm.org/D58095 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[PATCH] D62045: Revise the google-objc-global-variable-declaration check to match the style guide.

2019-05-29 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore accepted this revision. stephanemoore marked an inline comment as done. stephanemoore added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/test/clang-tidy/google-objc-global-variable-declaration.m:46 +// CHECK-MESSAG

[PATCH] D62045: Revise the google-objc-global-variable-declaration check to match the style guide.

2019-05-31 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL362279: Revise the google-objc-global-variable-declaration check to match the style… (authored by stephanemoore, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Chan

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-08-07 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 214035. stephanemoore marked 6 inline comments as done. stephanemoore edited the summary of this revision. stephanemoore added a comment. Update `isDerivedFrom` to match aliased types and compatibility aliases of derived Objective-C classes. Repository

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-08-07 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. I spent some time becoming familiar with how `isDerivedFrom` behaves for C++ classes. I //think// that I have managed to get the behavior for Objective-C classes to mirror that of C++ classes. Please let me know if I overlooked anything. Commen

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-08-07 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore planned changes to this revision. stephanemoore added a comment. Whoops; forgot to add test cases for `isDirectlyDerivedFrom` 🀦 Will do that shortly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60543/new/ https://reviews.llvm.org/D

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-08-07 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 214053. stephanemoore added a comment. Add tests for `isDirectlyDerivedFrom`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60543/new/ https://reviews.llvm.org/D60543 Files: clang/docs/LibASTMatchersRe

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-08-08 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 214272. stephanemoore added a comment. Use `llvm::SmallPtrSet` to store the compatible aliases instead of `std::set`. Fix a stray unit test failure in `RegistryTest.cpp`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-08-08 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked 3 inline comments as done. stephanemoore added inline comments. Comment at: clang/lib/ASTMatchers/ASTMatchFinder.cpp:820 + llvm::DenseMap> + CompatibleAliases; aaron.ballman wrote: > gribozavr wrote: > > `unordered_set`? > or `SmallPtrS

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-08-12 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. stephanemoore marked an inline comment as done. Closed by commit rL368632: [clang] Update isDerivedFrom to support Objective-C classes πŸ” (authored by stephanemoore, committed by ). Herald added a project: LLVM. Herald added

[PATCH] D66269: [clang-tidy] Migrate objc-forbidden-subclassing to use isDerivedFrom πŸš›

2019-08-14 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore created this revision. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. This migrates objc-forbidden-subclassing to `isDerivedFrom` as it now supports matching Objective-C interface declarations. Test Notes: Ran clang tools tests. Repository: rG L

[PATCH] D66270: [clang-tidy] Migrate objc-super-self to use isDerivedFrom πŸš›

2019-08-14 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore created this revision. stephanemoore added reviewers: aaron.ballman, gribozavr. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. This migrates objc-super-self to `isDerivedFrom` as it now supports matching Objective-C interface declarations. Test Note

[PATCH] D66270: [clang-tidy] Migrate objc-super-self to use isDerivedFrom πŸš›

2019-08-14 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 215311. stephanemoore added a comment. Fix example matches in comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66270/new/ https://reviews.llvm.org/D66270 Files: clang-tools-extra/clang-tidy/objc/

[PATCH] D66269: [clang-tidy] Migrate objc-forbidden-subclassing to use isDerivedFrom πŸš›

2019-08-15 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL369076: [clang-tidy] Migrate objc-forbidden-subclassing to use isDerivedFrom πŸš› (authored by stephanemoore, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed pr

[PATCH] D66270: [clang-tidy] Migrate objc-super-self to use isDerivedFrom πŸš›

2019-08-15 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL369081: [clang-tidy] Migrate objc-super-self to use isDerivedFrom πŸš› (authored by stephanemoore, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to comm

[PATCH] D61769: [clang] Regenerate AST matcher docs πŸ“–

2019-05-09 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The documentation seems to have been manually edited in https://reviews.llvm.org/rGa282bde69e375985edd4c371b79864f617380ad5. This commit regenerates the documentation and commits the resul

[PATCH] D60543: [clang] Add matcher for subclasses of Objective-C interfaces πŸ”

2019-05-09 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 198956. stephanemoore added a comment. Present one potential option for making isDerivedFrom support Objective-C classes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60543/new/ https://reviews.llvm.org

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-05-09 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. I did some digging and I believe there are two approaches that we can take to extend `isDerivedFrom` to support Objective-C classes. **Option 1: Match on Common Ancestor Declaration Type**: Convert `isDerivedFrom` to match on the common ancestor declaration type,

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-05-09 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added inline comments. Comment at: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp:566 + notMatchesObjC("@interface Y @end typedef Y X; @interface Z : X @end", + ZIsDerivedFromX)); + EXPECT_TRUE( (note that there are

[PATCH] D61769: [clang] Regenerate AST matcher docs πŸ“–

2019-05-12 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL360545: [clang] Regenerate AST matcher docs πŸ“– (authored by stephanemoore, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.

[PATCH] D61350: [clang-tidy] New check calling out uses of +new in Objective-C code

2019-05-13 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore accepted this revision. stephanemoore added a comment. I believe that all the feedback from @gribozavr has been addressed modulo one small nit. Once that nit has been addressed, I can land this. Comment at: clang-tools-extra/clang-tidy/google/AvoidNSObjectNewChec

[PATCH] D61350: [clang-tidy] New check calling out uses of +new in Objective-C code

2019-05-13 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore requested changes to this revision. stephanemoore marked an inline comment as done. stephanemoore added inline comments. This revision now requires changes to proceed. Comment at: clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp:112 + Result.No

[PATCH] D61350: [clang-tidy] New check calling out uses of +new in Objective-C code

2019-05-14 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore accepted this revision. stephanemoore marked an inline comment as done. stephanemoore added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp:54 +CheckFactories.registerCheck( +

[PATCH] D62045: Modified global variable declaration to fit updated objc guide.

2019-05-17 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore requested changes to this revision. stephanemoore marked 4 inline comments as done. stephanemoore added inline comments. Comment at: clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp:51-52 + + auto NewName = "g" + llvm::StringRef(std::string(1

[PATCH] D62045: Modified global variable declaration to fit updated objc guide.

2019-05-17 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore requested changes to this revision. stephanemoore added a comment. This revision now requires changes to proceed. Thanks for restoring the support for the legacy style! I noticed that there are some cases where we can preserve an existing fixit. Comment at: clan

[PATCH] D62045: Modified global variable declaration to fit updated objc guide.

2019-05-17 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added inline comments. Comment at: clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp:45 + + auto NewName = (IsConst? "k": "g") + llvm::StringRef(std::string(1, FC)).upper()) + + Decl->getName().substr(1).str());

[PATCH] D62045: Modified global variable declaration to fit updated objc guide.

2019-05-21 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore requested changes to this revision. stephanemoore added a comment. This revision now requires changes to proceed. Almost there. I think everything looks good after we resolve this last round of comments. Can you also update the commit description. I believe that the current changes

[PATCH] D62045: Do not emit fixes for extern global constants in google-objc-global-variable-declaration check.

2019-05-21 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore requested changes to this revision. stephanemoore added a comment. This revision now requires changes to proceed. Many thanks for being patient with me πŸ™ I think there are just two more things ✌️ ❧ Sorry, I think my earlier description was understated. Maybe this would be a bette

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-05-21 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore planned changes to this revision. stephanemoore added a comment. > Out of curiosity, how invasive is Option 2 within our own code base? I am still working on getting something working but I don't anticipate anything notably invasive. > Does that option require fixing a lot of code

[PATCH] D62045: Revise the google-objc-global-variable-declaration check to match the style guide.

2019-05-24 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore accepted this revision. stephanemoore marked 2 inline comments as done. stephanemoore added a comment. (sorry I forgot to send this earlier) Two small things and then I think everything is good. Comment at: clang-tools-extra/clang-tidy/google/GlobalVariableDecla

[PATCH] D62045: Revise the google-objc-global-variable-declaration check to match the style guide.

2019-05-24 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore accepted this revision. stephanemoore added a comment. Looks good! Thanks for being patient with me! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62045/new/ https://reviews.llvm.org/D62045 _

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-05-24 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 201384. stephanemoore added a comment. Update isDerivedFrom and related matchers to polymorphic matchers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60543/new/ https://reviews.llvm.org/D60543 Files:

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-05-24 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 201385. stephanemoore marked an inline comment as done. stephanemoore added a comment. Add missing braces to multi-line if statements. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60543/new/ https://revi

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-05-24 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore accepted this revision. stephanemoore added a comment. This revision is now accepted and ready to land. Okay I now have an implementation of Option 2 that //works//. I was hoping to find a more elegant solution but since this is the first working implementation of Option 2 I was ab

[PATCH] D62045: Revise the google-objc-global-variable-declaration check to match the style guide.

2019-05-28 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. It looks like all concerns have been addressed. Do you need me to land this commit for you? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62045/new/ https://reviews.llvm.org/D62045

[PATCH] D62045: Revise the google-objc-global-variable-declaration check to match the style guide.

2019-05-28 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE361907: Revise the google-objc-global-variable-declaration check to match the style… (authored by stephanemoore, committed by ). Changed prior to commit: https://reviews.llvm.org/D62045?vs=201352&id=2

[PATCH] D62045: Revise the google-objc-global-variable-declaration check to match the style guide.

2019-05-28 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore reopened this revision. stephanemoore added inline comments. This revision is now accepted and ready to land. Comment at: test/clang-tidy/google-objc-global-variable-declaration.m:48 static NSString* gMyIntGood = 0; +extern NSString* Y2Good; Whoo

[PATCH] D60543: [clang] Update isDerivedFrom to support Objective-C classes πŸ”

2019-05-28 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore planned changes to this revision. stephanemoore added a comment. Thanks for the input! I will get started on making changes accordingly. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2642-2649 + if (const auto *InterfaceDecl = dyn_cast(&Node)) { +

[PATCH] D55482: [clang-tidy] Improve google-objc-function-naming diagnostics πŸ“™

2018-12-11 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added inline comments. Comment at: clang-tidy/google/FunctionNamingCheck.cpp:115 diag(MatchedDecl->getLocation(), - "function name %0 not using function naming conventions described by " - "Google Objective-C style guide") - << MatchedDecl << gen

[PATCH] D55546: [clang] Add AST matcher for block expressions πŸ”

2018-12-11 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. Please let me know if I missed anything as part of this proposed change. I tried my best to determine how to make this change appropriately based on previous submissions and documentation but I recognize that I could have missed things πŸ˜… Repository: rC Clang

[PATCH] D55640: [clang-tidy] Implement a check for large Objective-C type encodings πŸ”

2018-12-12 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore created this revision. Herald added subscribers: cfe-commits, jfb, xazax.hun, mgorny. Objective-C type encodings are normally pretty small but they it is pretty easy for them to bloat to undesirable levels. Bloated Objective-C type encodings are particularly common for Objective-C me

[PATCH] D55544: Warning: objc-encodings-larger-than=

2018-12-12 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. In D55544#1326606 , @stephanemoore wrote: > FYI: > I have a clang-tidy check almost ready for review that aims to flag large > Objective-C type encodings. https://reviews.llvm.org/D55640 Repository: rC Clang CHANGES

[PATCH] D55546: [clang] Add AST matcher for block expressions πŸ”

2018-12-12 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL349004: [clang] Add AST matcher for block expressions πŸ” (authored by stephanemoore, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D55546?vs=1

[PATCH] D55640: [clang-tidy] Implement a check for large Objective-C type encodings πŸ”

2018-12-13 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 178152. stephanemoore added a comment. Update check description to match release notes. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55640/new/ https://reviews.llvm.org/D55640 Files: clang-tidy/objc/CM

[PATCH] D55482: [clang-tidy] Improve google-objc-function-naming diagnostics πŸ“™

2018-12-13 Thread Stephane Moore via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE349123: [clang-tidy] Improve google-objc-function-naming diagnostics πŸ“™ (authored by stephanemoore, committed by ). Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D55640: [clang-tidy] Implement a check for large Objective-C type encodings πŸ”

2018-12-20 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 179239. stephanemoore marked 6 inline comments as done. stephanemoore added a comment. Changes: β€’ Assert on `EncodedDecl`. β€’ Mention default value in objc-type-encoding-size check notes. Outstanding action items: β€’ Evaluate using `hasDeclContext` instea

[PATCH] D55640: [clang-tidy] Implement a check for large Objective-C type encodings πŸ”

2018-12-20 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. In D55640#1329390 , @theraven wrote: > I wonder if we want to have an option to elide ObjC type info for all non-POD > C++ types. Nothing that you do with the type encoding is likely to be > correct (for example, you can s

[PATCH] D65917: [clang-tidy] Added check for the Google style guide's category method naming rule.

2019-09-11 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore requested changes to this revision. stephanemoore marked an inline comment as done. stephanemoore added inline comments. This revision now requires changes to proceed. Comment at: clang-tools-extra/clang-tidy/google/RequireCategoryMethodPrefixesCheck.cpp:30 +Cl

[PATCH] D67578: [clang-tidy] New check to warn when writing to a dispatch_once_t variable.

2019-09-16 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/misc-dispatch-once-assignment.rst:9 +and making such direct writes may potentially violate the run-once protections +intended by the library. Eugene.Zelenko wrote: > Does l

[PATCH] D67567: [clang-tidy] New check to warn when storing dispatch_once_t in non-static, non-global storage

2019-09-16 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. In D67567#1670144 , @mwyman wrote: > In D67567#1670035 , @lebedev.ri > wrote: > > > In D67567#1670017 , @mwyman wrote: > > > > > In D67567#166

[PATCH] D65917: [clang-tidy] Added check for the Google style guide's category method naming rule.

2019-09-16 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore requested changes to this revision. stephanemoore added inline comments. This revision now requires changes to proceed. Comment at: clang-tools-extra/clang-tidy/google/RequireCategoryMethodPrefixesCheck.cpp:23 + Finder->addMatcher(objcMethodDecl(hasDeclContext( +

[PATCH] D65917: [clang-tidy] Added check for the Google style guide's category method naming rule.

2019-09-17 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/google-objc-require-category-method-prefixes.rst:41 + +.. option:: ExpectedPrefixes + aaron.ballman wrote: > stephanemoore wrote: > > This option seems to describe a list o

[PATCH] D67737: [clang-tidy] Add check for classes missing -hash ⚠️

2019-09-18 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore created this revision. Herald added subscribers: cfe-commits, xazax.hun, mgorny. Herald added a project: clang. Apple documentation states that: "If two objects are equal, they must have the same hash value. This last point is particularly important if you define isEqual: in a subcla

[PATCH] D67737: [clang-tidy] Add check for classes missing -hash ⚠️

2019-09-19 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore updated this revision to Diff 220823. stephanemoore added a comment. Restrict ojbc-missing-hash to Objective-C language variants and fix sorting of release notes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67737/new/ https://review

[PATCH] D67737: [clang-tidy] Add check for classes missing -hash ⚠️

2019-09-19 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked 4 inline comments as done. stephanemoore added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/MissingHashCheck.cpp:40 +void MissingHashCheck::registerMatchers(MatchFinder *Finder) { + Finder->addMatcher( + objcMethodDecl( ---

[PATCH] D67737: [clang-tidy] Add check for classes missing -hash ⚠️

2019-09-19 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked 3 inline comments as done. stephanemoore added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/MissingHashCheck.cpp:56 + const auto *ID = Result.Nodes.getNodeAs("impl"); + diag(ID->getLocation(), "%0 implements -isEqual: without implementing

[PATCH] D65917: [clang-tidy] Added check for the Google style guide's category method naming rule.

2019-09-20 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore requested changes to this revision. stephanemoore added inline comments. This revision now requires changes to proceed. Comment at: clang-tools-extra/clang-tidy/google/RequireCategoryMethodPrefixesCheck.cpp:23 + Finder->addMatcher(objcMethodDecl(hasDeclContext( +

[PATCH] D67737: [clang-tidy] Add check for classes missing -hash ⚠️

2019-09-20 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore marked 2 inline comments as done. stephanemoore added a comment. Thanks for the review! Comment at: clang-tools-extra/clang-tidy/objc/MissingHashCheck.cpp:56 + const auto *ID = Result.Nodes.getNodeAs("impl"); + diag(ID->getLocation(), "%0 implements -isEqual: wi

<    1   2   3   >