[PATCH] D61454: [CodeGen][ObjC] Remove the leading 'l_' from ObjC symbols and make private symbols in the __DATA segment internal.

2019-05-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: lib/CodeGen/CGObjCMac.cpp:7266 + false, + CGM.getTriple().isOSBinFormatMachO() +

[PATCH] D61454: [CodeGen][ObjC] Remove the leading 'l_' from ObjC symbols and make private symbols in the __DATA segment internal.

2019-05-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 198118. ahatanak added a comment. Make sure private linkage is replaced with internal linkage only when the object file format is MachO. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61454/new/ https://reviews.llvm.org/D614

[PATCH] D61454: [CodeGen][ObjC] Remove the leading 'l_' from ObjC symbols and make private symbols in the __DATA segment internal.

2019-05-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 198581. ahatanak marked an inline comment as done. ahatanak added a comment. Define helper function `getLinkageTypeForObjCMetadata`. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61454/new/ https://reviews.llvm.org/D61454 F

[PATCH] D61667: Assume `__cxa_allocate_exception` returns an under-aligned memory on Darwin if the version of libc++abi isn't new enough to include the fix in r319123

2019-05-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, ldionne. ahatanak added a project: clang. Herald added a reviewer: EricWF. Herald added subscribers: dexonsmith, jkorous. This patch resurrects r264998, which was committed to work around a bug in libc++abi that was causing `_cxa

[PATCH] D61667: Assume `__cxa_allocate_exception` returns an under-aligned memory on Darwin if the version of libc++abi isn't new enough to include the fix in r319123

2019-05-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: include/clang/Basic/AlignedExceptionObject.h:31 + case llvm::Triple::MacOSX: // Earliest supporting version is 10.14. +return llvm::VersionTuple(10U, 14U); + case llvm::Triple::IOS: -

[PATCH] D61667: Assume `__cxa_allocate_exception` returns an under-aligned memory on Darwin if the version of libc++abi isn't new enough to include the fix in r319123

2019-05-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 198716. ahatanak marked 3 inline comments as done. ahatanak edited the summary of this revision. ahatanak added a comment. Move the code that was in `AlignedExceptionObject.h` to `getExnObjectAlignment` and remove the header. Repository: rC Clang CHANGE

[PATCH] D61454: [CodeGen][ObjC] Remove the leading 'l_' from ObjC symbols and make private symbols in the __DATA segment internal.

2019-05-09 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC360359: [CodeGen][ObjC] Remove the leading `l_` from ObjC symbols and make (authored by ahatanak, committed by ). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61454/new/

[PATCH] D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC

2019-01-31 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: test/SemaObjCXX/arc-0x.mm:164 +union { + union { // expected-note 2 {{'S1' is implicitly deleted because variant field '' has a non-trivial}} expected-note 4 {{'S1' is implicitly deleted because field '' has a deleted}} +

[PATCH] D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC

2019-01-31 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 184665. 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/D57438/new/ https://reviews.llvm.org/D57438 Files: include/clang/Basic/Dia

[PATCH] D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC

2019-02-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 2 inline comments as done. ahatanak added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:7084 + if (FD->getParent()->isUnion() && + shouldDeleteForVariantObjCPtrMember(FD, FieldType)) rjmccall wrote: > rjmccall wrote: > > I believe

[PATCH] D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC

2019-02-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 184851. ahatanak marked an inline comment as done. ahatanak added a comment. Add a test case for an anonymous struct nested inside an anonymous union. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57438/new/ https://reviews.

[PATCH] D57626: Disallow trivial_abi on a class if all copy and move constructors are deleted

2019-02-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rsmith, rjmccall, aaron.ballman. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. Instead of forcing the class to be passed in registers, which was what r350920 did, issue a warning and inform the user that t

[PATCH] D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC

2019-02-01 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. ahatanak marked an inline comment as done. Closed by commit rC352949: [Sema][ObjC] Allow declaring ObjC pointer members with non-trivial (aut

[PATCH] D57626: Disallow trivial_abi on a class if all copy and move constructors are deleted

2019-02-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 185157. ahatanak added a comment. Add a note diagnostic to inform the user of the reason for not allowing annotating a class with `trivial_abi`. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57626/new/ https://reviews.llvm.

[PATCH] D57626: Disallow trivial_abi on a class if all copy and move constructors are deleted

2019-02-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 2 inline comments as done. ahatanak added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2953 + "have bases of non-trivial class types|have virtual bases|" + "have __weak fields under ARC|have fields of non-trivial class types}0">; ---

[PATCH] D55659: [Sema][ObjC] Disallow non-trivial C struct fields in unions

2019-02-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak planned changes to this revision. ahatanak added a comment. This patch is unnecessarily complicated and is not correct. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55659/new/ https://reviews.llvm.org/D55659 __

[PATCH] D55659: [Sema][ObjC] Disallow non-trivial C struct fields in unions

2019-02-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 185466. ahatanak added a comment. Make sure that volatile trivial fields in a struct don't cause Sema to emit a diagnostic. Simplify the code in `Sema::ActOnFields` . Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55659/new/

[PATCH] D55659: [Sema][ObjC] Disallow non-trivial C struct fields in unions

2019-02-07 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. ahatanak marked 2 inline comments as done. Closed by commit rL353459: [Sema][ObjC] Disallow non-trivial C struct fields in unions. (authored by ahatanak, committed by ). Herald added a project: LLVM. Herald added a subscribe

[PATCH] D57427: [CodeGen][ObjC] Fix assert on calling `__builtin_constant_p` with ObjC objects.

2019-02-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57427/new/ https://reviews.llvm.org/D57427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[PATCH] D57626: Disallow trivial_abi on a class if all copy and move constructors are deleted

2019-02-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 186083. ahatanak marked 4 inline comments as done. ahatanak added a comment. Improve diagnostic messages. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57626/new/ https://reviews.llvm.org/D57626 Files: include/clang/Basic

[PATCH] D57626: Disallow trivial_abi on a class if all copy and move constructors are deleted

2019-02-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2953 + "have bases of non-trivial class types|have virtual bases|" + "have __weak fields under ARC|have fields of non-trivial class types}0">; Quuxplusone wrote: > ahatanak

[PATCH] D58164: Block+lambda: allow reference capture

2019-02-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. The code is crashing here because the loop in `computeBlockInfo` is trying to capture a variable that is captured by reference by the enclosing lambda as if it were captured by value. This is the type of VT: LValueReferenceType 0x1138008c0 'struct derp &' `-RecordT

