[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-11 Thread Michael Wyman via Phabricator via cfe-commits
mwyman marked 3 inline comments as done. mwyman added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/MethodUnavailableNotOverrideCheck.cpp:34 +// Matches Objective-C methods that are not overriding a superclass method. +AST_MATCHER(ObjCMethodDecl,

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-11 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 249709. mwyman marked 5 inline comments as done. mwyman added a comment. After some discussion, have decided to remove the fix-it entirely and update the diagnostic message; removing the method altogether may not be the correct behavior, as previously

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-10 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/MethodUnavailableNotOverrideCheck.cpp:34 +// Matches Objective-C methods that are not overriding a superclass method. +AST_MATCHER(ObjCMethodDecl, isNotOverriding) { return !Node.isOverriding(); } +

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-06 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Can objc instance methods be redeclared, the AST suggests so, if so you should probably only warm on the first occurrence but create fix its for each. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75569/new/

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/MethodUnavailableNotOverrideCheck.cpp:63 + } + return FixItHint::CreateRemoval(MD->getSourceRange()); +} I'm not an ObjC expert, so I apologize if this is a dumb question, but

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 248788. mwyman added a comment. Update documentation to include description of the FixMacroNames config option. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75569/new/ https://reviews.llvm.org/D75569 Files:

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/objc-method-unavailable-not-override.rst:20 + +Suggests a fix to remove the method declaration entirely. You should also document the user-facing option for the check.

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-05 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 248654. mwyman marked 4 inline comments as done. mwyman added a comment. Updated per review feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75569/new/ https://reviews.llvm.org/D75569 Files:

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-05 Thread Michael Wyman via Phabricator via cfe-commits
mwyman marked an inline comment as done. mwyman added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/MethodUnavailableNotOverrideCheck.cpp:80 +void MethodUnavailableNotOverrideCheck::registerMatchers(MatchFinder *Finder) { + if (!getLangOpts().ObjC) +

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-05 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/MethodUnavailableNotOverrideCheck.cpp:47-49 + auto Iter = + std::find(Macros.begin(), Macros.end(), Tok.getRawIdentifier().str()); + return Iter != Macros.end(); `return

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-05 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 248611. mwyman added a comment. Don't provide fix-it hints when the unavailable attribute is inside a macro, unless within a config-whitelisted macro. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75569/new/

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-05 Thread Michael Wyman via Phabricator via cfe-commits
mwyman marked 2 inline comments as done. mwyman added a comment. I goofed on updating with Arcanist—the changes I marked done will be incoming shortly! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75569/new/ https://reviews.llvm.org/D75569

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-05 Thread Michael Wyman via Phabricator via cfe-commits
mwyman marked 6 inline comments as done. mwyman added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/objc-method-unavailable-not-override.m:34 +// Verify check when using a macro that expands to the unavailable attribute. +- (void)methodC

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-05 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Fix the test case. Comment at: clang-tools-extra/clang-tidy/objc/MethodUnavailableNotOverrideCheck.cpp:29 +// intended to be matched here. +AST_MATCHER(ObjCMethodDecl, isUnavailableMethodNotOverriding) { + return !Node.isOverriding() &&

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-04 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 248399. mwyman added a comment. Updated documentation per review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75569/new/ https://reviews.llvm.org/D75569 Files:

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-04 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 248396. mwyman added a comment. Updated to explicitly check for __attribute__((unavailable)), to avoid flagging methods marked based on platform availability. Updated test file to validate this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D75569: [clang-tidy] New check for methods marked __attribute__((unavailable)) that do not override a method from a superclass.

2020-03-03 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:104 + + Finds methods marked unavailable that do not override any method from a + superclass. Please synchronize with first statement in documentation.