[PATCH] D128031: Don't emit `-Wnullability-completeness` warnings on `weak` Objective-C properties.

2022-10-20 Thread Michael Wyman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG34020d39b8a1: Don't emit `-Wnullability-completeness` warnings on `weak` Objective-C… (authored by mwyman). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128

[PATCH] D128031: Don't emit `-Wnullability-completeness` warnings on `weak` Objective-C properties.

2022-10-19 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 469020. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128031/new/ https://reviews.llvm.org/D128031 Files: clang/lib/Sema/SemaType.cpp clang/test/SemaObjCXX/Inputs/nullability-consistency-2.h Index: clang/test/SemaObjCXX/Inputs/nullability-consis

[PATCH] D135091: Fix assert in generated `direct` property getter/setters due to removal of `_cmd` parameter.

2022-10-11 Thread Michael Wyman via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1fbb6d8b34de: Fix assert in generated `direct` property getter/setters due to removal of… (authored by mwyman). Repository: rG LLVM Github Monorep

[PATCH] D135091: Fix assert in generated `direct` property getter/setters due to removal of `_cmd` parameter.

2022-10-10 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 466602. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135091/new/ https://reviews.llvm.org/D135091 Files: clang/lib/CodeGen/CGObjC.cpp clang/test/CodeGenObjC/direct-method.m Index: clang/test/CodeGenObjC/direct-method.m =

[PATCH] D135091: Create storage for the `_cmd` argument to the helper function for generated getters/setters of `direct` Objective-C properties.

2022-10-07 Thread Michael Wyman via Phabricator via cfe-commits
mwyman marked 2 inline comments as done. mwyman added inline comments. Comment at: clang/lib/CodeGen/CGObjC.cpp:1125 +llvm::Type *selType = CGF.ConvertType(CGF.getContext().getObjCSelType()); +return llvm::UndefValue::get(selType); + } nlopes wrote: > mw

[PATCH] D135091: Create storage for the `_cmd` argument to the helper function for generated getters/setters of `direct` Objective-C properties.

2022-10-07 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 466212. mwyman edited the summary of this revision. mwyman added a comment. Updated to use `PoisonValue` rather than `UndefValue`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135091/new/ https://reviews.llvm.org/D135091 Files: clang/lib/CodeGen/

[PATCH] D135091: Create storage for the `_cmd` argument to the helper function for generated getters/setters of `direct` Objective-C properties.

2022-10-07 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added inline comments. Comment at: clang/lib/CodeGen/CGObjC.cpp:1125 +llvm::Type *selType = CGF.ConvertType(CGF.getContext().getObjCSelType()); +return llvm::UndefValue::get(selType); + } nlopes wrote: > Please consider using PoisonValue here inst

[PATCH] D135091: Create storage for the `_cmd` argument to the helper function for generated getters/setters of `direct` Objective-C properties.

2022-10-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman marked 2 inline comments as done. mwyman added inline comments. Comment at: clang/lib/CodeGen/CGObjC.cpp:1116 +// for the `_cmd` argument that no longer exists for direct methods. +static llvm::Value *emitCmdLoadForGetterSetterBody(CodeGenFunction &CGF, +

[PATCH] D135091: Create storage for the `_cmd` argument to the helper function for generated getters/setters of `direct` Objective-C properties.

2022-10-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 465925. mwyman added a comment. Herald added a subscriber: nlopes. Use explicit `undef` for the `cmd` parameter to `objc_getProperty`/`objc_setProperty` rather declaring and not initializing storage for the implicit `_cmd`. CHANGES SINCE LAST ACTION https

[PATCH] D135091: Create storage for the `_cmd` argument to the helper function for generated getters/setters of `direct` Objective-C properties.

2022-10-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 465896. mwyman marked an inline comment as done. mwyman added a comment. Extracted the common new code into a helper function. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135091/new/ https://reviews.llvm.org/D135091 Files: clang/lib/CodeGen/CGOb

[PATCH] D135091: Create storage for the `_cmd` argument to the helper function for generated getters/setters of `direct` Objective-C properties.