[PATCH] D58164: Block+lambda: allow reference capture

2019-02-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I think the root of the problem is that `BlockDecl` knows the captured variable but doesn't know the type of the capture. The type of the variable and the type of the capture can be different if the block is nested inside a lambda or another block, which is why `CI.has

[PATCH] D58164: Block+lambda: allow reference capture

2019-02-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. Sorry, I was misunderstanding the problem. I was trying to understand why the crash goes away if I change the generic lambda to a non-generic one. What I found was that, when the lambda is

[PATCH] D58164: Block+lambda: allow reference capture

2019-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak requested changes to this revision. ahatanak added a comment. This revision now requires changes to proceed. Sorry, I didn't mean to accept this yet. I think this is something that is better fixed in Sema. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58

[PATCH] D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap

2019-02-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, erik.pilkington. ahatanak added a project: clang. Herald added subscribers: jdoerfert, dexonsmith, jkorous. This patch avoids copying blocks that initialize or are assigned to local auto variables to the heap when the local auto

[PATCH] D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap

2019-02-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. For assignment, the optimization isn't performed if the local variable isn't declared in the scope that introduced the block (see the code and comment in SemaExpr.cpp). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58514/new/ https://r

[PATCH] D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap

2019-02-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 187904. ahatanak added a comment. Remove the code that is needed to check whether the address of a local variable is taken. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58514/new/ https://reviews.llvm.org/D58514 Files:

[PATCH] D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap

2019-02-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 187998. ahatanak marked 3 inline comments as done. ahatanak added a comment. Address review comments. Add CodeGen test cases for parentheses expressions. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58514/new/ https://revie

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

2017-08-28 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] D36915: [Sema] Diagnose local variables and parameters captured by lambda and block expressions in a default argument

2017-08-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. clang currently rejects "void foo(int = a);" and so does gcc. I'm trying to search the defect reports, but it looks like the c++ standard's site is currently unreachable. https://reviews.llvm.org/D36915 ___ cfe-commits m

[PATCH] D37322: [Sema] Correct typos in LHS, RHS before building a binop expression.

2017-09-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Is it possible to avoid creating CXXDependentScopeMemberExpr in the first place? It seems to me that we shouldn't be creating a CXXDependentScopeMemberExpr for an ObjC property access. Or perhaps there are reasons to type-correct it later? https://reviews.llvm.org/D3

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

