Page MenuHomePhabricator

MadCoder (Pierre Habouzit)
User

Projects

User does not belong to any projects.

User Details

User Since
Nov 7 2019, 11:21 PM (4 w, 4 d)

Recent Activity

Yesterday

MadCoder added a comment to D71091: Make sure that the implicit arguments for direct methods have been setup.

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.

Mon, Dec 9, 2:47 PM · Restricted Project
MadCoder added a comment to D71226: Also synthesize _cmd and self for properties.

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.

Mon, Dec 9, 2:01 PM · Restricted Project
MadCoder added a comment to D71226: Also synthesize _cmd and self for properties.

@liuliu that fixes your test case (which I reproduced in the CG test)

Mon, Dec 9, 1:40 PM · Restricted Project
MadCoder created D71226: Also synthesize _cmd and self for properties.
Mon, Dec 9, 1:40 PM · Restricted Project
MadCoder added a comment to D71091: Make sure that the implicit arguments for direct methods have been setup.

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 <Foundation/Foundation.h>

@interface SCTestMainEntity : NSObject

@property (nonatomic, readonly, direct) int date;

- (instancetype)initWithDate:(int)date;

@end

int main(void)
{
    SCTestMainEntity *entity = [[SCTestMainEntity alloc] initWithDate:10];
    printf("%d\n", entity.date);
    return 0;
}
Mon, Dec 9, 12:34 PM · Restricted Project

Fri, Dec 6

MadCoder added inline comments to D71091: Make sure that the implicit arguments for direct methods have been setup.
Fri, Dec 6, 2:07 PM · Restricted Project
MadCoder updated the diff for D71091: Make sure that the implicit arguments for direct methods have been setup.

@liuliu I wouldn't be surprised this addresses your issues if snapchat is using PCH

Fri, Dec 6, 2:06 PM · Restricted Project
MadCoder added inline comments to D71091: Make sure that the implicit arguments for direct methods have been setup.
Fri, Dec 6, 1:39 PM · Restricted Project
MadCoder updated the diff for D71091: Make sure that the implicit arguments for direct methods have been setup.

woops a bogus hunk went in

Fri, Dec 6, 1:39 PM · Restricted Project
MadCoder updated the diff for D71091: Make sure that the implicit arguments for direct methods have been setup.
Fri, Dec 6, 1:21 PM · Restricted Project
MadCoder updated the summary of D71091: Make sure that the implicit arguments for direct methods have been setup.
Fri, Dec 6, 1:21 PM · Restricted Project
MadCoder added inline comments to D71091: Make sure that the implicit arguments for direct methods have been setup.
Fri, Dec 6, 12:26 PM · Restricted Project
MadCoder added a comment to D71091: Make sure that the implicit arguments for direct methods have been setup.

With this latest fix applied on top of b220662a45c8067a2ae485ae34c1138d93506df9, in our company's internal code, I still encounter the crash.

Showing All Messages
/Users/liuliu/Snapchat/Dev/phantom/3.	Libraries/Storage/DocObject/Implementations/SCSQLiteDocObjectContext/Tests/Generated/SCTestMainEntityChangeRequest.mm:338:25: LLVM IR generation of compound statement ('{}')
/Users/liuliu/Snapchat/Dev/phantom/0  clang-10                 0x000000010b9edf0c llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60
1  clang-10                 0x000000010b9ee4c9 PrintStackTraceSignalHandler(void*) + 25
/Users/liuliu/Snapchat/Dev/phantom/2  clang-10                 0x000000010b9ec086 llvm::sys::RunSignalHandlers() + 118
3  clang-10                 0x000000010b9f1e6c SignalHandler(int) + 252
4  libsystem_platform.dylib 0x00007fff65d8eb5d _sigtramp + 29
5  libsystem_platform.dylib 0x00007ffee7e9b790 _sigtramp + 18446744071596723280
/Users/liuliu/Snapchat/Dev/phantom/6  clang-10                 0x000000010bfdff14 clang::CodeGen::CodeGenTypes::arrangeObjCMethodDeclaration(clang::ObjCMethodDecl const*) + 52
/Users/liuliu/Snapchat/Dev/phantom/7  clang-10                 0x000000010c1f6bcd (anonymous namespace)::CGObjCCommonMac::GenerateDirectMethod(clang::ObjCMethodDecl const*, clang::ObjCContainerDecl const*) + 285
/Users/liuliu/Snapchat/Dev/phantom/8  clang-10                 0x000000010c1f63e9 (anonymous namespace)::CGObjCCommonMac::EmitMessageSend(clang::CodeGen::CodeGenFunction&, clang::CodeGen::ReturnValueSlot, clang::QualType, clang::Selector, llvm::Value*, clang::QualType, bool, clang::CodeGen::CallArgList const&, clang::ObjCMethodDecl const*, clang::ObjCInterfaceDecl const*, (anonymous namespace)::ObjCCommonTypesHelper const&) + 1401
/Users/liuliu/Snapchat/Dev/phantom/9  clang-10                 0x000000010c205b14 (anonymous namespace)::CGObjCNonFragileABIMac::GenerateMessageSend(clang::CodeGen::CodeGenFunction&, clang::CodeGen::ReturnValueSlot, clang::QualType, clang::Selector, llvm::Value*, clang::CodeGen::CallArgList const&, clang::ObjCInterfaceDecl const*, clang::ObjCMethodDecl const*) + 644

