[PATCH] D65256: [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownership qualifications as unavailable if the union is declared in a system header

2019-09-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 218767. ahatanak marked 3 inline comments as done. ahatanak added a comment. Address review comments. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65256/new/ https://reviews.llvm.org/D65256 Files: include/clang/AST/ASTCo

[PATCH] D65256: [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownership qualifications as unavailable if the union is declared in a system header

2019-09-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 218826. ahatanak marked 2 inline comments as done. ahatanak added a comment. Address review comments. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65256/new/ https://reviews.llvm.org/D65256 Files: include/clang/AST/ASTCo

[PATCH] D65256: [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownership qualifications as unavailable if the union is declared in a system header

2019-09-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaDecl.cpp:11176 for (const FieldDecl *FD : RD->fields()) - asDerived().visit(FD->getType(), FD, InNonTrivialUnion); + if (!FD->hasAttr()) +asDerived().visit(FD->getType(), FD, InNonTrivialUnion); -

[PATCH] D65256: [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownership qualifications as unavailable if the union is declared in a system header

2019-09-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 219008. ahatanak added a comment. Rename function to `ignoreForTrivialityComputation`. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65256/new/ https://reviews.llvm.org/D65256 Files: include/clang/AST/ASTContext.h lib/A

[PATCH] D65256: [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownership qualifications as unavailable if the union is declared in a system header

2019-09-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 219191. ahatanak marked 2 inline comments as done. ahatanak added a comment. Rename function and fix comments. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65256/new/ https://reviews.llvm.org/D65256 Files: include/clang/

[PATCH] D65256: [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownership qualifications as unavailable if the union is declared in a system header

2019-09-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaDecl.cpp:11144 + // Ignore unavailable fields since they don't affect the triviality of the + // containing struct/union. + return FD->hasAttr(); rjmccall wrote: > The "since" clause here is circular: th

[PATCH] D65256: [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownership qualifications as unavailable if the union is declared in a system header

2019-09-06 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL371276: [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownership (authored by ahatanak, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D35693: [Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions

2017-07-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D35693#816994, @rjmccall wrote: > Does the ARM64 ABI call for unwind tables to be emitted for all functions, > like the x86-64 ABI does? > > Anyway, it seems pretty unfortunate that the default behavior breaks > exceptions. According to Ni

[PATCH] D35693: [Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions

2017-08-03 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL310006: [Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D35693?vs=107563&id=109659#toc Repository: rL LLVM htt

[PATCH] D32210: [Sema][ObjC] Add support for attribute "noescape"

2017-08-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 109814. ahatanak added a comment. Include noescape attribute information in the function prototype and modify the AST printer and name mangling accordingly. Also, make changes to allow implicit conversion from a function that takes noescape parameters to a

[PATCH] D32210: [Sema][ObjC] Add support for attribute "noescape"

2017-08-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CGCall.cpp:2096 +if (FI.getExtParameterInfo(ArgNo).isNoEscape()) + Attrs.addAttribute(llvm::Attribute::NoCapture); + rjmccall wrote: > ahatanak wrote: > > rjmccall wrote: > > > You should make sure

[PATCH] D32210: [Sema][ObjC] Add support for attribute "noescape"

2017-08-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 110612. ahatanak marked 6 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D32210 Files: include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/Di

[PATCH] D32210: [Sema][ObjC] Add support for attribute "noescape"

2017-08-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/AST/ItaniumMangle.cpp:2700 + if (FD->getParamDecl(I)->hasAttr()) +Out << "U8noescape"; } rjmccall wrote: > This is not the right place to do this: > > * It needs to be mangled in function types, n

[PATCH] D36915: [Sema] Diagnose local variables and parameters captured by lambda and block expressions in a default argument

2017-08-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. This patch fixes an assertion failure that occurs when compiling the following invalid code: struct S { template S(T &&) {} }; template void foo1(int a0, S a1 = [](){ (void)&a0; } ) { // a0 cannot be used in the default argument for a1 }

[PATCH] D36918: [Sema] Take into account the current context when checking the accessibility of a member function pointer

2017-08-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. Sema::CheckAddressOfMemberAccess was disregarding the context in which the member pointer was referenced. This patch fixes PR32898. rdar://problem/33737747 https://reviews.llvm.org/D36918 Files: lib/Sema/SemaAccess.cpp test/SemaCXX/access.cpp Index: test

[PATCH] D36918: [Sema] Take into account the current context when checking the accessibility of a member function pointer

2017-08-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 111805. ahatanak added a comment. Test access to protected member functions. https://reviews.llvm.org/D36918 Files: lib/Sema/SemaAccess.cpp test/SemaCXX/access.cpp Index: test/SemaCXX/access.cpp ===

[PATCH] D36915: [Sema] Diagnose local variables and parameters captured by lambda and block expressions in a default argument

2017-08-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D36915#849622, @faisalv wrote: > I don't think this approach is entirely correct for at least the following > reasons: > > 1. in the lambda case the machinery that diagnoses capture failures should be > the machinery erroring on the lambda (

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

2020-01-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/test/CodeGenObjC/objc-alloc-init.m:30 @implementation Y ++(Class)class { Can you add a test case for `[[self class] alloc]` to test the code in `tryGenerateSpecializedMessageSend`? Repository: rG LLVM Gith

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

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

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

2020-01-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71682/new/ https://reviews.llvm.org/D71682 ___

[PATCH] D87611: [SystemZ][z/OS] Set aligned allocation unavailable by default for z/OS

2020-09-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:7216 "aligned %select{allocation|deallocation}0 function of type '%1' is only " "available on %2 %3 or newer">; +def err_aligned_allocation_unavailable_on_os : Error< --

[PATCH] D88336: [ubsan] nullability-arg: Fix crash on C++ member function pointers

2020-09-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. It looks like this still doesn't check null correctly (i.e., compare to -1) for data member pointers. Is that correct? Comment at: clang/lib/CodeGen/CGCall.cpp:3750 + // Under the Itanium ABI, if the argument has member pointer type, it's a + // pai

[PATCH] D88336: [ubsan] nullability-arg: Fix crash on C++ member function pointers

2020-09-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. LGTM Comment at: clang/lib/CodeGen/CGExpr.cpp:1181 + if (T->isMemberPointerType()) +return CGM.getCXXABI().EmitMemberPointerIsNotNull( +*this, V, T->getAs())

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, smeenai, dexonsmith, pete, fhahn. ahatanak added projects: clang, LLVM. Herald added subscribers: ributzka, pengfei, jkorous, hiraditya, kristof.beyls. ahatanak requested review of this revision. Background: === This fixe

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 310387. ahatanak marked 2 inline comments as done. ahatanak edited the summary of this revision. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808 Files: clang/lib/CodeG

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/CodeGen/CGObjC.cpp:2328 + CGF.CGM.getTarget().getTriple().isAArch64() && + !CGF.CGM.getTarget().getTriple().isOSWindows()) { +auto *callBase = cast(value); rjmccall wrote: > It would be good to e

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 310561. ahatanak marked 3 inline comments as done. ahatanak added a comment. Address review comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808 Files: clang/lib

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/CodeGen/CGObjC.cpp:2328 + CGF.CGM.getTarget().getTriple().isAArch64() && + !CGF.CGM.getTarget().getTriple().isOSWindows()) { +auto *callBase = cast(value); ahatanak wrote: > rjmccall wrote: > > c

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 310568. ahatanak added a comment. Fix an incorrect comment in insertRetainOrClaimRVCalls in InlineFunction.cpp. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808 Files:

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In D92808#2443006 , @compnerd wrote: > There is nothing particularly special about that. The reason for the funclet > handling there is that in the case of an outlined block for exception > handling (i.e. a funclet), we need to

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Hmm, it seems that calls to some of the ARC runtime functions don't get the token. In some cases, I'm seeing WinEHPrepare (ToT clang, without this patch) turn a call to @objc_unsafeClaimAutoreleasedReturnValue in an EH cleanup block into an unreachable. Repository:

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 310693. ahatanak edited the summary of this revision. ahatanak added a comment. Enable the optimization on Windows. Move `createCallInst` defined in ObjCARCContract.cpp to ObjCARC.h and use it to create calls to retainRV/claimRV with funclet tokens when ARC

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. ToT clang/llvm (without this patch) is turning the call to `@objc_unsafeClaimAutoreleasedReturnValue` in the EH cleanup block into an unreachable when compiling the following code. It looks like this happens because the inliner isn't adding the funclet token, but it's

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 310709. ahatanak added a comment. Elaborate on when `createCallInstWithColors` should be called. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808 Files: clang/lib/Cod

[PATCH] D78760: Check a class doesn't have a dependent type before iterating over its base classes

2020-12-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 310728. ahatanak added a comment. Rebase and ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78760/new/ https://reviews.llvm.org/D78760 Files: clang/lib/AST/DeclCXX.cpp clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 311092. ahatanak added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808 Files: clang/lib/CodeGen/CGObjC.cpp clang/test/CodeGenObjC/arc-rv-attr.m

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2020-12-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 311662. ahatanak added a comment. Set the insert point before generating new instructions in `insertRetainOrClaimRVCalls`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92

[PATCH] D93273: [CodeGen][ObjC] Destroy callee-destroyed arguments in the caller function when the receiver is nil

2020-12-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rjmccall. ahatanak added a project: clang. Herald added subscribers: ributzka, jkorous. ahatanak requested review of this revision. Callee-destroyed arguments to a method have to be destroyed in the caller function when the receiver is ni

[PATCH] D92361: [trivial-abi] Support types without a copy or move constructor.

2020-12-16 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:6502 + // except that it has a non-trivial member *with* the trivial_abi attribute. + for (auto Base : D->bases()) { +if (auto CxxRecord = Base.getType()->getAsCXXRecordDecl()) It lo

[PATCH] D92361: [trivial-abi] Support types without a copy or move constructor.

2020-12-16 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:6502 + // except that it has a non-trivial member *with* the trivial_abi attribute. + for (auto Base : D->bases()) { +if (auto CxxRecord = Base.getType()->getAsCXXRecordDecl()) zoeca

[PATCH] D92361: [trivial-abi] Support types without a copy or move constructor.

2020-12-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. This latest patch changes the way `D` is passed in the following example, which doesn't use `trivial_abi` at all: struct B0 { int a; B0(); B0(const B0 &) = default; B0(B0 &&) = delete; }; struct B1 { int a; B1(); B1(const B1 &) = del

[PATCH] D92361: [trivial-abi] Support types without a copy or move constructor.

2020-12-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. We could probably do something like what this patch is doing and determine whether a class can be passed in registers based on whether its subobjects can be passed in registers. If all of the subobjects can be passed in registers, the current class can be passed in reg

[PATCH] D91111: [CodeGen] Mark calls to objc_autorelease as tail

2020-11-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rjmccall. ahatanak added a project: clang. Herald added subscribers: ributzka, jkorous. ahatanak requested review of this revision. This enables a method sending an autorelease message to an object and returning the object in MRR to avoid

[PATCH] D91111: [CodeGen] Mark calls to objc_autorelease as tail

2020-11-10 Thread Akira Hatanaka 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 rG874b0a0b9db9: [CodeGen] Mark calls to objc_autorelease as tail (authored by ahatanak). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACT

[PATCH] D88265: Fix comma with half vectors.

2020-09-29 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added inline comments. This revision is now accepted and ready to land. Comment at: clang/test/Sema/fp16vec-sema.c:33 + 1, hv0; // expected-warning 2 {{expression result unused}} // Implicit conversion between half vectors and float

[PATCH] D88863: [docs] Fix vector literal examples that don't compile

2020-10-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: nemanjai, ayartsev. ahatanak added a project: clang. Herald added subscribers: ributzka, dexonsmith, jkorous. ahatanak requested review of this revision. Guard the AltiVec vector variables with `#ifdef __VEC__` and remove the last line, wh

[PATCH] D88863: [docs] Fix vector literal examples that don't compile

2020-10-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak planned changes to this revision. ahatanak added a comment. The parenthesis initialization does not work as documented for GCC or OpenCL vectors, so that has to be fixed too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88863/new/ https:

[PATCH] D92361: [trivial-abi] Support types without a copy or move constructor.

2020-12-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In the following example, should `S1` be passed directly or indirectly? The current patch passes it indirectly. struct __attribute__((trivial_abi)) S0 { S0(); S0(const S0 &) = delete; S0(S0 &&) = delete; int a; }; struct S1 { S0 s0; };

[PATCH] D92361: [trivial-abi] Support types without a copy or move constructor.

2020-12-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. It seems like you are discussing the case where a class/struct annotated with `trivial_abi` contains a member that isn't destructively movable. In that case, clang correctly diagnoses it today. For example, if you remove the attribute from `S2` in the above example and

[PATCH] D82999: [CodeGen] Check the cleanup flag before destructing lifetime-extended temporaries created in conditional expressions

2020-10-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak abandoned this revision. ahatanak added a comment. This was fixed by https://reviews.llvm.org/D86854. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82999/new/ https://reviews.llvm.org/D82999 ___

[PATCH] D83448: [CodeGen] Emit destructor calls to destruct non-trivial C struct temporaries created by conditional and assignment operators

2020-10-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83448/new/ https://reviews.llvm.org/D83448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[PATCH] D78760: Check a class doesn't have a dependent type before iterating over its base classes

2020-10-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78760/new/ https://reviews.llvm.org/D78760 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[PATCH] D83448: [CodeGen] Emit destructor calls to destruct non-trivial C struct temporaries created by conditional and assignment operators

2020-10-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. C structs with ObjC pointer fields are non-trivial when ARC is enabled since construction, destruction, and copy are non-trivial (see https://reviews.llvm.org/D41228). As far as I know, this is limited to ObjC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D78760: Check a class doesn't have a dependent type before iterating over its base classes

2020-11-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78760/new/ https://reviews.llvm.org/D78760 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[PATCH] D102996: [ObjC][ARC] Use the addresses of the ARC runtime functions instead of integer 0/1 for the operand of bundle "clang.arc.attachedcall"

2021-05-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, ab, fhahn, dexonsmith. ahatanak added a project: clang. ahatanak requested review of this revision. This should make it easier to understand what the IR is doing and also simplify some of the passes as they no longer have to tran

[PATCH] D102996: [ObjC][ARC] Use the addresses of the ARC runtime functions instead of integer 0/1 for the operand of bundle "clang.arc.attachedcall"

2021-05-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. https://reviews.llvm.org/D103000 is the llvm patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102996/new/ https://reviews.llvm.org/D102996 ___ cfe-commits mailing list cfe-c

[PATCH] D98799: [UniqueLinkageName] Use consistent checks when mangling symbo linkage name and debug linkage name.

2021-06-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I don't know know why these fake FunctionDecls are needed, but it looks like it's okay to avoid creating them. I see a few debug info tests failing if `GlobalDecl()` instead of a fake function is passed to `StartFunction`, but it looks like the test check strings shoul

[PATCH] D98799: [UniqueLinkageName] Use consistent checks when mangling symbo linkage name and debug linkage name.

2021-06-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Yes, I think I can fix that. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98799/new/ https://reviews.llvm.org/D98799 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2021-01-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added a comment. Add helper functions to ObjCARCRVAttr.h for adding, removing, or looking up attributes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2021-01-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 318278. ahatanak added a comment. Update patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808 Files: clang/lib/CodeGen/CGObjC.cpp clang/test/CodeGenObjC/arc-rv-a

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2021-01-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/CodeGen/CGObjC.cpp:2342 +attrs = attrs.addAttribute(CGF.getLLVMContext(), + llvm::AttributeList::ReturnIndex, "rv_marker"); +callBase->setAttributes(attrs); rjmccall wrote

[PATCH] D95181: [CodeGen][ObjC] Fix broken IR generated when there is a nil receiver check

2021-01-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rjmccall. ahatanak added a project: clang. Herald added subscribers: ributzka, jkorous. ahatanak requested review of this revision. This patch fixes a bug in `emitARCOperationAfterCall` where it inserts the fall-back call after a bitcast

[PATCH] D95181: [CodeGen][ObjC] Fix broken IR generated when there is a nil receiver check

2021-01-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 318366. ahatanak added a comment. Add a test for invoke and a FIXME for eliminating the need for emitARCOperationAfterCall. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95181/new/ https://reviews.llvm.org/D9

[PATCH] D95181: [CodeGen][ObjC] Fix broken IR generated when there is a nil receiver check

2021-01-21 Thread Akira Hatanaka 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 rG3d349ed7e110: [CodeGen][ObjC] Fix broken IR generated when there is a nil receiver (authored by ahatanak). Repository: rG LLVM Github Monorepo CH

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2021-01-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/CodeGen/CGObjC.cpp:2342 +attrs = attrs.addAttribute(CGF.getLLVMContext(), + llvm::AttributeList::ReturnIndex, "rv_marker"); +callBase->setAttributes(attrs); rjmccall wrote

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2021-01-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 318594. ahatanak edited the summary of this revision. ahatanak added a comment. Stop using `clang.arc.rv_marker` and just use "clang.arc.rv"="retain/claim". Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/n

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2021-01-25 Thread Akira Hatanaka 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 rG53176c168061: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV (authored by ahatanak). Repository: rG LLVM Github Monorepo

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2021-01-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: llvm/lib/IR/Instruction.cpp:580 +if (auto *CB = dyn_cast(this)) + return objcarc::hasRetainRVOrClaimRVAttr(CB); +return false; fhahn wrote: > rjmccall wrote: > > nikic wrote: > > > This change looks pretty

[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

2021-01-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: llvm/lib/IR/Instruction.cpp:580 +if (auto *CB = dyn_cast(this)) + return objcarc::hasRetainRVOrClaimRVAttr(CB); +return false; fhahn wrote: > ahatanak wrote: > > fhahn wrote: > > > rjmccall wrote: > > > > n

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-01-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 319719. ahatanak retitled this revision from "[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR" to "[ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in t

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-01-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak reopened this revision. ahatanak added a comment. This revision is now accepted and ready to land. Address post-commit review comments. - Use operand bundle instead of attribute. - Emit a call to `@llvm.objc.clang.arc.noop.use` in the front-end so that the optimization passes know the c

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-01-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 320001. ahatanak added a comment. Herald added a subscriber: laytonio. Teach `markTails` to ignore operand bundle `clang.arc.rv` when determining whether a call can be marked as tail. `ObjCARCOpt::OptimizeReturn` cannot eliminate the retainRV/autoreleaseRV

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 320663. ahatanak marked 4 inline comments as done. ahatanak added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808 Files: clang/li

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. We could run another pass to clean up the IR after inlining, but I think it's better to do the cleanup right after the callee function is cloned in the caller function. Comment at: llvm/include/llvm/IR/Intrinsics.td:449

[PATCH] D95910: Fix the guaranteed alignment of memory returned by malloc/new on Darwin

2021-02-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, arphaman, ab. ahatanak added a project: clang. Herald added subscribers: ributzka, jkorous. ahatanak requested review of this revision. The guaranteed alignment is 16-bytes on 64-bit Darwin. rdar://73431623 Repository: rG LLV

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 320956. ahatanak marked 3 inline comments as done. ahatanak added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808 Files: clang/li

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 320985. ahatanak added a comment. Add a description of the new bundle to LangRef. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808 Files: clang/lib/CodeGen/CGObjC.cpp

[PATCH] D95910: Fix the guaranteed alignment of memory returned by malloc/new on Darwin

2021-02-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 321251. ahatanak edited the summary of this revision. ahatanak added a comment. Make the alignment 16 bytes on 32-bit systems too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95910/new/ https://reviews.llvm.

[PATCH] D95910: Fix the guaranteed alignment of memory returned by malloc/new on Darwin

2021-02-03 Thread Akira Hatanaka 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 rGaade0ec23b59: Fix the guaranteed alignment of memory returned by malloc/new on Darwin (authored by ahatanak). Repository: rG LLVM Github Monorepo

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-05 Thread Akira Hatanaka 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 rG3fe3946d9a95: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly (authored by ahatanak). Repository: rG LLVM Github Monorepo CHA

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I ended up reverting the changes I made to `llvm/lib/IR/AutoUpgrade.cpp` as the file was including `llvm/Analysis/ObjCARCUtil.h`, which was violating layering. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ http

[PATCH] D110068: [Clang][AST] Resolve FIXME: Remove ObjCObjectPointer from isSpecifierType

2021-09-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a reviewer: rjmccall. ahatanak added a comment. I'm not sure why `ObjCObjectPointerType` was originally a specifier, but this patch looks safe to me. `ObjCObjectPointerType` is never passed to `TypePrinter::printBefore` and `QualType GetBaseType`, which are the two functions that

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I do have a plan to modify the auto upgrader to use the bundles when it's possible to do so, but I'm currently not considering landing the changes I reverted since they were only needed to avoid duplicating constant strings. I don't think we can avoid duplicating the s

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. It looks like there is a pre-existing bug in `replaceUsesOfNonProtoConstant` where the operand bundles of all call sites are accumulated into `newBundles`. This will be fixed if its declaration is moved into the loop body. Also, we found another case of deadargelim cha

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. This patch causes opt to crash when the following IR is compiled: $ cat test.ll @g0 = global i8 zeroinitializer, align 1 define internal i8* @foo() { ret i8* @g0 } define void @test() { %r = call i8* @foo() [ "clang.arc.rv"(i64 1) ] call void (

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 322867. ahatanak added a comment. Fix two bugs which were discovered. - Fix bug in `replaceUsesOfNonProtoConstant`. - Teach SCCP not to replace the return of a "clang.arc.rv" call with a constant. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak reopened this revision. ahatanak added a comment. This revision is now accepted and ready to land. In D92808#2555737 , @dexonsmith wrote: > In D92808#2552354 , @rjmccall wrote: > >> The ultimate code-genera

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 3 inline comments as done. ahatanak added a comment. In D92808#2557634 , @dexonsmith wrote: > In D92808#2555868 , @ahatanak wrote: > >> For example, if SCCP just does a normal RAUW on the following c

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 323107. ahatanak added a comment. Address all review comments except for the ones about the bundle name. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808 Files: clang

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In D92808#2557132 , @fhahn wrote: > Another thing I noticed that there's verifier support missing. I think we > should at least check that only a single `clang.arc.rv` bundle is specified > (https://github.com/llvm/llvm-project/

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 323218. ahatanak retitled this revision from "[ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR" to "[ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retain

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-12 Thread Akira Hatanaka 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 rGed4718eccb12: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of (authored by ahatanak). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR

2021-02-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Thanks! I didn't realize it hadn't been fixed in the patch I committed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92808/new/ https://reviews.llvm.org/D92808 ___ cfe-commits

[PATCH] D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types

2021-02-16 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, theraven. ahatanak added a project: clang. Herald added subscribers: jansvoboda11, dexonsmith, dang, jkorous. ahatanak requested review of this revision. This helps reduce the size of the encoded C++ type strings in the binary. I

[PATCH] D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types

2021-02-16 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. This patch focuses only on reducing the encoded size of classes with template specialization, but if the information about pointed-to types isn't used at all, clang can always emit "^v" for C++ pointer types. Or it might make more sense to base the decision on whether

[PATCH] D96832: [Clang][Attributes] Allow not_tail_called attribute to be applied to virtual function.

2021-02-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In D96832#2569481 , @zequanwu wrote: > In D96832#2568257 , @aaron.ballman > wrote: > >> It was explicitly disallowed in the initial patch: >> https://reviews.llvm.org/D12922 and the origi

[PATCH] D96832: [Clang][Attributes] Allow not_tail_called attribute to be applied to virtual function.

2021-02-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In D96832#2570009 , @zequanwu wrote: > In D96832#2569987 , @ahatanak wrote: > >> In D96832#2569481 , @zequanwu wrote: >> >>> In D96832#2568257

[PATCH] D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types

2021-02-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 324515. ahatanak edited the summary of this revision. ahatanak added a comment. Enable this optimization only on Darwin. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96816/new/ https://reviews.llvm.org/D96816

[PATCH] D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types

2021-02-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 324519. ahatanak added a comment. Upload patch with context. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96816/new/ https://reviews.llvm.org/D96816 Files: clang/include/clang/Basic/LangOptions.def clang

[PATCH] D96832: [Clang][Attributes] Allow not_tail_called attribute to be applied to virtual function.

2021-02-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:4109 - [[clang::not_tail_called]] int foo2() override; -}; }]; Quuxplusone wrote: > (Moving into a thread) > > > This patch doesn't prevent the call to method in the co

<    2   3   4   5   6   7   8   9   10   11   >