2017-09-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 114753. ahatanak added a comment. Address review comments. - Detect invalid references to parameters or local variables by default arguments in tryCaptureVariable. Before parsing or instantiating the default argument expression, the enclosing DeclContext i

[PATCH] D37777: [Driver] Disable uwtable by default in -ffreestanding mode

2017-09-12 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 https://reviews.llvm.org/D3 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D37322: [Sema] Correct typos in LHS, RHS before building a binop expression.

2017-09-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I was thinking about correcting the typo in Sema::ActOnMemberAccessExpr before checking whether Base is dependent. Doing so would cause BuildMemberReferenceExpr to be called instead of ActOnDependentMemberExpr. I thought that would be a simpler approach, but I'm actual

[PATCH] D37322: [Sema] Correct typos in LHS, RHS before building a binop expression.

2017-09-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. I see. It looks like there is an ambiguity between 'new_anotation' and 'new_annotations' that can't be resolved in ActOnMemberAccessExpr because they have the same distance from 'new_annot

[PATCH] D32520: Support __fp16 vectors

2017-09-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 115304. ahatanak added a comment. Rebase. https://reviews.llvm.org/D32520 Files: include/clang/Sema/Sema.h lib/CodeGen/CGExprScalar.cpp lib/Sema/SemaExpr.cpp test/CodeGen/fp16vec-ops.c test/Sema/fp16vec-sema.c Index: test/Sema/fp16vec-sema.c ===

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

2017-09-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 115432. ahatanak added a comment. Address review comments. The new patch defines a new function "mergeExtParameterInfo" that merges two functions' ExtParameterInfo lists and uses it where previously doFunctionTypesMatchOnExtParameterInfos was used. https

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

2017-09-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:7251 +if (const auto *rhproto = dyn_cast(rhptee)) + rhptee = S.removeNoEscapeFromFunctionProto(lhproto, rhproto); + rjmccall wrote: > ahatanak wrote: > > rjmccall wrote: > > > I think the

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

2017-09-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. ping https://reviews.llvm.org/D36915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32520: Support __fp16 vectors

2017-09-19 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL313720: Add support for attribute 'noescape'. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D32520?vs=115304&id=115964#toc Repository: rL LLVM https://reviews.llvm.org/D3

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

2017-09-19 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL313722: Add support for attribute 'noescape'. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D32210?vs=115432&id=115965#toc Repository: rL LLVM https://reviews.llvm.org/D3

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

2017-09-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak reopened this revision. ahatanak added a comment. Reopening this review. I accidentally closed this review when I committed r313717 (the patch that adds support for 'noescape'). Repository: rL LLVM https://reviews.llvm.org/D32210 ___ cf

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

2017-09-19 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. This one can be closed. Repository: rL LLVM https://reviews.llvm.org/D32210 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http:/

[PATCH] D32520: Support __fp16 vectors

2017-09-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak reopened this revision. ahatanak added a comment. Reopening this review. I accidentally closed this review when I committed r313717 (the patch that adds support for 'noescape'). Repository: rL LLVM https://reviews.llvm.org/D32520 ___ cf

[PATCH] D32520: Support __fp16 vectors

2017-09-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 115966. ahatanak added a comment. Upload the rebased patch again. https://reviews.llvm.org/D32520 Files: include/clang/Sema/Sema.h lib/CodeGen/CGExprScalar.cpp lib/Sema/SemaExpr.cpp test/CodeGen/fp16vec-ops.c test/Sema/fp16vec-sema.c Index: test

[PATCH] D38118: [CodeGen][ObjC] Build the global block structure before emitting the body of global block invoke functions

