[PATCH] D43841: Add an option to disable tail-call optimization for escaping blocks

2018-03-01 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326530: Add an option to disable tail-call optimization for escaping blocks. (authored by ahatanak, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm

[PATCH] D39562: [CodeGen][ObjC] Fix an assertion failure caused by copy elision

2018-03-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 136895. ahatanak added a comment. Add a flag to OpaqeuValueExpr that indicates whether it is a unique reference to its subexpression. If the flag is set, IRGen will avoid binding the OVE and copying the result to the destination and instead just visit the O

[PATCH] D44095: [ObjC] Allow declaring __weak pointer fields in C structs in ObjC-ARC

2018-03-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, doug.gregor, rsmith. This patch makes changes that are needed to allow `__weak` fields in C structs when ARC is enabled. Repository: rC Clang https://reviews.llvm.org/D44095 Files: include/clang/AST/Decl.h include/clang

[PATCH] D39562: [CodeGen][ObjC] Fix an assertion failure caused by copy elision

2018-03-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 137250. ahatanak marked 3 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D39562 Files: include/clang/AST/Expr.h include/clang/AST/Stmt.h lib/CodeGen/CGExpr.cpp lib/CodeGen/CGExprAgg.cpp lib/Co

[PATCH] D39562: [CodeGen][ObjC] Fix an assertion failure caused by copy elision

2018-03-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaPseudoObject.cpp:432 + if (capturedRHS->getType()->getAsCXXRecordDecl() && capturedRHS->isRValue()) +capturedRHS->setIsUnique(); + rjmccall wrote: > I think you can unconditionally set this here, actua

[PATCH] D39562: [CodeGen][ObjC] Fix an assertion failure caused by copy elision

2018-03-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Sorry, this patch is not ready yet. There are several regression tests that are failing because of the assert in setIsUnique. https://reviews.llvm.org/D39562 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://l

[PATCH] D39562: [CodeGen][ObjC] Fix an assertion failure caused by copy elision

2018-03-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 137418. ahatanak marked an inline comment as done. ahatanak added a comment. Don't set the IsUnique bit of an OpaqueValueExpr that is used as the result expression. https://reviews.llvm.org/D39562 Files: include/clang/AST/Expr.h include/clang/AST/Stmt

[PATCH] D39562: [CodeGen][ObjC] Fix an assertion failure caused by copy elision

2018-03-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:4815 +} + } + rjmccall wrote: > Oh! So it's an interesting point that the RHS might be used as the result > expression, which means its use might not really be unique anymore. It > happen

[PATCH] D39562: [CodeGen][ObjC] Fix an assertion failure caused by copy elision

2018-03-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I also add a call to setIsUnique(false) in OpaqueValueExpr's constructor, which fixed the failing tests I was seeing. https://reviews.llvm.org/D39562 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llv

[PATCH] D44095: [ObjC] Allow declaring __weak pointer fields in C structs in ObjC-ARC

2018-03-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 137500. ahatanak marked 2 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D44095 Files: include/clang/AST/Decl.h include/clang/AST/DeclCXX.h include/clang/AST/Type.h lib/AST/ASTImporter.cpp lib

[PATCH] D44095: [ObjC] Allow declaring __weak pointer fields in C structs in ObjC-ARC

2018-03-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/AST/Decl.h:3631 +PassedIndirectly = true; + } + rjmccall wrote: > I feel like this flag should be set by Sema for C++ types that have to be > passed indirectly as well; it can then become the single

[PATCH] D44095: [ObjC] Allow declaring __weak pointer fields in C structs in ObjC-ARC