2022-10-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman marked an inline comment as done. mwyman added inline comments. Comment at: clang/test/CodeGenObjC/direct-method.m:171-177 +// Check the synthesized objectProperty calls objc_getProperty(); this also +// checks that the synthesized method accesses _cmd (or rather loads the

[PATCH] D135091: Create storage for the `_cmd` argument to the helper function for generated getters/setters of `direct` Objective-C properties.

2022-10-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 465857. mwyman retitled this revision from "Load the `_cmd` selector for generated getters/setters of `direct` Objective-C properties." to "Create storage for the `_cmd` argument to the helper function for generated getters/setters of `direct` Objective-C pro

[PATCH] D131424: Remove the unused/undefined _cmd parameter to objc_direct methods.

2022-10-03 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. In D131424#3828656 , @mwyman wrote: > In D131424#3828647 , @ahatanak > wrote: > >> `-fobjc-arc` is needed to see the assertion fail. > > Oops, yep I'll send a patch. Sent https://reviews.

[PATCH] D135091: Load the `_cmd` selector for generated getters/setters of `direct` Objective-C properties.

2022-10-03 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. mwyman added reviewers: ahatanak, plotfi, dmaclach. mwyman added a project: clang. Herald added a project: All. mwyman requested review of this revision. Herald added a subscriber: cfe-commits. This fixes a bug from https://reviews.llvm.org/D131424 that removed the i

[PATCH] D131424: Remove the unused/undefined _cmd parameter to objc_direct methods.

2022-09-30 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. In D131424#3828647 , @ahatanak wrote: > `-fobjc-arc` is needed to see the assertion fail. Oops, yep I'll send a patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131424/new/ htt

[PATCH] D86049: RFC: Implement optional exportable wrapper function generation for objc_direct methods.

2022-09-27 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. In D86049#3818981 , @plotfi wrote: > @ahatanak I can revive some of what I was working on from > https://reviews.llvm.org/D86049?id=285923 if we think we need a thunk for the > checks as @rjmccall mentioned. I believe the generat

[PATCH] D86049: RFC: Implement optional exportable wrapper function generation for objc_direct methods.

2022-09-27 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. I think it's reasonable to do `@property` behavior in a follow-up. Are we thinking to allow `__attribute__((visibility("default")))` on an `@property` declaration, to keep the visibility behavior consistent? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D86049: RFC: Implement optional exportable wrapper function generation for objc_direct methods.

2022-09-27 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. In D86049#3816006 , @plotfi wrote: > @dmaclach @ahatanak @mwyman How do things look from here? Do you want > something for properties as well or would it be ok if we did this in a later > commit? Huh, for some reason I thought wh

[PATCH] D131424: Remove the unused/undefined _cmd parameter to objc_direct methods.

2022-09-21 Thread Michael Wyman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGaa4bcaab9600: Remove the unused/undefined `_cmd` parameter in `objc_direct` methods. (authored by mwyman). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1314

[PATCH] D131424: Remove the unused/undefined _cmd parameter to objc_direct methods.

2022-09-20 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a reviewer: ahatanak. mwyman added a comment. Hi Akira, I'd reached out to John offline and he'd mentioned you might be able to help on some of these objc_direct reviews; if so, that would be wonderful! -Michael CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131424/new/ h

[PATCH] D86049: RFC: Implement optional exportable wrapper function generation for objc_direct methods.