2017-09-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. This patch fixes an infinite loop in IRGen that occurs when compiling the following code: void FUNC2() { static void (^const block1)(int) = ^(int a){ if (a--) block1(a); }; When IRGen visits the call to "block1", it knows that it alway

[PATCH] D38009: [Sema] Fix using old initializer during switch statement transformation.

2017-09-20 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. I think this is correct. https://reviews.llvm.org/D38009 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

[PATCH] D32520: Support __fp16 vectors

2017-09-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CGExprScalar.cpp:1042 +} + +assert(SrcElementTy->isFloatingPointTy() && bruno wrote: > What happens if the SrcElementTy is float and DstElementTy isn't? Seems like > it will hit the assertion below.

[PATCH] D32520: Support __fp16 vectors

2017-09-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 116275. ahatanak marked 8 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D32520 Files: lib/CodeGen/CGExprScalar.cpp lib/Sema/SemaExpr.cpp test/CodeGen/fp16vec-ops.c test/Sema/fp16vec-sema.c Ind

[PATCH] D38118: [CodeGen][ObjC] Build the global block structure before emitting the body of global block invoke functions

2017-09-25 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314029: [CodeGen][ObjC] Build the global block structure before emitting the (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D38118?vs=116135&id=116524#toc Repository: rL LL

[PATCH] D32520: Support __fp16 vectors

2017-09-25 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314056: Promote storage-only __fp16 vector operands to float vectors. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D32520?vs=116275&id=116533#toc Repository: rL LLVM htt

[PATCH] D62643: [CodeGen][ObjC] Convert '[self alloc]' in a class method to 'objc_alloc(self)'

2019-05-29 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, pete, erik.pilkington. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. In a class method, 'self' points to the class object, so it should be safe to pass it to `objc_alloc`. Also, convert '[[self a

[PATCH] D62645: [Sema] Resolve placeholder types before type deduction to silence spurious `-Warc-repeated-use-of-weak` warnings

2019-05-29 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rsmith, rjmccall. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. The spurious `-Warc-repeated-use-of-weak` warnings are issued when an initializer expression uses a weak ObjC pointer. My first attempt to s

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, erik.pilkington, pete, gottesmm. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. This is needed to enable the optimization in this patch: https://reviews.llvm.org/D62433 Repository: rC Clang h

[PATCH] D62643: [CodeGen][ObjC] Convert '[self alloc]' in a class method to 'objc_alloc(self)'

2019-06-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 202821. ahatanak marked an inline comment as done. ahatanak added a comment. Just set `isClassMessage` instead of passing a separate flag to `tryGenerateSpecializedMessageSend`. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D62643: [CodeGen][ObjC] Convert '[self alloc]' in a class method to 'objc_alloc(self)'

2019-06-04 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. ahatanak marked 2 inline comments as done. Closed by commit rL362521: [CodeGen][ObjC] Convert '[self alloc]' in a class method to a call to (authored by ahatanak, committed by ). Herald added a project: LLVM. Herald added a

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 2 inline comments as done. ahatanak added inline comments. Comment at: test/CodeGenObjC/local-static-block.m:59-60 // CHECK-LABEL-LP64: define void @FUNC2( // CHECK: define internal void @_block_invoke{{.*}}( // CHECK: call void %{{.*}}(i8* bitcast ({ i8**, i32

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 203247. ahatanak marked 5 inline comments as done. ahatanak added a comment. Address review comments. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62831/new/ https://reviews.llvm.org/D62831 Files: lib/CodeGen/CGBlocks.cp

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: test/CodeGenObjC/local-static-block.m:5 +// CHECK: @{{.*}} = internal constant { i8**, i32, i32, i8*, %struct.__block_descriptor* } { i8** @_NSConcreteGlobalBlock, i32 1342177280, i32 0, i8* bitcast (%0* (i8*, %0*, i64)* @{{.*}} to

[PATCH] D62988: Add an attribute to allow fields of non-trivial types in C unions

2019-06-06 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: dexonsmith, jkorous. clang currently disallows fields of non-trivial types (e.g., `__strong`) in unions in C mode since it's not possible for the compiler to determine h

[PATCH] D62988: Add an attribute to allow fields of non-trivial types in C unions

2019-06-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In D62988#1537082 , @rjmccall wrote: > Does this lead to C/C++ ABI mismatches? Should we just honor this in C++ as > well by ignoring it when deciding to delete special members? Is taking such > a general name a good idea if i

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I agree. Something like `arc_inert` is probably a better name in this case for the reason you mentioned. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62831/new/ https://reviews.llvm.org/D62831 ___

[PATCH] D62988: Add an attribute to allow fields of non-trivial types in C unions

2019-06-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In D62988#1538577 , @rsmith wrote: > How do you write correct (non-leaking, non-double-freeing, > non-releasing-invalid-pointers) code with this attribute? For example, > suppose I have a `__strong` union member: does storing to

[PATCH] D62988: Add an attribute to allow fields of non-trivial types in C unions

2019-06-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. John and I had a discussion offline and decided that we should not pursue the approach taken in this patch. I'll try to work on a patch that follows the C++11 approach when I have time later. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D62831: [CodeGen][ObjC] Add attribute "objc_arc_intert" to ObjC globals that are retain-agnostic

2019-06-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 204705. ahatanak retitled this revision from "[CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic" to "[CodeGen][ObjC] Add attribute "objc_arc_intert" to ObjC globals that are retain-agnostic". Repository: rC Clan

[PATCH] D62831: [CodeGen][ObjC] Add attribute "objc_arc_intert" to ObjC globals that are retain-agnostic

2019-06-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. There are many attributes that start with `objc_` including `objc_arc_weak_reference_unavailable`. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62831/new/ https://reviews.llvm.org/D62831 _

[PATCH] D62831: [CodeGen][ObjC] Add attribute "objc_arc_intert" to ObjC globals that are retain-agnostic

2019-06-14 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL363467: [CodeGen][ObjC] Annotate retain-agnostic ObjC globals with attribute (authored by ahatanak, committed by ). Herald

[PATCH] D58164: Block+lambda: allow reference capture

2019-06-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 204882. ahatanak added a comment. - Add another test case which has a block nested inside a lambda and causes clang to crash. - Fix the capture type passed to `addCapture` in `RebuildLambdaScopeInfo`. Repository: rC Clang CHANGES SINCE LAST ACTION htt

[PATCH] D58164: Block+lambda: allow reference capture

2019-06-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I think I now have a better idea of what's causing the crash in IRGen. The root of the problem is that, when `RebuildLambdaScopeInfo` is called to rebuild the scope info for the generic lambda, the type of the captured variable (`s` in `test2` and `test3` in `test/Cod

[PATCH] D58164: Block+lambda: allow reference capture

2019-06-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a reviewer: rsmith. ahatanak added a comment. Richard, could you shed light on why it's done this way? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58164/new/ https://reviews.llvm.org/D58164 ___ cfe-c

[PATCH] D62645: [Sema] Resolve placeholder types before type deduction to silence spurious `-Warc-repeated-use-of-weak` warnings

2019-06-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaDecl.cpp:11101 + if (auto *placeholderType = Init->getType()->getAsPlaceholderType()) +if (placeholderType->getKind() == BuiltinType::PseudoObject) { + Res = CheckPlaceholderExpr(Init).get(); -

[PATCH] D62645: [Sema] Resolve placeholder types before type deduction to silence spurious `-Warc-repeated-use-of-weak` warnings

2019-06-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 204889. 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/D62645/new/ https://reviews.llvm.org/D62645 Files: include/clang/Sema/Sema

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-07-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 209565. ahatanak marked an inline comment as done. ahatanak added a comment. Diagnose C union globals that are non-trivial to default-initialize. Add 3 bits to RecordDeclBitfields for default-initialize, destruct, and copy to fast-path checking. Repositor

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-07-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaDecl.cpp:12053 +NTCUC_UninitAutoVar); } + rjmccall wrote: > ahatanak wrote: > > rjmccall wrote: > > > Please add a comment explaining why this is specific to local variables

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-07-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 209622. ahatanak marked 3 inline comments as done. ahatanak added a comment. Improve comments. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63753/new/ https://reviews.llvm.org/D63753 Files: include/clang/AST/Decl.h inc

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-07-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 209626. ahatanak added a comment. In Type.h, move method declarations down and mention that the predicates imply the associated basic non-triviality predicates. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63753/new/ https

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-07-12 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL365985: [Sema] Diagnose default-initialization, destruction, and copying of (authored by ahatanak, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to c

[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-07-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, jordan_rose. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous, mehdi_amini. r365985 stopped marking those fields as unavailable, which caused the union's NonTrivialToPrimitive* bits to be set to true

[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-07-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: lib/Sema/SemaDecl.cpp:16379 + !getLangOpts().CPlusPlus && !FD->hasAttr() && + !FD->getType()->getAs()) { + // For backward compatibility, fields of C unions dec

[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-07-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 211663. ahatanak marked an inline comment as done. ahatanak added a comment. Check that the attributed type is an ObjC qualified type. Do not diagnose fields that are unavailable. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.or

[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-07-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 211778. ahatanak added a comment. Mark fields that don't have an explicit `__strong` qualifier as unavailable. 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-07-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: test/SemaObjC/Inputs/non-trivial-c-union.h:10 + _Nonnull id f1; + __weak id f2; +} U0_SystemHeader; Rather than making an exception for explicit `__strong` fields, should we

[PATCH] D58164: Block+lambda: allow reference capture

2019-07-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 212016. ahatanak added a comment. Rebase. I think the fix is correct. When the lambda expression for the generic lambda is built, `BuildLambdaExpr` passes a `Capture` object in `LambdaScopeInfo::Captures` to `BuildCaptureField` to build the closure class

[PATCH] D65407: Don't parse elements of extended vectors as template names

2019-07-29 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rsmith. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. This patch attempts to fix the bug introduced in r360308, which is causing clang to reject the following piece of code: typedef __attribute__((__ex

[PATCH] D64464: [CodeGen] Emit destructor calls for non-trivial C structs

2019-08-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 212942. ahatanak marked 2 inline comments as done. ahatanak added a comment. Herald added a reviewer: martong. Herald added a reviewer: shafik. - Emit member access, compound literal, and call expressions as subexpressions of `ExprWithCleanups` if the expres

[PATCH] D64464: [CodeGen] Emit destructor calls for non-trivial C structs

2019-08-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:4647 +pushDestroy(QualType::DK_nontrivial_c_struct, RV.getAggregateAddress(), +E->getType()); + rjmccall wrote: > Does `EmitCallExpr`

[PATCH] D66094: [CodeGen] Emit destructor calls for non-trivial C structs returned by function calls and loaded from volatile objects

2019-08-12 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: llvm-commits, dexonsmith, jkorous. Herald added a project: LLVM. This is the patch I split out of https://reviews.llvm.org/D64464. The cleanup is pushed in `EmitCallExpr

[PATCH] D66094: [CodeGen] Emit destructor calls for non-trivial C structs returned by function calls and loaded from volatile objects

2019-08-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 214660. ahatanak added a comment. Revert changes I made to llvm that are unrelated to this patch. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66094/new/ https://reviews.llvm.org/D66094 Files: clang/include/clang/Sema/Se

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-06-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, rsmith. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. This patch diagnoses uses of non-trivial C unions in the following contexts: - function parameters - function returns - variables with automa

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-06-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak planned changes to this revision. ahatanak added a comment. This patch should diagnose lvalue-to-rvalue conversion of volatile non-trivial C unions too, but it currently doesn't. void test(volatile union U0 *a) { (void)*a; } Repository: rC Clang CHANGES SINCE LAST ACTION

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-06-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 2 inline comments as done. ahatanak added inline comments. Comment at: include/clang/Sema/Sema.h:2126 +NTCUC_AutoVar, +// Initializer expression for object with automatic storage duration. +NTCUC_AutoObjInit, rjmccall wrote: > Please e

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-06-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 206995. ahatanak marked 7 inline comments as done. ahatanak added a comment. Address review comments. Diagnose lvalue-to-rvalue conversion of volatile non-trivial C types. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63753/

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-06-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:633 + "capture a variable of type %1}3 " + "since it %select{contains a union that |}2is non-trivial to " + "%select{default-initialize|destruct|copy}0">; rjmccall wrote: >

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-06-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:16218 +checkNonTrivialCUnion(E->getType(), E->getExprLoc(), + Sema::NTCUC_LValueToRValueVolatile); + rjmccall wrote: > It loo

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-06-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:16218 +checkNonTrivialCUnion(E->getType(), E->getExprLoc(), + Sema::NTCUC_LValueToRValueVolatile); + rjmccall wrote: > ahatan

[PATCH] D58164: Block+lambda: allow reference capture

2019-06-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Currently a block captures a variable (POD or non-POD) by reference if the enclosing lambda captures it by reference and captures by copy if the enclosing lambda captures by copy. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58164/new/

[PATCH] D62645: [Sema] Resolve placeholder types before type deduction to silence spurious `-Warc-repeated-use-of-weak` warnings

2019-06-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 207166. ahatanak marked an inline comment as done. ahatanak added a comment. Add function `Expr::hasNonOverloadPlaceholderType`. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62645/new/ https://reviews.llvm.org/D62645 Files

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-07-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:16218 +checkNonTrivialCUnion(E->getType(), E->getExprLoc(), + Sema::NTCUC_LValueToRValueVolatile); + rjmccall wrote: > ahatan

[PATCH] D63753: [Sema] Instead of rejecting C unions with non-trivial fields, detect attempts to destruct/initialize/copy them.

2019-07-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 207600. ahatanak added a comment. Call `hasNonTrivialPrimitiveCStruct` to check whether the type is a non-trivial C struct/union before calling `checkNonTrivialCUnion`. Fix comments. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.

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