2018-03-09 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL327206: [ObjC] Allow declaring __weak pointer fields in C structs in ARC. (authored by ahatanak, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.or

[PATCH] D44095: [ObjC] Allow declaring __weak pointer fields in C structs in ObjC-ARC

2018-03-09 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC327206: [ObjC] Allow declaring __weak pointer fields in C structs in ARC. (authored by ahatanak, committed by ). Repository: rC Clang https://reviews.llvm.org/D44095 Files: include/clang/AST/Decl.h

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

2018-03-12 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. The patch got reverted in r325335 as it broke the Chromium build. I'm reopening this review. Repository: rC Clang https://reviews.llvm.org/D36918 ___

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

2018-03-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 138066. ahatanak added a comment. The new patch passes the calling context to CheckNonDependent so that Sema::CheckAddressOfMemberAccess uses the correct context to check accessibility of explicit template arguments. I initially tried moving the declaratio

[PATCH] D44095: [ObjC] Allow declaring __weak pointer fields in C structs in ObjC-ARC

2018-03-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. This was reverted in r327294 because it caused module-enabled builders to fail after I moved CXXRecordDecl::CanPassInRegisters to RecordDecl. I'm recommitting this patch with fixes to ASTDeclReader and ASTWriter. Repository: rC Clang https://reviews.llvm.org/D44095

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

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

[PATCH] D39562: [CodeGen][ObjC] Fix an assertion failure caused by copy elision

2018-03-19 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL327939: [CodeGen] Ignore OpaqueValueExprs that are unique references to their (authored by ahatanak, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llv

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

2018-05-31 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. ping Repository: rC Clang https://reviews.llvm.org/D36918 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2018-05-31 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. It doesn't look like it's possible to get the context needed to do accessibility check (CXXMethodDecl 'method' for 'C::overloadedMethod' in the test case) from 'Expr *OvlExpr' in CheckAddressOfMemberAccess. It's possible to get the class in which the member is defined

[PATCH] D45015: [Preprocessor] Allow libc++ to detect when aligned allocation is unavailable.

2018-06-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D45015#1105388, @rsmith wrote: > In https://reviews.llvm.org/D45015#1105372, @vsapsai wrote: > > > What when compiler has `__builtin_operator_new`, > > `__builtin_operator_delete`? If I build libc++ tests with recent Clang > > which has thes

[PATCH] D45015: [Preprocessor] Allow libc++ to detect when aligned allocation is unavailable.

2018-06-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I think clang should error out or warn when aligned operator or builtin operator new/delete functions are used when they are not available (r306722 should have handled them). I'm also not sure not defining `__cpp_aligned_new` is sufficient. My understanding is that if

[PATCH] D45015: [Preprocessor] Allow libc++ to detect when aligned allocation is unavailable.

2018-06-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Could you elaborate on what kind of changes you are planning to make in libc++ after committing this patch? https://reviews.llvm.org/D45015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-

[PATCH] D45015: [Preprocessor] Allow libc++ to detect when aligned allocation is unavailable.

2018-06-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I see, thank you. clang front-end currently fails to issue a warning or error when an aligned allocation/deallocation functions are required but not available in a few cases (e.g., delete called from a deleting destructor, calls to operator or builtin operator new/del

[PATCH] D47757: [Sema] Diagnose unavailable aligned deallocation functions called from deleting destructors.

2018-06-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rsmith, vsapsai, EricWF, erik.pilkington. Deallocation functions are called from deleting destructors that are declared virtual. Issue an error if an aligned deallocation function is selected but is not available. Repository: rC Clang

[PATCH] D45015: [Preprocessor] Allow libc++ to detect when aligned allocation is unavailable.

2018-06-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D45015#1123097, @EricWF wrote: > In https://reviews.llvm.org/D45015#1121874, @ahatanak wrote: > > > I see, thank you. > > > > clang front-end currently fails to issue a warning or error when an aligned > > allocation/deallocation functions ar

[PATCH] D47757: [Sema] Produce diagnostics when unavailable aligned allocation/deallocation functions are called

2018-06-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 150211. ahatanak marked an inline comment as done. ahatanak retitled this revision from "[Sema] Diagnose unavailable aligned deallocation functions called from deleting destructors." to "[Sema] Produce diagnostics when unavailable aligned allocation/dealloca

[PATCH] D22391: [Sema] Add warning for implicitly casting a null constant to a non null pointer type

2018-06-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 150218. ahatanak marked an inline comment as done. ahatanak added a reviewer: dcoughlin. ahatanak set the repository for this revision to rC Clang. ahatanak added a comment. Sorry for the delay in responding. I've addressed Jordan's review comments. I had to

[PATCH] D22391: [Sema] Add warning for implicitly casting a null constant to a non null pointer type

2018-06-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:7117 +if (E && S.checkNonNullExpr(E)) + return NullabilityKind::Nullable; + jordan_rose wrote: > This isn't quite correct, unfortunately. `(_Nonnull id)nil` should be > considered non-nul

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

2018-06-12 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC334569: [Sema] When the address of a member function is used as a template (authored by ahatanak, committed by ). Changed prior to commit: https://reviews.llvm.org/D36918?vs=148334&id=151102#toc Reposi

[PATCH] D53154: [CodeGen] Handle extern references to OBJC_CLASS_$_*

2018-10-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. LGTM Repository: rC Clang https://reviews.llvm.org/D53154 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D53860: [SemaCXX] Don't check base's dtor is accessible

2018-10-30 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. http://wg21.link/p0968r0#2227 says: The destructor for each element of class type is potentially invoked (15.4 [class.dtor]) from the context where the aggregate initialization occurs. [Note: This provision ensures that destructors can be called for fully-constructed

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

2019-01-29 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rsmith, rjmccall, doug.gregor. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. ObjC pointer members are currently not allowed in unions in either C or C++ mode. This patch lifts the restriction in C++ mode.

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

2019-01-29 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. 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 dele

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

2019-01-29 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. LGTM with one minor nit. Comment at: clang/test/CodeGenObjC/builtin-constant-p.m:1 +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -O3 -o - %s | FileCheck %s + Since this is just testing front-end's IRGen, can you pass `

[PATCH] D54539: [CodeGen] Replace '@' characters in block descriptors' symbol names with '\1' on ELF targets.

2018-11-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: theraven, rjmccall. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. This fixes a bug introduced in r340041 (see the discussion in https://reviews.llvm.org/D50783). '@' can't be used in block descriptors' sy

[PATCH] D54539: [CodeGen] Replace '@' characters in block descriptors' symbol names with '\1' on ELF targets.

2018-11-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D54539#1298949, @rjmccall wrote: > This should not be changing the actual `@`-encoding value. If we want to use > the `@`-encoding in the symbol name, we can change it when naming the symbol, > provided that \1 is not legal in the `@`encodi

[PATCH] D47757: [Sema] Produce diagnostics when unavailable aligned allocation/deallocation functions are called

2018-11-30 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 176214. ahatanak added a comment. Herald added a subscriber: jkorous. Rebase & ping. I've reverted the changes I made to test/SemaCUDA/call-host-fn-from-device.cu since r342749 fixed the overload resolution bug. Repository: rC Clang CHANGES SINCE LAST

[PATCH] D47757: [Sema] Produce diagnostics when unavailable aligned allocation/deallocation functions are called

2018-12-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. ping Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D47757/new/ https://reviews.llvm.org/D47757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/li

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

2019-02-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 188472. ahatanak marked an inline comment as done. ahatanak added a comment. Call `IgnoreParens` on the LHS too. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58514/new/ https://reviews.llvm.org/D58514 Files: include/clan

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

2019-02-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak closed this revision. ahatanak added a comment. Fixed in r355012. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58514/new/ https://reviews.llvm.org/D58514 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-02-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, arphaman. ahatanak added a project: clang. Herald added subscribers: jdoerfert, dexonsmith, jkorous. clang currently emits an expression like `@("abc")` as a message send to `stringWithUTF8String`. This patch makes changes so tha

[PATCH] D58744: [CodeGen] Fix some broken IR generated by -fsanitize=unsigned-integer-overflow

2019-02-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:2921 +atomicPHI->addIncoming(old, curBlock); +Builder.CreateCondBr(success, contBB, atomicOpBB); Builder.SetInsertPoint(contBB); Would passing `atomicPHI->getParent()` ins

[PATCH] D58744: [CodeGen] Fix some broken IR generated by -fsanitize=unsigned-integer-overflow

2019-02-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/test/CodeGen/sanitize-atomic-int-overflow.c:3 + +_Atomic(unsigned) atomic; + ahatanak wrote: > It's probably better to add some check strings here. I see this has been fixed in the updated patch. CHANGES SINCE L

[PATCH] D58744: [CodeGen] Fix some broken IR generated by -fsanitize=unsigned-integer-overflow

2019-02-27 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 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58744/new/ https://reviews.llvm.org/D58744 ___ cfe-commits mailing list cfe-commi

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-02-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: lib/Sema/SemaExprObjC.cpp:534 +NSStringPointer, NSStringPointer); +return new (Context) ObjCBoxedExpr(SL, BoxedType, nullptr, SR); + } rjmccall wrote:

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-02-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 188794. ahatanak marked 4 inline comments as done. ahatanak added a comment. Address review comments. - Preserve sugar when creating an `ObjCBoxedExpr` in `Sema::BuildObjCBoxedExpr`. - Add a test case to test/SemaObjC/boxing-illegal.m that shows clang reject

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-02-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaExprObjC.cpp:534 +NSStringPointer, NSStringPointer); +return new (Context) ObjCBoxedExpr(SL, BoxedType, nullptr, SR); + } rjmccall wrote: > ahatanak wrote: > > rjmccall wrote: > > >

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-03-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 189436. ahatanak marked 2 inline comments as done. ahatanak added a comment. If the string literal used for the boxed expression isn't a valid UTF-8 string, don't emit a compile-time constant. Repository: rC Clang CHANGES SINCE LAST ACTION https://rev

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-03-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: test/SemaObjC/boxing-illegal.m:70 + s = @(L"abc"); // expected-error {{illegal type 'int *' used in a boxed expression}} + s = @("\pabc"); // expected-error {{illegal type 'unsigned char *' used in a boxed expression}} +} --

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-03-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: test/SemaObjC/boxing-illegal.m:70 + s = @(L"abc"); // expected-error {{illegal type 'int *' used in a boxed expression}} + s = @("\pabc"); // expected-error {{illegal type 'unsigned char *'

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-03-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 189630. ahatanak added a comment. Diagnose invalid UTF-8 strings in boxed expressions. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58729/new/ https://reviews.llvm.org/D58729 Files: include/clang/AST/ExprObjC.h include

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-03-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 189657. ahatanak marked 2 inline comments as done. ahatanak added a comment. Improve diagnostic message. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58729/new/ https://reviews.llvm.org/D58729 Files: include/clang/AST/Ex

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-03-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 189809. ahatanak marked an inline comment as done. ahatanak added a comment. Use the type of `NSStringPointer` in the diagnostic string. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58729/new/ https://reviews.llvm.org/D5872

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-03-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:922 +def warn_objc_boxing_invalid_utf8_string : Warning< + "string is ill-formed as UTF-8 and will become a null NSString* when boxed">, + InGroup; rjmccall wrote: > Might as

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-03-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:922 +def warn_objc_boxing_invalid_utf8_string : Warning< + "string is ill-formed as UTF-8 and will become a null NSString* when boxed">, + InGroup;

