[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-06 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D82611#2133521 , @erik.pilkington wrote: > In D82611#2125868 , @MadCoder wrote: > > > > >> I would suggest something like `-Wstrict-direct-dispatch` or something. > > I kinda prefe

[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-01 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. So the risk with that one is that if someone had say the `-didSomething` direct selector and that some UIKit/Apple SDK API now adds this as a thing that you use with CFNotification center for example, where you _need_ dynamism, then the uses of the API would warn all t

[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-01 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added inline comments. Comment at: clang/lib/Sema/SemaExprObjC.cpp:1230 } - -static void HelperToDiagnoseDirectSelectorsExpr(Sema &S, SourceLocation AtLoc, -Selector Sel, +static void HelperToDiagnoseDirectSelectorsExpr(Se

[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-01 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added inline comments. Comment at: clang/test/SemaObjC/potentially-direct-selector.m:84 + (void)@selector(inBaseCat); + (void)@selector(inBaseCatImpl); + (void)@selector(inDerived); I think this might be too weak, if we add a warning then maybe what w

[PATCH] D76643: [objc_direct] also go through implementations when looking for clashes

2020-03-23 Thread Pierre Habouzit via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG20d704a75ed5: [objc_direct] also go through implementations when looking for clashes (authored by MadCoder). Changed prior to commit: https://reviews.llvm.org/D76643?vs=252162&id=252214#toc Repository:

[clang] 20d704a - [objc_direct] also go through implementations when looking for clashes

2020-03-23 Thread Pierre Habouzit via cfe-commits
Author: Pierre Habouzit Date: 2020-03-23T20:49:09-07:00 New Revision: 20d704a75ed51c7a9a155aa3978d0c02671c3f69 URL: https://github.com/llvm/llvm-project/commit/20d704a75ed51c7a9a155aa3978d0c02671c3f69 DIFF: https://github.com/llvm/llvm-project/commit/20d704a75ed51c7a9a155aa3978d0c02671c3f69

[PATCH] D76643: [objc_direct] also go through implementations when looking for clashes

2020-03-23 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 252162. MadCoder edited the summary of this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76643/new/ https://reviews.llvm.org/D76643 Files: clang/lib/Sema/SemaDeclObjC.cpp clang/test/SemaObjC/method-direct-one-definition.m clang/test

[PATCH] D76643: [objc_direct] also go through implementations when looking for clashes

2020-03-23 Thread Pierre Habouzit via Phabricator via cfe-commits
checkObjCDirectMethodClashes() for this purpose. Signed-off-by: Pierre Habouzit Radar-ID: rdar://problem/59332804 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D76643 Files: clang/lib/Sema/SemaDeclObjC.cpp clang/test/SemaObjC/method-direct-one-definition.m Index: clang

[PATCH] D73755: [objc_direct] Small updates to help with adoption.

2020-02-16 Thread Pierre Habouzit via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3adcc78a8071: [objc_direct] Small updates to help with adoption. (authored by MadCoder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73755/new/ https://re

[clang] 3adcc78 - [objc_direct] Small updates to help with adoption.

2020-02-16 Thread Pierre Habouzit via cfe-commits
Author: Pierre Habouzit Date: 2020-02-16T16:32:41-08:00 New Revision: 3adcc78a8071e7d6dd9aa34979f9842a72a2d91b URL: https://github.com/llvm/llvm-project/commit/3adcc78a8071e7d6dd9aa34979f9842a72a2d91b DIFF: https://github.com/llvm/llvm-project/commit

[PATCH] D73755: [objc_direct] Small updates to help with adoption.

2020-02-14 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added inline comments. Comment at: clang/lib/Sema/SemaObjCProperty.cpp:1630-1637 + if (PIDecl->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic && + PIDecl->getPropertyDecl() && + PIDecl->getPropertyDecl()->isDirectProperty()) { +Diag(PropertyL

[PATCH] D73755: [objc_direct] Small updates to help with adoption.

2020-02-14 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 244773. MadCoder marked 10 inline comments as done. MadCoder added a comment. @erik.pilkington review feedback CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73755/new/ https://reviews.llvm.org/D73755 Files: clang/include/clang/Basic/Attr.td cl

[PATCH] D73755: [objc_direct] Small updates to help with adoption.

2020-02-14 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D73755#1874962 , @plotfi wrote: > @MadCoder Could there be a way to mark objc_direct methods as something like > __attribute__((visibility("default"))) or __declspec(dllexport) to denote > that a given method should be direct

[PATCH] D73755: [objc_direct] Small updates to help with adoption.

2020-02-10 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 243649. MadCoder added a comment. Add some errors when direct properties are marked @dynamic. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73755/new/ https://reviews.llvm.org/D73755 Files: clang/include/clang/Basic/Attr.td clang/include/cla

[PATCH] D73208: [objc_direct] fix codegen for mismatched Decl/Impl return types

2020-01-30 Thread Pierre Habouzit via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6eb969b7c5b5: [objc_direct] fix codegen for mismatched Decl/Impl return types (authored by MadCoder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73208/new

[clang] c6cf360 - Revert "[objc_direct] Small updates to help with adoption."

2020-01-30 Thread Pierre Habouzit via cfe-commits
Author: Pierre Habouzit Date: 2020-01-30T18:21:25-08:00 New Revision: c6cf3602e27b76669f785f5fd34b928a889b9db5 URL: https://github.com/llvm/llvm-project/commit/c6cf3602e27b76669f785f5fd34b928a889b9db5 DIFF: https://github.com/llvm/llvm-project/commit/c6cf3602e27b76669f785f5fd34b928a889b9db5

[clang] 6eb969b - [objc_direct] fix codegen for mismatched Decl/Impl return types

2020-01-30 Thread Pierre Habouzit via cfe-commits
Author: Pierre Habouzit Date: 2020-01-30T18:17:45-08:00 New Revision: 6eb969b7c5b5195d7f85b70e2e060eb2989cdc3c URL: https://github.com/llvm/llvm-project/commit/6eb969b7c5b5195d7f85b70e2e060eb2989cdc3c DIFF: https://github.com/llvm/llvm-project/commit

[clang] bebb8e2 - [objc_direct] Small updates to help with adoption.

2020-01-30 Thread Pierre Habouzit via cfe-commits
Author: Pierre Habouzit Date: 2020-01-30T18:17:45-08:00 New Revision: bebb8e2596af8fe97f9b6356ff06e4e80580cf32 URL: https://github.com/llvm/llvm-project/commit/bebb8e2596af8fe97f9b6356ff06e4e80580cf32 DIFF: https://github.com/llvm/llvm-project/commit/bebb8e2596af8fe97f9b6356ff06e4e80580cf32

[PATCH] D73755: [objc_direct] Small updates to help with adoption.

2020-01-30 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder created this revision. MadCoder added reviewers: ahatanak, dexonsmith, arphaman, erik.pilkington. MadCoder added a project: clang. Herald added subscribers: cfe-commits, jfb. Add fixits for messaging self in MRR or using super, as the intent is clear, and it turns out people do that a lot

[PATCH] D73208: [objc_direct] fix codegen for mismatched Decl/Impl return types

2020-01-30 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 241613. MadCoder marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73208/new/ https://reviews.llvm.org/D73208 Files: clang/lib/CodeGen/CGObjCMac.cpp clang/test/CodeGenObjC/direct-method-ret-mismatch.m Index: clang

[PATCH] D73208: [objc_direct] fix codegen for mismatched Decl/Impl return types

2020-01-30 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 241599. MadCoder added a comment. @dexonsmith here, I still hook the same method but do it in a more LLVM-approved way ;) It works with minimap perf impect because the only case we call GenerateDirectMethod with an Implementation is if we're about to codeg

[PATCH] D73208: [objc_direct] fix codegen for mismatched Decl/Impl return types

2020-01-30 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 241601. MadCoder added a comment. damn you tabs! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73208/new/ https://reviews.llvm.org/D73208 Files: clang/lib/CodeGen/CGObjCMac.cpp clang/test/CodeGenObjC/direct-method-ret-mismatch.m Index: clang

[PATCH] D73219: [objc_direct] do not add direct properties to the serialization array

2020-01-23 Thread Pierre Habouzit via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. MadCoder marked an inline comment as done. Closed by commit rG52311d0483ee: [objc_direct] do not add direct properties to the serialization array (authored by MadCoder). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D72747: [objc_direct] Allow for direct messages be sent to `self` when it is a Class

2020-01-23 Thread Pierre Habouzit via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7596d3c50c4b: [objc_direct] Allow for direct messages be sent to `self` when it is a Class (authored by MadCoder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[clang] 52311d0 - [objc_direct] do not add direct properties to the serialization array

2020-01-23 Thread Pierre Habouzit via cfe-commits
Author: Pierre Habouzit Date: 2020-01-23T22:39:47-08:00 New Revision: 52311d0483eecd60bdcc39dd3fb134f2412370f6 URL: https://github.com/llvm/llvm-project/commit/52311d0483eecd60bdcc39dd3fb134f2412370f6 DIFF: https://github.com/llvm/llvm-project/commit/52311d0483eecd60bdcc39dd3fb134f2412370f6

[clang] 7596d3c - [objc_direct] Allow for direct messages be sent to `self` when it is a Class

2020-01-23 Thread Pierre Habouzit via cfe-commits
Author: Pierre Habouzit Date: 2020-01-23T22:39:28-08:00 New Revision: 7596d3c50c4b265612d326369e2a015cf8c60801 URL: https://github.com/llvm/llvm-project/commit/7596d3c50c4b265612d326369e2a015cf8c60801 DIFF: https://github.com/llvm/llvm-project/commit/7596d3c50c4b265612d326369e2a015cf8c60801

[PATCH] D73208: [objc_direct] fix codegen for mismatched Decl/Impl return types

2020-01-23 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D73208#1836789 , @dexonsmith wrote: > In D73208#1836722 , @MadCoder wrote: > > > In D73208#1836704 , @dexonsmith > > wrote: > > > > > In D73208#

[PATCH] D73208: [objc_direct] fix codegen for mismatched Decl/Impl return types

2020-01-23 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D73208#1836704 , @dexonsmith wrote: > In D73208#1835264 , @MadCoder wrote: > > > In D73208#1835051 , @dexonsmith > > wrote: > > > > > Why isn't

[PATCH] D73219: [objc_direct] do not add direct properties to the serialization array

2020-01-23 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder marked 2 inline comments as done. MadCoder added inline comments. Comment at: clang/lib/CodeGen/CGObjCMac.cpp:3316-3319 else if (const ObjCCategoryDecl *CD = dyn_cast(OCD)) { for (const auto *P : CD->protocols()) PushProtocolProperties(PropertySet, Propert

[PATCH] D73208: [objc_direct] fix codegen for mismatched Decl/Impl return types

2020-01-22 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D73208#1835051 , @dexonsmith wrote: > Why isn't a similar dance needed for non-direct methods? because non direct methods do not need an `llvm::Function` to be synthesized at the call-site. direct methods do, and they form o

[PATCH] D73219: [objc_direct] do not add direct properties to the serialization array

2020-01-22 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder created this revision. MadCoder added reviewers: ahatanak, arphaman, dexonsmith, erik.pilkington. MadCoder added a project: clang. Herald added a subscriber: cfe-commits. If we do, then the property_list_t length is wrong and class_getProperty gets very sad. Radar-Id: rdar://problem/5880

[PATCH] D73208: [objc_direct] fix codegen for mismatched Decl/Impl return types

2020-01-22 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder created this revision. MadCoder added reviewers: dexonsmith, ahatanak, erik.pilkington, arphaman. MadCoder added a project: clang. Herald added a subscriber: cfe-commits. For non direct methods, the codegen uses the type of the Implementation. Because Objective-C rules allow some differen

[PATCH] D72747: [objc_direct] Allow for direct messages be sent to `self` when it is a Class

2020-01-22 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 239615. MadCoder added a comment. with the test for real CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72747/new/ https://reviews.llvm.org/D72747 Files: clang/lib/Sema/SemaExprObjC.cpp clang/test/SemaObjC/method-direct-arc.m clang/test/SemaO

[PATCH] D72747: [objc_direct] Allow for direct messages be sent to `self` when it is a Class

2020-01-22 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 239610. MadCoder added a comment. adding the non ARC test I forgot to add CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72747/new/ https://reviews.llvm.org/D72747 Files: clang/lib/Sema/SemaExprObjC.cpp clang/test/SemaObjC/method-direct-arc.m

[PATCH] D72747: [objc_direct] Allow for direct messages be sent to `self` when it is a Class

2020-01-21 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 239477. MadCoder added a comment. fixed @ahatanak feedback CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72747/new/ https://reviews.llvm.org/D72747 Files: clang/lib/Sema/SemaExprObjC.cpp clang/test/SemaObjC/method-direct-arc.m Index: clang/t

[PATCH] D72747: [objc_direct] Allow for direct messages be sent to `self` when it is a Class

2020-01-16 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 238698. MadCoder added a comment. Added some more tests to make sure it works along inheritance chains as expected CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72747/new/ https://reviews.llvm.org/D72747 Files: clang/lib/Sema/SemaExprObjC.cpp

[PATCH] D72747: [objc_direct] Allow for direct messages be sent to `self` when it is a Class

2020-01-14 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder created this revision. MadCoder added reviewers: ahatanak, arphaman, dexonsmith, erik.pilkington. MadCoder added a project: clang. Herald added a subscriber: cfe-commits. Sending a message to `self` when it is const and within a class method is safe because we know that `self` is the Cla

[PATCH] D71682: Relax the rules around objc_alloc and objc_alloc_init optimizations.

2020-01-14 Thread Pierre Habouzit via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd18fbfc09720: Relax the rules around objc_alloc and objc_alloc_init optimizations. (authored by MadCoder). Changed prior to commit: https://reviews.llvm.org/D71682?vs=234644&id=238161#toc Repository:

[clang] d18fbfc - Relax the rules around objc_alloc and objc_alloc_init optimizations.

2020-01-14 Thread Pierre Habouzit via cfe-commits
Author: Pierre Habouzit Date: 2020-01-14T19:48:33-08:00 New Revision: d18fbfc09720009c0dc6a1ddf315402ee0a7751d URL: https://github.com/llvm/llvm-project/commit/d18fbfc09720009c0dc6a1ddf315402ee0a7751d DIFF: https://github.com/llvm/llvm-project/commit

[PATCH] D71682: Relax the rules around objc_alloc and objc_alloc_init optimizations.

2020-01-14 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder marked an inline comment as done. MadCoder added inline comments. Comment at: clang/test/CodeGenObjC/objc-alloc-init.m:30 @implementation Y ++(Class)class { ahatanak wrote: > Can you add a test case for `[[self class] alloc]` to test the code in > `t

[PATCH] D71694: [objc_direct] Tigthen checks for direct methods

2019-12-20 Thread Pierre Habouzit via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG42f9d0c0bee3: [objc_direct] Tigthen checks for direct methods (authored by MadCoder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71694/new/ https://revie

[clang] 42f9d0c - [objc_direct] Tigthen checks for direct methods

2019-12-20 Thread Pierre Habouzit via cfe-commits
Author: Pierre Habouzit Date: 2019-12-20T10:57:36-08:00 New Revision: 42f9d0c0bee32a1a48a45c039988d27115f30da9 URL: https://github.com/llvm/llvm-project/commit/42f9d0c0bee32a1a48a45c039988d27115f30da9 DIFF: https://github.com/llvm/llvm-project/commit/42f9d0c0bee32a1a48a45c039988d27115f30da9

[PATCH] D71694: [objc_direct] Tigthen checks for direct methods

2019-12-19 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 234810. MadCoder added a comment. Removed the category from the direct method name mangling as discussed with @aprantl CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71694/new/ https://reviews.llvm.org/D71694 Files: clang/include/clang/Basic/Dia

[PATCH] D71694: [objc_direct] Tigthen checks for direct methods

2019-12-19 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder marked an inline comment as done. MadCoder added inline comments. Comment at: clang/test/CodeGenObjC/direct-method.m:196 +@implementation Foo (Cat) +// CHECK-LABEL: define hidden i32 @"\01-[Foo(Cat) directMethodInCategory]"( +- (int)directMethodInCategory { -

[PATCH] D71694: [objc_direct] Tigthen checks for direct methods

2019-12-19 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 234778. MadCoder added a comment. I had forgotten to clang format and left some tabs here... some day I'll fix my vim config CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71694/new/ https://reviews.llvm.org/D71694 Files: clang/include/clang/Bas

[PATCH] D71694: [objc_direct] Tigthen checks for direct methods

2019-12-19 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 234777. MadCoder added a comment. Addressed @aprantl review feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71694/new/ https://reviews.llvm.org/D71694 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/AST/DeclObjC.cpp

[PATCH] D71694: [objc_direct] Tigthen checks for direct methods

2019-12-19 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder marked an inline comment as done. MadCoder added inline comments. Comment at: clang/lib/AST/DeclObjC.cpp:963 if (ObjCInterfaceDecl *IFD = ImplD->getClassInterface()) { - if (ObjCMethodDecl *MD = IFD->getMethod(getSelector(), -

[PATCH] D71694: [objc_direct] Tigthen checks for direct methods

2019-12-19 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a subscriber: aprantl. MadCoder added inline comments. Comment at: clang/test/CodeGenObjC/direct-method.m:196 +@implementation Foo (Cat) +// CHECK-LABEL: define hidden i32 @"\01-[Foo(Cat) directMethodInCategory]"( +- (int)directMethodInCategory { t

[PATCH] D71694: [objc_direct] Tigthen checks for direct methods

2019-12-19 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 234684. MadCoder added a comment. Small update because I uploaded before the full completion of the test-suite and somehow it's sentient and punished me... (some diagnostics were too verbose and stuttering things with `Sema::CheckObjCMethodOverrides`). CH

[PATCH] D71694: [objc_direct] Tigthen checks for direct methods

2019-12-19 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder created this revision. MadCoder added reviewers: rjmccall, dexonsmith, erik.pilkington, ahatanak, arphaman. MadCoder added a project: clang. Herald added a subscriber: cfe-commits. Because the name of a direct method must be agreed upon by the caller and the implementation, certain bad

[PATCH] D71682: Relax the rules around objc_alloc and objc_alloc_init optimizations.

2019-12-18 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder created this revision. MadCoder added reviewers: rjmccall, arphaman, erik.pilkington, ahatanak. MadCoder added a project: clang. Herald added subscribers: cfe-commits, dexonsmith. MadCoder edited the summary of this revision. Today the optimization is limited to: - `[ClassName alloc]` -

[PATCH] D71588: [objc_direct] fix uniquing when re-declaring a readwrite-direct property

2019-12-16 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder created this revision. MadCoder added reviewers: arphaman, rjmccall, dexonsmith. MadCoder added a project: clang. Herald added a subscriber: cfe-commits. MadCoder added a reviewer: liuliu. ObjCMethodDecl::getCanonicalDecl() for re-declared readwrite properties, only looks in the ObjCInter

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-09 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D71091#1776009 , @liuliu wrote: > No problem! I have a custom patch that isn't as nice but get the job done. > Let me know when you put new diff out and I can test it on our codebase again. https://reviews.llvm.org/D71226/ne

[PATCH] D71226: Also synthesize _cmd and self for properties

2019-12-09 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D71226#1776038 , @rjmccall wrote: > It'd be nice if we didn't have to synthesize parameters for all declarations > when we're just handling an `@interface`, but we can improve that in > follow-ups. yeah ideally I'd want to

[PATCH] D71226: Also synthesize _cmd and self for properties

2019-12-09 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. @liuliu that fixes your test case (which I reproduced in the CG test) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71226/new/ https://reviews.llvm.org/D71226 ___ cfe-commits

[PATCH] D71226: Also synthesize _cmd and self for properties

2019-12-09 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder created this revision. MadCoder added reviewers: liuliu, rjmccall, arphaman, jfb. Herald added subscribers: cfe-commits, dexonsmith. Herald added a project: clang. MadCoder added a comment. @liuliu that fixes your test case (which I reproduced in the CG test) Radar-Id: rdar://problem/57

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-09 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D71091#1775722 , @liuliu wrote: > We don't use PCH :) I arc patched the latest diff, still have that crash. > More strangely, I tried this latest diff on previously simplistic test case > and it crashes now: > > #import >

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-06 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added inline comments. Comment at: clang/lib/Serialization/ASTWriterDecl.cpp:674 } Record.push_back(D->isInstanceMethod()); Record.push_back(D->isVariadic()); arphaman wrote: > @MadCoder Given the fact that you're now setting SelfDecl and CmdDec

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-06 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 232644. MadCoder marked an inline comment as done. MadCoder added a comment. @liuliu I wouldn't be surprised this addresses your issues if snapchat is using PCH CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71091/new/ https://reviews.llvm.org/D710

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-06 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 232641. MadCoder marked an inline comment as done. MadCoder added a comment. woops a bogus hunk went in CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71091/new/ https://reviews.llvm.org/D71091 Files: clang/lib/CodeGen/CGDebugInfo.cpp clang/lib

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-06 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added inline comments. Comment at: clang/lib/Sema/SemaDeclObjC.cpp:4839 + ObjCMethod->createImplicitParams(Context, ObjCMethod->getClassInterface()); + MadCoder wrote: > liuliu wrote: > > Yeah, I applied this change. As I said, for my trivial example

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-06 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 232638. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71091/new/ https://reviews.llvm.org/D71091 Files: clang/lib/CodeGen/CGDebugInfo.cpp clang/lib/CodeGen/CGObjCMac.cpp clang/lib/Sema/SemaDeclObjC.cpp clang/lib/Serialization/ASTWriterDecl.c

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-06 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder marked an inline comment as done. MadCoder added inline comments. Comment at: clang/lib/Sema/SemaDeclObjC.cpp:4839 + ObjCMethod->createImplicitParams(Context, ObjCMethod->getClassInterface()); + liuliu wrote: > Yeah, I applied this change. As I said,

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-06 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D71091#1773066 , @liuliu wrote: > With this latest fix applied on top of > b220662a45c8067a2ae485ae34c1138d93506df9 > , in our > company's internal code, I

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-06 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. just added all the context this time (-W) Comment at: clang/lib/CodeGen/CGObjCMac.cpp:4030 const ObjCContainerDecl *CD) { - auto I = DirectMethodDefinitions.find(OMD); + auto I = DirectMethodDefinitions.find(OMD

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-06 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 232602. MadCoder marked 2 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71091/new/ https://reviews.llvm.org/D71091 Files: clang/lib/CodeGen/CGObjCMac.cpp clang/lib/Sema/SemaDeclObjC.cpp clang/test/CodeGenObjC/direct-me

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-05 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 232491. MadCoder edited the summary of this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71091/new/ https://reviews.llvm.org/D71091 Files: clang/lib/CodeGen/CGObjCMac.cpp clang/lib/Sema/SemaDeclObjC.cpp clang/test/CodeGenObjC/direct

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-05 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. oh hah, thanks :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71091/new/ https://reviews.llvm.org/D71091 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-05 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 232460. MadCoder added a comment. Fix the fact that the hashmap of direct method was indexed by Declarations instead of names (and depending on code ordering, the declaration used at codegen time may be the one from the @interface or from the @implementatio

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-05 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. hmm wait I have an old problem I had fixed creep up again :'( need to fix it again sigh. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71091/new/ https://reviews.llvm.org/D71091

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-05 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. turns out that I had no codegen check for the call site and that one of the last iteration broke it trivially :'( Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71091/new/ https://reviews.llvm.org/D71091 ___

[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

2019-12-05 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder created this revision. MadCoder added reviewers: rjmccall, arphaman, dexonsmith. MadCoder added a project: clang. Herald added a subscriber: cfe-commits. MadCoder added a comment. turns out that I had no codegen check for the call site and that one of the last iteration broke it triviall

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-17 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 229743. MadCoder added a comment. Diff against previous is: diff diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index 814f67787dd..775e3406da7 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGOb

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-17 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. when running the full test-suite before sending the patch, and it broke tests because some loads are now ordered differently :( yay. so I need to either make sure the CG is done in the same order again, or to fix the test expectations. CHANGES SINCE LAST ACTION htt

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-14 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added inline comments. Comment at: clang/lib/Sema/SemaExprObjC.cpp:1129 + } +} + rjmccall wrote: > Is this a good idea to do for arbitrary diagnostics? I feel like saying > "direct" in the note when that has nothing to do with the conflict could be a

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-14 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 229410. MadCoder marked 2 inline comments as done. MadCoder added a comment. reverted the hunk about "direct methods" note. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69991/new/ https://reviews.llvm.org/D69991 Files: clang/include/clang/AST/D

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-14 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:3919 +in particular, this means that it cannot override a superclass method or satisfy +a protocol requirement. + rjmccall wrote: > Please add a new paragraph here: > > Because

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-14 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 229366. MadCoder marked 7 inline comments as done. MadCoder added a comment. Updated for the new round of comments, with added tests and Sema checks errors for: - messaging super - messaging a nullable Class expression CHANGES SINCE LAST ACTION https://

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-13 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 229238. MadCoder marked 2 inline comments as done. MadCoder added a comment. Implemented all the tests @rjmccall wanted (and then some) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69991/new/ https://reviews.llvm.org/D69991 Files: clang/include

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-13 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder marked 3 inline comments as done. MadCoder added inline comments. Comment at: clang/lib/CodeGen/CGObjCMac.cpp:4075 + + if (OMD->isClassMethod()) { +const ObjCInterfaceDecl *OID = dyn_cast(CD); rjmccall wrote: > MadCoder wrote: > > I suspect this fun

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-13 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D69991#1744979 , @aprantl wrote: > Is it intentional that the direct method names use the exact same symbol > namespace (`\01-[class message]`) as "real" Objective-C methods? Could that > be a problem? Should we use a slightl

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-13 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 229183. MadCoder marked 2 inline comments as done. MadCoder added a comment. Beefed up the tests, addressed the `selfValue` related issue. Also rolled back to the `ObjCDeclInterfaceDecl` cast in GenerateDirectMethod as it turns out that all callers pass thi

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-13 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added inline comments. Comment at: clang/lib/CodeGen/CGObjCMac.cpp:4076 + if (OMD->isClassMethod()) { +const ObjCInterfaceDecl *OID = dyn_cast(CD); +Selector SelfSel = GetNullarySelector("self", CGM.getContext()); rjmccall wrote: > When would th

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-13 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 229024. MadCoder added a comment. Updated `clang/test/Misc/pragma-attribute-supported-attributes-list.test` that I had forgotten. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69991/new/ https://reviews.llvm.org/D69991 Files: clang/include/clan

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-13 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder marked an inline comment as done. MadCoder added inline comments. Comment at: clang/lib/CodeGen/CGObjCGNU.cpp:3885 +{ + // GNU runtime doesn't support direct calls at this time +} MadCoder wrote: > rjmccall wrote: > > This doesn't seem to be diagnosed i

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-13 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 229023. MadCoder marked 8 inline comments as done. MadCoder edited the summary of this revision. MadCoder added a comment. Updated the patch to restrict `objc_direct` to methods and use `objc_direct_members` for containers, and several diagnostics improvemen

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-12 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder marked an inline comment as not done. MadCoder added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:3909 +called directly. It can also be used on Objective-C Categories and Extensions, +in which case it applies to all methods declared in such an ``@in

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-12 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added inline comments. Comment at: clang/lib/CodeGen/CGObjCMac.cpp:2169 +// Direct methods will synthesize the proper `_cmd` internally, + // so just don't bother with setting the `_cmd` argument. +assert(!IsSuper); jeez will fix the indent

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-12 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder updated this revision to Diff 229015. MadCoder marked 16 inline comments as done and an inline comment as not done. MadCoder added a comment. Handled a bunch of comments (marked done). will update again to implement the deeper requested change around `objc_direct_members` and some more

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-08 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D69991#1739456 , @aprantl wrote: > Why doesn't this need an update in lib/Serialization, is there generic code > that handles all attributes? I followed the patch made for `NonLazyClass` and it didn't touch `lib/Serializati

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-07 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder marked 2 inline comments as done. MadCoder added inline comments. Comment at: clang/lib/CodeGen/CGObjCMac.cpp:1588 // interface, we cannot perform this check. + // + // Note that for direct methods, because objc_msgSend is skipped, doh I

[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

2019-11-07 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder created this revision. MadCoder added reviewers: rjmccall, jfb, doug.gregor, dexonsmith. Herald added subscribers: cfe-commits, kristof.beyls. Herald added a project: clang. __attribute__((objc_direct)) is an attribute on methods declaration and implementation, categories, or extensions (

Re: [swift-corelibs-dev] DispatchQueue and Threads

2017-12-22 Thread Pierre Habouzit via swift-corelibs-dev
> On Dec 22, 2017, at 10:59 AM, Pierre Habouzit via swift-corelibs-dev > wrote: > >> On Dec 21, 2017, at 10:57 AM, Geordie J via swift-corelibs-dev >> mailto:swift-corelibs-dev@swift.org>> wrote: >> >> Hi, >> >> We are having som

Re: [swift-corelibs-dev] DispatchQueue and Threads

2017-12-22 Thread Pierre Habouzit via swift-corelibs-dev
> On Dec 21, 2017, at 10:57 AM, Geordie J via swift-corelibs-dev > wrote: > > Hi, > > We are having some issues with threading / dispatch queues this week. > Basically I’m wondering why the following “async” code has the output it does: > > print(Thread.isMainThread) // true > DispatchQueue.m

Re: [swift-evolution] [Pitch] Synthesizing Concurrency: A Pitch For High-Level Abstractions & Low-Level Intelligence

2017-11-22 Thread Pierre Habouzit via swift-evolution
Hi, I'm on vacation and can't quite answer in depth, but this proposal encourages all the wrong things in terms of performance. We know from 10 years of GCD that mixing async/sync, while possible, yields significant performance issues, and I'd rather not have something at the core of the languag

Re: [swift-corelibs-dev] Issue understanding libdispatch runloop poking

2017-10-16 Thread Pierre Habouzit via swift-corelibs-dev
ber of files touched, but small in terms of scope). It'll also allow us to check that it doesn't regress other ports which is always a concern ;) > > On Oct 12, 2017, 9:08 PM -0300, Pierre Habouzit via swift-corelibs-dev > , wrote: >> oh and last, while working on FreeBS

Re: [swift-corelibs-dev] Issue understanding libdispatch runloop poking

2017-10-12 Thread Pierre Habouzit via swift-corelibs-dev
is about to be removed. -Pierre > On Oct 12, 2017, at 4:56 PM, Pierre Habouzit via swift-corelibs-dev > wrote: > >> On Oct 12, 2017, at 4:52 PM, Pierre Habouzit via swift-corelibs-dev >> mailto:swift-corelibs-dev@swift.org>> wrote: >> >>> On Oct 12, 2017,

Re: [swift-corelibs-dev] Issue understanding libdispatch runloop poking

2017-10-12 Thread Pierre Habouzit via swift-corelibs-dev
> On Oct 12, 2017, at 4:52 PM, Pierre Habouzit via swift-corelibs-dev > wrote: > >> On Oct 12, 2017, at 7:48 AM, Rogiel Sulzbach > <mailto:rog...@rogiel.com>> wrote: >> >> I am trying to get libdispatch working on FreeBSD but I am hitting a wall: I >&

Re: [swift-corelibs-dev] Issue understanding libdispatch runloop poking

2017-10-12 Thread Pierre Habouzit via swift-corelibs-dev
eue_class_poke and a event > getting fired in the kqueue implementation (which I believe should be > happening in _dispatch_kq_poll). > > Pierre Habouzit replied to me on the bug tracker: > The equivalent of the eventfd on kevent systems is to use an EVFILT_USER. It > is very like

Re: [swift-evolution] Question about async await

2017-09-26 Thread Pierre Habouzit via swift-evolution
-Pierre > On Sep 26, 2017, at 1:57 PM, Jean-Daniel wrote: > > > >> Le 26 sept. 2017 à 22:38, Pierre Habouzit > <mailto:phabou...@apple.com>> a écrit : >> >>> On Sep 26, 2017, at 11:22 AM, Jean-Daniel via swift-evolution >>> mailto:s

  1   2   3   4   5   6   7   8   9   10   >