It indeed won't crash any more in trivial examples. I need to have some other time to reduce my local example to a reasonable size.

Fri, Dec 6, 11:47 AM · Restricted Project
MadCoder added a comment to D71091: Make sure that the implicit arguments for direct methods have been setup.

just added all the context this time (-W)

Fri, Dec 6, 10:12 AM · Restricted Project
MadCoder updated the diff for D71091: Make sure that the implicit arguments for direct methods have been setup.
Fri, Dec 6, 10:05 AM · Restricted Project

Thu, Dec 5

MadCoder added a reviewer for D71091: Make sure that the implicit arguments for direct methods have been setup: jfb.
Thu, Dec 5, 8:43 PM · Restricted Project
MadCoder updated the diff for D71091: Make sure that the implicit arguments for direct methods have been setup.
Thu, Dec 5, 8:34 PM · Restricted Project
MadCoder added a comment to D71091: Make sure that the implicit arguments for direct methods have been setup.

oh hah, thanks :)

Thu, Dec 5, 8:34 PM · Restricted Project
MadCoder updated the diff for D71091: Make sure that the implicit arguments for direct methods have been setup.

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 @implementation leading to name collisions and llvm "helpfully" adding .1's everywhere

Thu, Dec 5, 3:35 PM · Restricted Project
MadCoder updated the summary of D71091: Make sure that the implicit arguments for direct methods have been setup.
Thu, Dec 5, 3:35 PM · Restricted Project
MadCoder added a comment to D71091: Make sure that the implicit arguments for direct methods have been setup.

hmm wait I have an old problem I had fixed creep up again :'(

Thu, Dec 5, 2:35 PM · Restricted Project
MadCoder added a comment to D71091: Make sure that the implicit arguments for direct methods have been setup.

turns out that I had no codegen check for the call site and that one of the last iteration broke it trivially :'(

Thu, Dec 5, 2:26 PM · Restricted Project
MadCoder created D71091: Make sure that the implicit arguments for direct methods have been setup.
Thu, Dec 5, 2:26 PM · Restricted Project

Thu, Nov 21

MadCoder accepted D70544: Debug info: Emit objc_direct methods as members of their containing class.
Thu, Nov 21, 10:14 AM · Restricted Project, debug-info

Sun, Nov 17

MadCoder updated the diff for D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).

Diff against previous is:

Sun, Nov 17, 8:49 PM · Restricted Project
MadCoder added a comment to D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).

when running the full test-suite before sending the patch, and it broke tests because some loads are now ordered differently :(
yay.

Sun, Nov 17, 8:32 PM · Restricted Project

Thu, Nov 14

MadCoder added inline comments to D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).
Thu, Nov 14, 2:36 PM · Restricted Project
MadCoder updated the diff for D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).

reverted the hunk about "direct methods" note.

Thu, Nov 14, 2:36 PM · Restricted Project
MadCoder updated the diff for D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).

Updated for the new round of comments, with added tests and Sema checks errors for:

  • messaging super
  • messaging a nullable Class expression
Thu, Nov 14, 11:20 AM · Restricted Project
MadCoder added inline comments to D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).
Thu, Nov 14, 11:20 AM · Restricted Project

Wed, Nov 13

MadCoder updated the diff for D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).

Implemented all the tests @rjmccall wanted (and then some)

Wed, Nov 13, 11:29 PM · Restricted Project
MadCoder added inline comments to D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).
Wed, Nov 13, 11:29 PM · Restricted Project
MadCoder added a comment to D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).

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 slightly different naming scheme?

Wed, Nov 13, 10:00 PM · Restricted Project
MadCoder updated the diff for D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).

Beefed up the tests, addressed the selfValue related issue.

Wed, Nov 13, 2:05 PM · Restricted Project
MadCoder added inline comments to D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).
Wed, Nov 13, 2:05 PM · Restricted Project
MadCoder added inline comments to D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).
Wed, Nov 13, 1:28 AM · Restricted Project
MadCoder updated the diff for D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).

Updated clang/test/Misc/pragma-attribute-supported-attributes-list.test that I had forgotten.

Wed, Nov 13, 1:28 AM · Restricted Project
MadCoder updated the diff for D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).

Updated the patch to restrict objc_direct to methods and use objc_direct_members for containers, and several diagnostics improvements (especially in the vicinity of properties and the GNU runtime + tests).

Wed, Nov 13, 1:18 AM · Restricted Project

Tue, Nov 12

MadCoder added inline comments to D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).
Tue, Nov 12, 11:20 PM · Restricted Project
MadCoder updated the diff for D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).

Handled a bunch of comments (marked done).

Tue, Nov 12, 11:20 PM · Restricted Project
MadCoder added inline comments to D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).
Tue, Nov 12, 11:20 PM · Restricted Project

Nov 8 2019

MadCoder added a comment to D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).

Why doesn't this need an update in lib/Serialization, is there generic code that handles all attributes?

Nov 8 2019, 3:01 PM · Restricted Project

Nov 7 2019

MadCoder added inline comments to D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).
Nov 7 2019, 11:37 PM · Restricted Project
MadCoder updated the summary of D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).
Nov 7 2019, 11:37 PM · Restricted Project
MadCoder created D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)).
Nov 7 2019, 11:26 PM · Restricted Project