[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

2019-03-07 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL355662: [ObjC] Emit a boxed expression as a compile-time constant if the (authored by ahatanak, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to comm

[PATCH] D59234: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol metadata and protocol list

2019-03-11 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. The leading 'l' tells ld64 to remove the symbol name, which can make debugging difficult. rdar://problem/47256637 Repository: rC Clang https:/

[PATCH] D59234: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol metadata and protocol list

2019-03-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. There are other symbols that starts with 'l' and have private linkage. I haven't made any changes to those symbols in this patch, but I think it's possible to remove the leading 'l' from those symbols and change the linkage to internal if we want to keep the symbol nam

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

2019-03-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Seems like the chromium code is valid and shouldn't crash. John/Erik what do you think? The following code also crashes with this patch applied. typedef void (^BlockTy)(); BlockTy sb; __weak BlockTy wb; void foo(id a) { auto b = ^{ NSLog(@"foo %@", a);

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

2019-03-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In D58514#1428495 , @dexonsmith wrote: > In D58514#1428434 , @ahatanak wrote: > > > Seems like the chromium code is valid and shouldn't crash. John/Erik what > > do you think? The followin

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

2019-03-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Sorry, I misread the code. If you change the parameter type of `bar` to `BlockTy`, the code crashes. If the type is `id`, it doesn't crash because IRGen copies the block to the heap in `foo` before passing it to `bar`. Repository: rC Clang CHANGES SINCE LAST ACTION

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

2019-03-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Do you mean copying the block to the heap before assigning it to `wb` and releasing it after the assignment inside `bar`? Wouldn't the block assigned to `wb` be deallocated after the release? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D59234: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol metadata and protocol list

2019-03-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Okay, I'll remove the leading 'l' from other symbols and make them internal in a separate patch. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59234/new/ https://reviews.llvm.org/D59234 ___

[PATCH] D59234: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol metadata and protocol list

2019-03-14 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL356156: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol (authored by ahatanak, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to comm

[PATCH] D59656: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue with notail on x86-64

2019-03-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: dexonsmith, jkorous. On x86-64, the epilogue code inserted before the tail jump blocks the autoreleased return optimization. ARC optimizer unconditional

[PATCH] D59656: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue with notail on x86-64

2019-03-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. There are existing test cases that test notail isn't added to calls on targets that aren't x86-64 (for example, test/CodeGenObjC/arc-arm.m), so I didn't write a new one. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59656/new/ https://

[PATCH] D59656: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue with notail on x86-64

2019-03-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 191761. ahatanak marked an inline comment as done. ahatanak added a comment. Rename function. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59656/new/ https://reviews.llvm.org/D59656 Files: lib/CodeGen/CGObjC.cpp lib/Co

[PATCH] D59656: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue with notail on x86-64

2019-03-21 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL356705: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue (authored by ahatanak, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D59873: Add additional mangling for struct members of non trivial structs

2019-03-27 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/D59873/new/ https://reviews.llvm.org/D59873 ___

[PATCH] D60301: [CodeGen][ObjC] Emit the retainRV marker as a module flag instead of named metadata.

2019-04-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: steven_wu, dexonsmith, rjmccall. ahatanak added a project: clang. Herald added a subscriber: jkorous. Repository: rC Clang https://reviews.llvm.org/D60301 Files: lib/CodeGen/CGObjC.cpp test/CodeGenObjC/arc-unsafeclaim.m Index: tes

[PATCH] D60301: [CodeGen][ObjC] Emit the retainRV marker as a module flag instead of named metadata.

2019-04-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak abandoned this revision. ahatanak added a comment. I'll write the summary and send the patch again. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60301/new/ https://reviews.llvm.org/D60301 ___ cfe-commits ma

[PATCH] D60302: [CodeGen][ObjC] Emit the retainRV marker as a module flag instead of named metadata.

2019-04-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: steven_wu, dexonsmith, rjmccall. ahatanak added a project: clang. Herald added subscribers: jkorous, kristof.beyls, javed.absar, mehdi_amini. This fixes a bug which causes the ARC contract pass to not insert the assembly marker that is nee

[PATCH] D60302: [CodeGen][ObjC] Emit the retainRV marker as a module flag instead of named metadata.

2019-04-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Corresponding llvm patch is here: https://reviews.llvm.org/D60303. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60302/new/ https://reviews.llvm.org/D60302 ___ cfe-commits mailing list cfe-c

[PATCH] D60302: [CodeGen][ObjC] Emit the retainRV marker as a module flag instead of named metadata.

2019-04-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. The upgrader rewrites the named metadata into a module flag (see https://reviews.llvm.org/D60303). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60302/new/ https://reviews.llvm.org/D60302 _

[PATCH] D60302: [CodeGen][ObjC] Emit the retainRV marker as a module flag instead of named metadata.

2019-04-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Thanks. Does this require changes to swift too? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60302/new/ https://reviews.llvm.org/D60302 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[PATCH] D60161: Expose non-trivial struct helpers for Swift.

2019-04-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Just one minor comment, but otherwise the patch looks good to me. Comment at: clang/include/clang/CodeGen/CodeGenABITypes.h:92 +llvm::Function *generateNonTrivialCStructDefaultConstructor(CodeGenModule &GCM, +

[PATCH] D60302: [CodeGen][ObjC] Emit the retainRV marker as a module flag instead of named metadata.

2019-04-09 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL358048: [CodeGen][ObjC] Emit the retainRV marker as a module flag instead of (authored by ahatanak, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D60626: [clang] Aligned allocation is actually supported in macosx 10.13

2019-04-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 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60626/new/ https://reviews.llvm.org/D60626 ___

[PATCH] D60736: [Sema][ObjC] Don't warn about a block implicitly retaining self if the block is marked noescape

2019-04-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, erik.pilkington, arphaman. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. If the block implicitly referencing `self` doesn't escape, there is no risk of creating retain cycles, so clang shouldn't

[PATCH] D60736: [Sema][ObjC] Don't warn about a block implicitly retaining self if the block is marked noescape

2019-04-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Sorry, clang was failing to diagnose `self` referenced inside a c++ lambda that was nested inside a block. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60736/new/ https://reviews.llvm.org/D60736 _

[PATCH] D60736: [Sema][ObjC] Don't warn about a block implicitly retaining self if the block is marked noescape

2019-04-16 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 195498. ahatanak added a comment. Keep a list of pairs of BlockDecl and SourceLocation and, after the body of an ObjC method is parsed, emit a diagnostic if a SourceLocation in the list is inside an escaping block. Repository: rC Clang CHANGES SINCE LA

[PATCH] D60736: [Sema][ObjC] Don't warn about a block implicitly retaining self if the block is marked noescape

2019-04-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 195589. ahatanak marked 2 inline comments as done. ahatanak added a comment. Remove a potentially expensive check. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60736/new/ https://reviews.llvm.org/D60736 Files: include/cl

[PATCH] D60736: [Sema][ObjC] Don't warn about a block implicitly retaining self if the block is marked noescape

2019-04-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:2580 +if (const BlockDecl *BD = CurContext->getInnerMostBlockDecl()) + if (!getDiagnostics().isIgnored(diag::warn_implicitly_retains_self, Loc)) +ImplicitlyRetainedSelfLocs.push_back({

[PATCH] D60736: [Sema][ObjC] Don't warn about a block implicitly retaining self if the block is marked noescape

2019-04-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 195601. ahatanak marked an inline comment as done. ahatanak added a comment. Rename function. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60736/new/ https://reviews.llvm.org/D60736 Files: include/clang/AST/DeclBase.h

[PATCH] D60736: [Sema][ObjC] Don't warn about a block implicitly retaining self if the block is marked noescape

2019-04-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 195639. ahatanak added a comment. Diagnose implicitly retained self in `ActOnFinishFunctionBody`. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60736/new/ https://reviews.llvm.org/D60736 Files: include/clang/AST/DeclBase.

[PATCH] D60736: [Sema][ObjC] Don't warn about a block implicitly retaining self if the block is marked noescape

2019-04-17 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL358624: [Sema][ObjC] Don't warn about an implicitly retained self if the (authored by ahatanak, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to comm

[PATCH] D60900: [ObjC][ARC] Check the basic block size before calling DominatorTree::dominate

2019-04-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 195951. ahatanak added a comment. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fix the comment on why we have to check the size of the basic block before calling DominatorTree::dominate to compute the dominance relation between two

[PATCH] D61147: [Sema][ObjC] Add a flavor of -Wunused-parameter that doesn't diagnose unused parameters of ObjC methods

2019-04-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: erik.pilkington, rjmccall. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. The new warning `-Wunused-parameter-non-objc-method` works exactly the same as `-Wunused-parameter ` except for unused parameters of

[PATCH] D61147: [Sema][ObjC] Add a flavor of -Wunused-parameter that doesn't diagnose unused parameters of ObjC methods

2019-04-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In D61147#1479468 , @erik.pilkington wrote: > > Yeah, I tend to think we should just suppress this unconditionally in > > Objective-C. > > IMO this warning still makes sense for normal functions, or methods that are > only decl

[PATCH] D61147: [Sema][ObjC] Add a flavor of -Wunused-parameter that doesn't diagnose unused parameters of ObjC methods

2019-04-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Yes, I guess we can make `-Wunused-parameter ` cover unused parameters of pure @implementation methods too since users can probably just remove them to silence the warning. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61147/new/ https

[PATCH] D61147: [Sema][ObjC] Disable -Wunused-parameter for ObjC methods

2019-04-30 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 197469. ahatanak retitled this revision from "[Sema][ObjC] Add a flavor of -Wunused-parameter that doesn't diagnose unused parameters of ObjC methods" to "[Sema][ObjC] Disable -Wunused-parameter for ObjC methods". ahatanak edited the summary of this revision

[PATCH] D61147: [Sema][ObjC] Disable -Wunused-parameter for ObjC methods

2019-04-30 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In D61147#1479932 , @rjmccall wrote: > I would also recommend that you go fix the warning to never fire on virtual > C++ methods. I tried building clang/llvm with -Wunused-parameter turned on and there are lots of places wher

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

2019-05-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, vsk. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. This change is a continuation of https://reviews.llvm.org/D59234 and makes the symbols within __DATA visible. rdar://problem/48887111 Reposit

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

2019-05-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CGObjCMac.cpp:1978 +? llvm::GlobalVariable::InternalLinkage +: llvm::GlobalValue::PrivateLinkage); // FIXME. Fix section. rj

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

2019-05-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 197877. ahatanak marked 6 inline comments as done. ahatanak edited the summary of this revision. ahatanak added a comment. Address review comments. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61454/new/ https://reviews.llv

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

2019-05-02 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:3961 + // linkage so that the linker preserves the symbol name. + llvm::GlobalValue::LinkageTypes LT = ExplicitDataSegment || Section.empty() +

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

2019-05-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 197918. ahatanak marked 2 inline comments as done. ahatanak added a comment. - Instead of passing a flag to `CreateMetadataVar` that indicates the section is in segment `__DATA`, just scan the section name string inside `CreateMetadataVar`. - Fix test case

[PATCH] D61147: [Sema][ObjC] Disable -Wunused-parameter for ObjC methods

2019-05-03 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL359864: [Sema][ObjC] Disable -Wunused-parameter for ObjC methods (authored by ahatanak, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: ht

[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 2 inline comments as done. ahatanak added inline comments. Comment at: lib/CodeGen/CGObjCMac.cpp:3961 + // linkage so that the linker preserves the symbol name. + llvm::GlobalValue::LinkageTypes LT = + Section.empty() || Section.startswith("__DATA") ---

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