2022-09-12 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added inline comments. Comment at: clang/include/clang/Basic/Attr.td:2251-2256 +def ObjCDirectVisible : Attr { + let Spellings = [Clang<"objc_direct_visible">]; + let Subjects = SubjectList<[ObjCMethod], ErrorDiag>; + let LangOpts = [ObjC]; + let Documentation = [ObjCD

[PATCH] D131424: Remove the unused/undefined _cmd parameter to objc_direct methods.

2022-09-07 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. This is related to changes for https://reviews.llvm.org/D86049. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131424/new/ https://reviews.llvm.org/D131424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[PATCH] D86049: RFC: Implement optional exportable wrapper function generation for objc_direct methods.

2022-08-09 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added inline comments. Comment at: clang/include/clang/Basic/Attr.td:2251-2256 +def ObjCDirectVisible : Attr { + let Spellings = [Clang<"objc_direct_visible">]; + let Subjects = SubjectList<[ObjCMethod], ErrorDiag>; + let LangOpts = [ObjC]; + let Documentation = [ObjCD

[PATCH] D131424: Remove the unused/undefined _cmd parameter to objc_direct methods.

2022-08-08 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 451051. mwyman added a comment. Fixed assert due to mis-matched number of expected parameters. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131424/new/ https://reviews.llvm.org/D131424 Files: clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGObj

[PATCH] D131424: Remove the unused/undefined _cmd parameter to objc_direct methods.

2022-08-08 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. mwyman added reviewers: dmaclach, plotfi. mwyman added a project: clang. Herald added a project: All. mwyman requested review of this revision. Herald added a subscriber: cfe-commits. When `objc_direct` methods were implemented, the implicit `_cmd` parameter was left

[PATCH] D86049: RFC: Implement optional exportable wrapper function generation for objc_direct methods.

2022-07-19 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. Hi, I work with @dmaclach. I know this has been sitting around without much activity for two years, but we believe there is a solid use-case for this on our end and I'd like to help get the ABI nailed down and land this change (or one accomplishing the same goal). Do you

[PATCH] D128556: Make Objective-C++ match Objective-C's behavior on implicit ivar access when `self` is shadowed

2022-06-29 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 441270. mwyman added a comment. Change to use a unit test on the semantic lookup code, rather than a codegen test; I realized the name lookup behavior could be more directly checked by inspecting the internal references in the generated AST to ensure the foun

[PATCH] D128031: Don't emit `-Wnullability-completeness` warnings on `weak` Objective-C properties.

2022-06-27 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a reviewer: doug.gregor. mwyman added a comment. Adding Doug Gregor who appears to have created the original warning. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128031/new/ https://reviews.llvm.org/D128031 ___ cfe-commits mail

[PATCH] D128031: Don't emit `-Wnullability-completeness` warnings on `weak` Objective-C properties.

2022-06-27 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 440390. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128031/new/ https://reviews.llvm.org/D128031 Files: clang/lib/Sema/SemaType.cpp clang/test/SemaObjCXX/Inputs/nullability-consistency-2.h Index: clang/test/SemaObjCXX/Inputs/nullability-consis

[PATCH] D128556: Make Objective-C++ match Objective-C's behavior on implicit ivar access when `self` is shadowed

2022-06-27 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. Unit test passes both pre- and post- this change for `-x objective-c`, fails pre-change with `-x objective-c++` and passes post-change. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128556/new/ https://reviews.llvm.org/D128556 __

[PATCH] D128556: Make Objective-C++ match Objective-C's behavior on implicit ivar access when `self` is shadowed

2022-06-27 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 440311. mwyman added a comment. Added codegen test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128556/new/ https://reviews.llvm.org/D128556 Files: clang/lib/Sema/SemaLookup.cpp clang/test/CodeGenObjC/ivar-implicit-self-shadow.m Index: clang

[PATCH] D128556: Make Objective-C++ match Objective-C's behavior on implicit ivar access when `self` is shadowed

2022-06-24 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. mwyman added a project: clang. Herald added a project: All. mwyman requested review of this revision. Herald added a subscriber: cfe-commits. When compiling Objective-C++, name lookup uses the C++ lookup behavior that skips the filtering of non-implicit-self referenc

[PATCH] D128031: Don't emit `-Wnullability-completeness` warnings on `weak` Objective-C properties.

2022-06-17 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. Created Github issue to track: https://github.com/llvm/llvm-project/issues/56096 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128031/new/ https://reviews.llvm.org/D128031 ___ cfe

[PATCH] D128031: Don't emit `-Wnullability-completeness` warnings on `weak` Objective-C properties.

2022-06-16 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. mwyman added reviewers: dmaclach, stephanemoore. mwyman added a project: clang. Herald added a project: All. mwyman requested review of this revision. Herald added a subscriber: cfe-commits. Zeroing weak references are by definition `nullable`, and adding `nonnull` or

[PATCH] D126522: Create specialization of `-Wgnu-statement-expression` for expressions found in macros.

2022-05-31 Thread Michael Wyman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7689c7fc9e08: Create specialization of -Wgnu-statement-expression for expressions found in… (authored by mwyman). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D126522: Create specialization of `-Wgnu-statement-expression` for expressions found in macros.

2022-05-26 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 432471. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126522/new/ https://reviews.llvm.org/D126522 Files: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Basic/DiagnosticParseKinds.td clang/lib/Parse/ParseExpr.cpp clang/test/

[PATCH] D126522: Create specialization of `-Wgnu-statement-expression` for expressions found in macros.

2022-05-26 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. mwyman added reviewers: stephanemoore, hokein, ymandel, dmaclach. mwyman added a project: clang. Herald added a project: All. mwyman requested review of this revision. Herald added a subscriber: cfe-commits. `-Wgnu-statement-expression` currently warns for both direct

[PATCH] D120372: [clang] 'unused-but-set-variable' warning should not apply to __attribute__((objc_precise_lifetime) Objective-C pointers

2022-02-24 Thread Michael Wyman via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb682616d1fd1: Clang `unused-but-set-variable` warnings should not apply to `__attribute__… (authored by mwyman). Repository: rG LLVM Github Monore

[PATCH] D120372: [clang] 'unused-but-set-variable' warning should not apply to __attribute__((objc_precise_lifetime) Objective-C pointers

2022-02-23 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 410863. mwyman added a comment. Added new inner scope for test file. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120372/new/ https://reviews.llvm.org/D120372 Files: clang/lib/Sema/SemaDecl.cpp clang/test/SemaObjC/objc-precise-lifetime-unused-v

[PATCH] D120372: [clang] 'unused-but-set-variable' warning should not apply to __attribute__((objc_precise_lifetime) Objective-C pointers

2022-02-22 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added inline comments. Comment at: clang/test/SemaObjC/objc-precise-lifetime-unused-variable.m:7 + // no diagnostics for objects with precise lifetime semantics. + __attribute__((objc_precise_lifetime)) id x; + x = getFoo(); dmaclach wrote: > what happe

[PATCH] D120372: [clang] 'unused-but-set-variable' warning should not apply to __attribute__((objc_precise_lifetime) Objective-C pointers

2022-02-22 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. mwyman added reviewers: stephanemoore, dmaclach. mwyman added a project: clang. mwyman requested review of this revision. Herald added a subscriber: cfe-commits. The `objc_precise_lifetime` attribute is applied to Objective-C pointers to ensure the optimizer does not

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-10 Thread Michael Wyman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG89f1321fe4ef: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that… (authored by mwyman). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-10 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 256521. mwyman added a comment. Added struct member reference from local variable, per review comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77571/new/ https://reviews.llvm.org/D77571 Files: clang-too

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-09 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 256344. mwyman added a comment. Add check for isScalarType before getting the type, which seems to be triggering an assert. Maybe this is a Mac vs Linux thing? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77571

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-09 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 256332. mwyman marked 2 inline comments as done. mwyman added a comment. Adding non-object types for argument to getArgument:atIndex: to verify they don't cause problems. Done while investigating Harbormaster failures. Repository: rG LLVM Github Monorepo

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-09 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 256209. mwyman marked an inline comment as done. mwyman added a comment. Updating per Stephane's comments. To deal with struct fields needed to match MemberRefExprs. However, in doing so I discovered that the match conditions I thought were catching ObjcIvar

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-09 Thread Michael Wyman via Phabricator via cfe-commits
mwyman marked 4 inline comments as done. mwyman added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.cpp:49 + QT->getScalarTypeKind() == Type::STK_BlockPointer) && + QT.getQualifiers().getObjCLifetime() > Qualifi

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-09 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 256210. mwyman added a comment. Add matching MemberRefExpr case, not just the non-matching case there was before. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77571/new/ https://reviews.llvm.org/D77571 Files:

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-08 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 256070. mwyman added a comment. Renamed NsinvocationArgumentLifetimeCheck -> NSInvocationArgumentLifetimeCheck to match other ObjC checker names. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77571/new/ https:/

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 255513. mwyman added a comment. Trying to fix Harbormaster build. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77571/new/ https://reviews.llvm.org/D77571 Files: clang-tools-extra/clang-tidy/objc/CMakeLists.t

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 255519. mwyman added a comment. Missed CHECK-FIXES for block argument. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77571/new/ https://reviews.llvm.org/D77571 Files: clang-tools-extra/clang-tidy/objc/CMakeLi

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-06 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/NsinvocationArgumentLifetimeCheck.cpp:71-73 + // Currently there is no way to directly get the source range for the + // __weak/__strong ObjC lifetime qualifier

[PATCH] D77571: [clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 255461. mwyman marked 6 inline comments as done. mwyman added a comment. Responding to review feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77571/new/ https://reviews.llvm.org/D77571 Files: clang-to

[PATCH] D77571: Add ClangTidy check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 255423. mwyman added a comment. Check for Objective-C block pointers as well, which also require __unsafe_unretained when retrieved as arguments from NSInvocation under ARC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D77571: Add ClangTidy check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. Herald added subscribers: cfe-commits, mgorny. Herald added a project: clang. mwyman added reviewers: stephanemoore, benhamilton, dmaclach. mwyman added a project: clang-tools-extra. mwyman edited the summary of this revision. This check is similar to an ARC Migration

[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, isNotOverriding

[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 depreca

[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-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: clang-tool

[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) +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/ ht

[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 NS_UNAVAILABLE;

[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: clang-tools-extra/clang-tidy/objc/CMa

[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 ACTI

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

2020-03-03 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. Herald added subscribers: cfe-commits, mgorny. Herald added a project: clang. Such method declarations don't provide any benefit, as even without the declaration the compiler would complain about calling the method as it doesn't exist. Repository: rG LLVM Github

[PATCH] D72876: Create a clang-tidy check to warn when -dealloc is implemented inside an ObjC class category.

2020-02-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. Updated based on feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72876/new/ https://reviews.llvm.org/D72876 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[PATCH] D72876: Create a clang-tidy check to warn when -dealloc is implemented inside an ObjC class category.

2020-02-06 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 242947. mwyman marked an inline comment as done. mwyman added a comment. Make check class `final`, based on feedback.` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72876/new/ https://reviews.llvm.org/D72876 Fi

[PATCH] D72876: Create a clang-tidy check to warn when -dealloc is implemented inside an ObjC class category.

2020-02-04 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 242371. mwyman added a comment. Revert script-changed file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72876/new/ https://reviews.llvm.org/D72876 Files: clang-tools-extra/clang-tidy/objc/CMakeLists.txt c

[PATCH] D72876: Create a clang-tidy check to warn when -dealloc is implemented inside an ObjC class category.

2020-01-30 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/DeallocInCategoryCheck.cpp:34 + +void DeallocInCategoryCheck::check(const MatchFinder::MatchResult &Result) { + const auto *MatchedDecl = Result.Nodes.getNodeAs("dealloc"); stephanemoore

[PATCH] D72876: Create a clang-tidy check to warn when -dealloc is implemented inside an ObjC class category.

2020-01-30 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 241573. mwyman marked 9 inline comments as done. mwyman added a comment. Implemented review feedback. Updated diagnostic message to mention the category name. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72876/

[PATCH] D72876: Create a clang-tidy check to warn when -dealloc is implemented inside an ObjC class category.

2020-01-27 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. Updated the diff based on review feedback. Comment at: clang-tools-extra/clang-tidy/objc/DeallocInCategoriesCheck.cpp:21 + Finder->addMatcher( + objcMethodDecl(hasName("dealloc"), hasDeclContext(objcCategoryImplDecl())) + .bind("dealloc")

[PATCH] D72876: Create a clang-tidy check to warn when -dealloc is implemented inside an ObjC class category.

2020-01-27 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 240716. mwyman marked 7 inline comments as done. mwyman added a comment. Addresses reviewer feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72876/new/ https://reviews.llvm.org/D72876 Files: clang-tool

[PATCH] D72876: Create a clang-tidy check to warn when -dealloc is implemented inside an ObjC class category.

2020-01-16 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 238621. mwyman added a comment. Fixed missing end quote pointed out in review comment. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72876/new/ https://reviews.llvm.org/D72876 Files: clang-tools-extra/clang-tidy/objc/CMakeLists.txt clang-tools-e

[PATCH] D72876: Create a clang-tidy check to warn when -dealloc is implemented inside an ObjC class category.

2020-01-16 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. mwyman added reviewers: stephanemoore, benhamilton. mwyman added projects: clang-tools-extra, clang. Herald added subscribers: cfe-commits, mgehre, mgorny. Such implementations may override the class's own implementation, and even be a danger in case someone later co

[PATCH] D68251: [clang-tidy] Fix module registry name and description for Darwin clang-tidy module.

2019-09-30 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. mwyman added reviewers: stephanemoore, benhamilton, gribozavr. mwyman added projects: clang, clang-tools-extra, LLVM. Herald added subscribers: cfe-commits, xazax.hun. When creating the module, must have copy-pasted from the misc module, and forgotten to update the n

[PATCH] D68148: [clang-tidy] Rename objc-avoid-spinlock check to darwin-avoid-spinlock

2019-09-27 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 53. mwyman added a comment. Moved release note below list of new checks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68148/new/ https://reviews.llvm.org/D68148 Files: clang-tools-extra/clang-tidy/darwin/AvoidSpinlockCheck.cpp clang-tools-e

[PATCH] D68148: [clang-tidy] Rename objc-avoid-spinlock check to darwin-avoid-spinlock

2019-09-27 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. mwyman added reviewers: stephanemoore, dmaclach. mwyman added projects: clang-tools-extra, clang, LLVM. Herald added subscribers: cfe-commits, xazax.hun, mgorny. mwyman edited the summary of this revision. OSSpinLock* are Apple/Darwin functions, but were previously lo

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

2019-09-26 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. In D67567#1685036 , @gribozavr wrote: > Sorry, I reverted it in r373032 because the test fails on Linux: > http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18323 . > Could you please take a look? Thanks! What's

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

2019-09-26 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 222036. mwyman marked 4 inline comments as done. mwyman added a comment. Addressed Stephane's review feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67567/new/ https://reviews.llvm.org/D67567 Files: clang-tools-extra/clang-tidy/CMakeLists.

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

2019-09-26 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 222016. mwyman added a comment. Rebased patch to apply to current master. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67567/new/ https://reviews.llvm.org/D67567 Files: clang-tools-extra/clang-tidy/CMakeLists.txt clang-tools-extra/clang-tidy/Cl

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

2019-09-26 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. In D67567#1684785 , @gribozavr wrote: > Sorry, could you rebase the patch to apply cleanly to master? Seems like > someone else edited ReleaseNotes.rst in the meanwhile. > > $ arc patch D67567 > ... > Checking patch clang-too

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

2019-09-26 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. In D67567#1683905 , @gribozavr wrote: > Thanks! Do you need me to commit the patch for you? Yes, thank you. I don't have commit access—and also wasn't sure if anyone else had further comment. CHANGES SINCE LAST ACTION https:/

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

2019-09-18 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 220751. mwyman added a comment. Addressed review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67567/new/ https://reviews.llvm.org/D67567 Files: clang-tools-extra/clang-tidy/CMakeLists.txt clang-tools-extra/clang-tidy/ClangTidyForceLin

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

2019-09-16 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 220357. mwyman edited the summary of this revision. mwyman added a comment. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous. Migrated check to new `darwin` module. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67567/new/ https://revi

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

2019-09-16 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. In D67567#1670264 , @NoQ wrote: > FTR, we already have a similar Static Analyzer check, eg.: > > https://github.com/llvm-mirror/clang/blob/release_80/test/Analysis/dispatch-once.m#L15 > > https://github.com/llvm-mirror/clang/blo

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

2019-09-13 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. In D67567#1670035 , @lebedev.ri wrote: > In D67567#1670017 , @mwyman wrote: > > > In D67567#1669866 , @lebedev.ri > > wrote: > > > > > 1. Please spli

[PATCH] D67578: New ClangTidy check to warn when writing to a dispatch_once_t variable.

2019-09-13 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. mwyman added reviewers: benhamilton, hokein, stephanemoore. Herald added subscribers: cfe-commits, mgorny. Herald added a project: clang. Libdispatch documentation specifies that dispatch_once_ts must never have been non-zero, and assigning to them violates this. Cu

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

2019-09-13 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added a comment. In D67567#1669866 , @lebedev.ri wrote: > 1. Please split each check into separate review. > 2. Is `dispatch_once_t` OSX-specific thing? Should those checks be in `osx` > module? 1. I split the review. 2. I don't see an `osx` mo

[PATCH] D67567: New ClangTidy checks to warn when storing dispatch_once_t in non-static, non-global storage

2019-09-13 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 220169. mwyman retitled this revision from "New ClangTidy checks to warn about misusing dispatch_once_t" to "New ClangTidy checks to warn when storing dispatch_once_t in non-static, non-global storage". mwyman added a comment. Moved the assignment check to a

[PATCH] D67567: New ClangTidy checks to warn about misusing dispatch_once_t

2019-09-13 Thread Michael Wyman via Phabricator via cfe-commits
mwyman created this revision. mwyman added reviewers: benhamilton, hokein, stephanemoore. Herald added subscribers: cfe-commits, mgorny. Herald added a project: clang. Adds two new ClangTidy checks: - misc-dispatch-once-assignment: warns about assignment to a dispatch_once_t variable. In code re

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

2019-05-22 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 200824. mwyman added a comment. Syncing code with HEAD CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61350/new/ https://reviews.llvm.org/D61350 Files: clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp clang-tools-extra/clang-tidy/goo

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

2019-05-14 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 199375. mwyman added a comment. Bah, previous changes not caught in Git commit; switching back and forth between Git/Mercurial makes for some mix-ups, I guess. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61350/new/ https://reviews.llvm.org/D61350

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

2019-05-13 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 199341. mwyman added a comment. Added +new declaration for ProxyFoo. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61350/new/ https://reviews.llvm.org/D61350 Files: clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp clang-tools-extra/

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

2019-05-13 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 199338. mwyman added a comment. Update for comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61350/new/ https://reviews.llvm.org/D61350 Files: clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp clang-tools-extra/clang-tidy/google

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

2019-05-10 Thread Michael Wyman via Phabricator via cfe-commits
mwyman accepted this revision. mwyman added a comment. I don't have commit access, so if somebody could submit them that would be wonderful! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61350/new/ https://reviews.llvm.org/D61350 ___ cfe-c

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

2019-05-08 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 198702. mwyman marked 2 inline comments as done. mwyman added a comment. Update for review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61350/new/ https://reviews.llvm.org/D61350 Files: clang-tools-extra/clang-tidy/google/AvoidNSObjectN

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

2019-05-08 Thread Michael Wyman via Phabricator via cfe-commits
mwyman added inline comments. Comment at: clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp:112 + Result.Nodes.getNodeAs("new_call")) { +// Don't warn if the call expression originates from a macro expansion. +if (isMessageExpressionInsideMacro(CallEx

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

2019-05-07 Thread Michael Wyman via Phabricator via cfe-commits
mwyman updated this revision to Diff 198503. mwyman marked an inline comment as done. mwyman added a comment. Update comments/doc based on feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61350/new/ https://reviews.llvm.org/D61350 Files: clang-tools-extra/clang-tidy/google/Avo

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

2019-05-07 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/google/AvoidNSObjectNewCheck.cpp:76-77 + // Some classes should use standard factory methods instead of alloc/init. + const std::map ClassToFactoryMethodMap = { +

  1   2   >