[PATCH] D45384: [ObjC++] Never pass structs with `__weak` fields in registers

2018-04-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak closed this revision. ahatanak added a comment. Committed in r329617. Repository: rC Clang https://reviews.llvm.org/D45384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45384: [ObjC++] Never pass structs with `__weak` fields in registers

2018-04-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 141730. ahatanak marked 2 inline comments as done. ahatanak added a comment. Address review comments. Repository: rC Clang https://reviews.llvm.org/D45384 Files: clang/include/clang/AST/Decl.h clang/include/clang/AST/Type.h clang/lib/AST/Decl.cpp

[PATCH] D45384: [ObjC++] Never pass structs with `__weak` fields in registers

2018-04-06 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Just a couple minor requests; if you accept them, feel free to commit. Comment at: include/clang/AST/Decl.h:3556 +/// indirectly. This value is used only in C++. +APK_CannotPassInRegs, + I think it's probably worth spelling out

[PATCH] D45384: [ObjC++] Never pass structs with `__weak` fields in registers

2018-04-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 141471. ahatanak added a comment. Replace flags CanPassInRegisters and CannotPassInRegisters with a 2-bit enum in RecordDecl. Repository: rC Clang https://reviews.llvm.org/D45384 Files: include/clang/AST/Decl.h include/clang/AST/Type.h lib/AST/De

[PATCH] D45384: [ObjC++] Never pass structs with `__weak` fields in registers

2018-04-06 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D45384#1060369, @ahatanak wrote: > Yes. I intended it as a property that propagates to classes that contain or > derive from the type. > > Would it make it less confusing if I merged CXXRecordDecl::CanPassInRegisters > and RecordDecl::Cannot

[PATCH] D45384: [ObjC++] Never pass structs with `__weak` fields in registers

2018-04-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Yes. I intended it as a property that propagates to classes that contain or derive from the type. Would it make it less confusing if I merged CXXRecordDecl::CanPassInRegisters and RecordDecl::CannotPassInRegisters into a single enum? For example, the enum could have t

[PATCH] D45384: [ObjC++] Never pass structs with `__weak` fields in registers

2018-04-06 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D45384#1060192, @ahatanak wrote: > In https://reviews.llvm.org/D45384#1060164, @rjmccall wrote: > > > Well, but I think CanPassInRegisters==false in the base class does always > > mean CanPassInRegisters==false in the subclass. > > > I think

[PATCH] D45384: [ObjC++] Never pass structs with `__weak` fields in registers

2018-04-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D45384#1060164, @rjmccall wrote: > Well, but I think CanPassInRegisters==false in the base class does always > mean CanPassInRegisters==false in the subclass. I think there are cases that is not true. If I compile the following code, S0 (b

[PATCH] D45384: [ObjC++] Never pass structs with `__weak` fields in registers

2018-04-06 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Well, but I think CanPassInRegisters==false in the base class does always mean CanPassInRegisters==false in the subclass. Repository: rC Clang https://reviews.llvm.org/D45384 ___ cfe-commits mailing list cfe-commits@lis

[PATCH] D45384: [ObjC++] Never pass structs with `__weak` fields in registers

2018-04-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, rsmith. This patch fixes a bug in r328731 that caused structs with `__weak` fields to be passed in registers. This happens when a struct doesn't have a `__weak` field but one of its subobjects does. To fix this, I added flag CX