Re: [PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-15 Thread Akira Hatanaka via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:7007 @@ +7006,3 @@ +/// expression. +static QualType modifyNullability(QualType ResTy, Expr *RHSExpr, + ASTContext &Ctx) { doug.gregor wrote: > This name could be im

Re: [PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-14 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 64077. ahatanak added a comment. Remove unused variable. https://reviews.llvm.org/D22392 Files: lib/Sema/SemaExpr.cpp test/Sema/nullability.c Index: test/Sema/nullability.c === --- test/S

[PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-14 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: doug.gregor. ahatanak added a subscriber: cfe-commits. Currently clang issues a warning when the following code using a shorthand form of the conditional operator is compiled: $ cat test1.c ``` void foo() { int * _Nullable p0; int *

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

2016-07-14 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: doug.gregor. ahatanak added a subscriber: cfe-commits. This patch makes clang issue a warning when a null constant is used in a context where a non null expression is expected. For example: ``` int * _Nonnull p0 = 0; // warning expected

Re: [PATCH] D21453: Add support for attribute "overallocated"

2016-07-11 Thread Akira Hatanaka via cfe-commits
ahatanak added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2170 @@ +2169,3 @@ + "'flexible_array' attribute only applies to %select{" + "the last member of a struct|members of structs or classes|" + "fixed sized array members|array members that have

Re: [PATCH] D21453: Add support for attribute "overallocated"

2016-07-11 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 63596. ahatanak added a comment. Change diagnostic messages. http://reviews.llvm.org/D21453 Files: include/clang/AST/Decl.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/

Re: [PATCH] D21515: Update clang for D21514. NFC

2016-07-08 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. Assuming http://reviews.llvm.org/D21514 will get accepted, this looks find to me. http://reviews.llvm.org/D21515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

Re: [PATCH] D21453: Add support for attribute "overallocated"

2016-07-08 Thread Akira Hatanaka via cfe-commits
ahatanak marked 7 inline comments as done. Comment at: include/clang/AST/Decl.h:3249 @@ -3248,1 +3248,3 @@ + /// This is true if this struct ends with an array marked 'flexible_array'. + bool HasFlexibleArrayAttr : 1; Probably it can be looked up although it w

Re: [PATCH] D21453: Add support for attribute "overallocated"

2016-07-08 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 63299. ahatanak added a comment. Address review comments. http://reviews.llvm.org/D21453 Files: include/clang/AST/Decl.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Att

Re: [PATCH] D15075: No error for conflict between inputs\outputs and clobber list

2016-07-01 Thread Akira Hatanaka via cfe-commits
ahatanak added inline comments. Comment at: include/clang/Basic/TargetInfo.h:585 @@ +584,3 @@ + StringRef + TargetInfo::getNormalizedGCCRegisterName(StringRef Name, + bool ReturnCannonical = false) const; This gives bui

Re: [PATCH] D21453: Add support for attribute "overallocated"

2016-07-01 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 62560. ahatanak added a comment. The new patch defines a new attribute "flexible_array", which gets attached to the last array member of a struct. I made changes to clang to treat arrays marked "flexible_array" as C99's flexible array members where it made

r274190 - Use the same type for adjacent bit field members.

2016-06-29 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Wed Jun 29 19:07:17 2016 New Revision: 274190 URL: http://llvm.org/viewvc/llvm-project?rev=274190&view=rev Log: Use the same type for adjacent bit field members. MSVC doesn't pack the bit field members if different types are used. This came up in a patch review. http://lis

Re: [PATCH] D20334: [libcxx] Fix a bug in strstreambuf::overflow

2016-06-29 Thread Akira Hatanaka via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL274132: [libcxx] Fix a bug in strstreambuf::overflow. (authored by ahatanak). Changed prior to commit: http://reviews.llvm.org/D20334?vs=58740&id=62225#toc Repository: rL LLVM http://reviews.llvm.or

[libcxx] r274132 - [libcxx] Fix a bug in strstreambuf::overflow.

2016-06-29 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Wed Jun 29 10:26:13 2016 New Revision: 274132 URL: http://llvm.org/viewvc/llvm-project?rev=274132&view=rev Log: [libcxx] Fix a bug in strstreambuf::overflow. The end pointer should point to one past the end of the newly allocated buffer. rdar://problem/24265174 Differenti

Re: [PATCH] D21453: Add support for attribute "overallocated"

2016-06-28 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. I think you are right. There are other places that need to be fixed to properly support over-allocated structures. I'll see if I can come up with a patch that treats the over-allocated array as flexible array member. http://reviews.llvm.org/D21453 _

Re: [PATCH] D14471: [AArch64] Fix a crash in driver

2016-06-27 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. Sorry for not replying for a long time. I'll get back to this soon. http://reviews.llvm.org/D14471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D21453: Add support for attribute "overallocated"

2016-06-23 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 61743. ahatanak added a comment. Address review comments and change the wording in AttrDocs.td to explain what the attribute means and how it is used. Also, fixed the code in VisitMemberExpr to set LValue::OverAllocated before the base class of the member e

Re: [PATCH] D21453: Add support for attribute "overallocated"

2016-06-17 Thread Akira Hatanaka via cfe-commits
ahatanak added inline comments. Comment at: include/clang/Basic/AttrDocs.td:2073-2079 @@ +2072,9 @@ + let Content = [{ +Use ``overallocated`` to indicate a struct or union is over-allocated. For example, + +.. code-block:: c++ + +struct S { + char a[4], char b[4]; +} __attribut

Re: [PATCH] D21453: Add support for attribute "overallocated"

2016-06-17 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 61145. ahatanak added a comment. Fix a bug in tryEvaluateBuiltinObjectSize. If the pointer passed to __builtin_object_size doesn't point to an array, it should be able to compute the exact size of the subobject the pointer points to. Therefore, it should be

[PATCH] D21453: Add support for attribute "overallocated"

2016-06-16 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rsmith, george.burgess.iv, aaron.ballman. ahatanak added subscribers: cfe-commits, dexonsmith, hfinkel. This patch adds support for attribute "overallocated", which will be used to indicate a union or struct is over-allocated. This is need

Re: [PATCH] D21187: Allow use of lambda expressions in array bounds

2016-06-15 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. Sorry for my late reply. Comment at: lib/Sema/SemaExpr.cpp:12825 @@ -12824,1 +12824,3 @@ + // BlockContext. + } else if (!Rec.IsArrayBound) { // C++1y [expr.const]p2: rsmith wrote: > This isn't correct; you still need

[PATCH] D21187: Allow use of lambda expressions in array bounds

2016-06-09 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a subscriber: cfe-commits. clang currently errors out when a lambda expression is used to compute the size of an array even though clang supports variable-length arrays as a C99 extension. For example, $ cat vla1.cpp ``` int foo3(); struct S1 {

[PATCH] D21104: [CodeGen][ObjC] Block captures should inherit the type of the captured field in the enclosing lambda or block

2016-06-07 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rjmccall. ahatanak added a subscriber: cfe-commits. This patch fixes a bug in code-gen where it uses the type of the declared variable rather than the type of the capture of the enclosing lambda or block for the block capture. For exampl

[PATCH] D21099: [Sema] Teach -Wcast-align to look at the aligned attribute of the declared variables

2016-06-07 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a subscriber: cfe-commits. Sema::CheckCastAlign currently ignores the aligned attribute attached to the declared variables, which causes clang to issue spurious warnings. This patch fixes the bug. http://reviews.llvm.org/D21099 Files: lib/Sema/S

Re: [PATCH] D16948: [libcxx] Filesystem TS -- Complete

2016-05-31 Thread Akira Hatanaka via cfe-commits
ahatanak added a subscriber: ahatanak. Comment at: test/std/utilities/meta/meta.rel/is_nothrow_callable.pass.cpp:57 @@ -56,3 +56,3 @@ struct Dummy { void foo() noexcept {} static void bar() noexcept {} }; -#if !defined(__cpp_noexcept_function_type) +#if !defined(__cpp_noexcep

Re: [PATCH] D20334: [libcxx] Fix a bug in strstreambuf::overflow

2016-05-27 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. Thanks! Marshall, I've filed a PR for this bug: https://llvm.org/bugs/show_bug.cgi?id=27915 http://reviews.llvm.org/D20334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

Re: [PATCH] D20334: [libcxx] Fix a bug in strstreambuf::overflow

2016-05-26 Thread Akira Hatanaka via cfe-commits
ahatanak marked an inline comment as done. ahatanak added a comment. I spent some time debugging the code and here is what I found. The initial buffer size is 0 when strstreambuf is constructed and all six pointers are null initially. When the first character is pushed, strstreambuf::overflow a

Re: [PATCH] D20334: [libcxx] Fix a bug in strstreambuf::overflow

2016-05-26 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 58740. ahatanak added a comment. Remove unused variable and add test case. http://reviews.llvm.org/D20334 Files: src/strstream.cpp test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp Index: test/std/depr/d

r270817 - Don't feed standard error to FileCheck.

2016-05-25 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Wed May 25 21:32:10 2016 New Revision: 270817 URL: http://llvm.org/viewvc/llvm-project?rev=270817&view=rev Log: Don't feed standard error to FileCheck. This is an attempt to fix the buildbot that started failing after r270808. http://lab.llvm.org:8011/builders/sanitizer-x8

r270808 - [ObjC] Remove _Atomic from return type and parameter type of

2016-05-25 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Wed May 25 19:37:30 2016 New Revision: 270808 URL: http://llvm.org/viewvc/llvm-project?rev=270808&view=rev Log: [ObjC] Remove _Atomic from return type and parameter type of objective-c properties. This fixes an assert in CodeGen that fires when the getter and setter functio

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-25 Thread Akira Hatanaka via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL270808: [ObjC] Remove _Atomic from return type and parameter type of (authored by ahatanak). Changed prior to commit: http://reviews.llvm.org/D20407?vs=58544&id=58549#toc Repository: rL LLVM http://

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-25 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 58544. ahatanak added a comment. Thanks for the review. I've removed parameter ASTContext that was unused. http://reviews.llvm.org/D20407 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/CodeGen/CGObjC.cpp lib/Sema/SemaObjCProperty.cpp test/C

Re: [PATCH] D20334: [libcxx] Fix a bug in strstreambuf::overflow

2016-05-25 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. In http://reviews.llvm.org/D20334#439248, @bcraig wrote: > ASAN is complaining about an excessively large read. If the problem was in > overflow, I would expect ASAN to complain about an out-of-bounds write > instead. According to the example shown in the link below

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-25 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. In http://reviews.llvm.org/D20407#439951, @rjmccall wrote: > The C standard is poorly-written in this area, but I think it would be > reasonable for CheckFunctionReturnType to just silently remove _Atomic. (You > will not be able to just re-use your new method there;

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-25 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 58512. ahatanak added a comment. Rename variables. http://reviews.llvm.org/D20407 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/CodeGen/CGObjC.cpp lib/Sema/SemaObjCProperty.cpp test/CodeGenObjC/property-atomic-bool.m test/SemaObjC/proper

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-25 Thread Akira Hatanaka via cfe-commits
ahatanak marked 2 inline comments as done. ahatanak added a comment. I reverted the changes I made in SemaDeclObjC.cpp as they weren't needed to pass the regression tests I added. clang still asserts when it compiles an objective-c method returning _Atomic and those changes will become necessary

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-25 Thread Akira Hatanaka via cfe-commits
ahatanak marked 7 inline comments as done. Comment at: lib/AST/Type.cpp:1282 @@ -1277,1 +1281,3 @@ +} + Optional> Type::getObjCSubstitutions( I added getTypePtr() because the code didn't compile. Comment at: lib/CodeGen/CGObjC.cpp:901 @@ -903,1

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-25 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 58495. ahatanak added a comment. Address John's review comments. http://reviews.llvm.org/D20407 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/CodeGen/CGObjC.cpp lib/Sema/SemaObjCProperty.cpp test/CodeGenObjC/property-atomic-bool.m test/S

Re: [PATCH] D20334: [libcxx] Fix a bug in strstreambuf::overflow

2016-05-24 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. My understanding is that typically std::ends is explicitly appended to null-terminate the stream buffer. The test case in the example does that. http://en.cppreference.com/w/cpp/io/ostrstream/str http://reviews.llvm.org/D20334 __

Re: [PATCH] D20334: [libcxx] Fix a bug in strstreambuf::overflow

2016-05-24 Thread Akira Hatanaka via cfe-commits
ping. > On May 17, 2016, at 12:20 PM, Akira Hatanaka via cfe-commits > wrote: > > ahatanak created this revision. > ahatanak added reviewers: mclow.lists, EricWF, howard.hinnant. > ahatanak added a subscriber: cfe-commits. > > The end pointer should point to one p

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-23 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 58144. ahatanak added a comment. Rewrote the patch based on John's review comment. Remove typedefs and _Atomic from the return and parameter types of getters and setters of objective-c properties. http://reviews.llvm.org/D20407 Files: include/clang/AST

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-20 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. I've managed to remove _Atomic from the types of the return and parameter of getter and setter functions in my new patch. I'm not sure how I should handle typedefs though. If I had the following typedef, typedef _Atomic(_Bool) AtomicBool, would it be OK to desugar th

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-19 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. In http://reviews.llvm.org/D20407#433915, @rjmccall wrote: > _Atomic is functionally a type qualifier and should be removed in Sema when > computing the result type of the getter and the parameter type of the setter. > That is, if the user declares a property of type

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-18 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. Also, it seems that there are bugs in the way clang handles functions whose return types are atomic. Clang asserts when compiling the following test case: $ cat t1.c _Atomic _Bool b1; _Atomic _Bool foo1() { return b1; } $ clang -std=c11 -o - -S t1.c -emit

[PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-18 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rjmccall. ahatanak added a subscriber: cfe-commits. This patch fixes an assert that fires when there is a property that has attribute nonatomic and type _Atomic(_Bool). The assert fires when an i1 value is bitcast to i8 (which is the typ

[PATCH] D20334: [libcxx] Fix a bug in strstreambuf::overflow

2016-05-17 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added reviewers: mclow.lists, EricWF, howard.hinnant. ahatanak added a subscriber: cfe-commits. The end pointer should point to one past the end of the newly allocated buffer. Without this fix, asan reports an error when the following code is compiled and

Re: [PATCH] D20045: [ObjC][CodeGen] Remove an assert that is no longer correct.

2016-05-12 Thread Akira Hatanaka via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL269385: [ObjC][CodeGen] Remove an assert that is no longer correct. (authored by ahatanak). Changed prior to commit: http://reviews.llvm.org/D20045?vs=57111&id=57125#toc Repository: rL LLVM http://r

r269385 - [ObjC][CodeGen] Remove an assert that is no longer correct.

2016-05-12 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Thu May 12 20:21:23 2016 New Revision: 269385 URL: http://llvm.org/viewvc/llvm-project?rev=269385&view=rev Log: [ObjC][CodeGen] Remove an assert that is no longer correct. clang asserts when compiling the following code because r231508 made changes to promote constant tempo

Re: [PATCH] D20045: [ObjC][CodeGen] Remove an assert that is no longer correct.

2016-05-12 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 57111. ahatanak added a comment. Thanks, I updated the comment in the new patch. http://reviews.llvm.org/D20045 Files: lib/CodeGen/CGExpr.cpp test/CodeGenObjCXX/arc-cxx11-init-list.mm Index: test/CodeGenObjCXX/arc-cxx11-init-list.mm ==

Re: [PATCH] D20045: [ObjC][CodeGen] Remove an assert that is no longer correct.

2016-05-12 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. In http://reviews.llvm.org/D20045#425903, @manmanren wrote: > After r231508 made changes to promote constant temporaries to globals, the > assert fires when a std::initializer_list is constructed using Objective-C > string literals. > > --> Can you explain the code pat

Re: [PATCH] D20045: [ObjC][CodeGen] Remove an assert that is no longer correct.

2016-05-12 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 57088. ahatanak added a comment. Add a comment explaining why it is OK to return early if the global variable has an initializer. http://reviews.llvm.org/D20045 Files: lib/CodeGen/CGExpr.cpp test/CodeGenObjCXX/arc-cxx11-init-list.mm Index: test/CodeG

[PATCH] D20045: [ObjC][CodeGen] Remove an assert that is no longer correct.

2016-05-06 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, rsmith, manmanren. ahatanak added a subscriber: cfe-commits. The assert was committed in r183967. After r231508 made changes to promote constant temporaries to globals, the assert fires when a std::initializer_list is constructe

r268589 - Do not add uwtable attribute by default for MachO targets.

2016-05-04 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Wed May 4 20:41:07 2016 New Revision: 268589 URL: http://llvm.org/viewvc/llvm-project?rev=268589&view=rev Log: Do not add uwtable attribute by default for MachO targets. r217178 changed clang to add function attribute uwtable by default on Win64, which caused the __eh_fram

r268532 - [CodeGenObjCXX] Fix handling of blocks in lambda.

2016-05-04 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Wed May 4 13:40:33 2016 New Revision: 268532 URL: http://llvm.org/viewvc/llvm-project?rev=268532&view=rev Log: [CodeGenObjCXX] Fix handling of blocks in lambda. This fixes a crash that occurs when a block captures a reference that is captured by its enclosing lambda. rdar

Re: [PATCH] D19536: [CodeGenObjCXX] Fix handling of blocks in lambda

2016-05-04 Thread Akira Hatanaka via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL268532: [CodeGenObjCXX] Fix handling of blocks in lambda. (authored by ahatanak). Changed prior to commit: http://reviews.llvm.org/D19536?vs=56090&id=56183#toc Repository: rL LLVM http://reviews.llv

Re: [PATCH] D18815: [ObjC] Enter a new evaluation context before calling BuildBlockForLambdaConversion.

2016-05-04 Thread Akira Hatanaka via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL268527: [ObjC] Enter a new evaluation context before calling (authored by ahatanak). Changed prior to commit: http://reviews.llvm.org/D18815?vs=56092&id=56178#toc Repository: rL LLVM http://reviews.

r268527 - [ObjC] Enter a new evaluation context before calling

2016-05-04 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Wed May 4 13:07:20 2016 New Revision: 268527 URL: http://llvm.org/viewvc/llvm-project?rev=268527&view=rev Log: [ObjC] Enter a new evaluation context before calling BuildBlockForLambdaConversion. Previously, clang would build an incorrect AST for the following code: id tes

Re: [PATCH] D18815: [ObjC] Enter a new evaluation context before calling BuildBlockForLambdaConversion.

2016-05-03 Thread Akira Hatanaka via cfe-commits
ahatanak added reviewers: manmanren, doug.gregor, rjmccall. ahatanak updated this revision to Diff 56092. ahatanak added a comment. Rebase and add reviewers. http://reviews.llvm.org/D18815 Files: lib/Sema/SemaExprCXX.cpp test/SemaObjCXX/block-cleanup.mm Index: test/SemaObjCXX/block-cleanup

Re: [PATCH] D19536: [CodeGenObjCXX] Fix handling of blocks in lambda

2016-05-03 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 56090. ahatanak added a comment. Apply John's patch with a few modifications. I had to special case __block variables and remove the line creating a load from a reference to fix the failing regression tests. http://reviews.llvm.org/D19536 Files: lib/Co

Re: r268314 - [CodeGenObjCXX] Don't rematerialize default arguments of function

2016-05-02 Thread Akira Hatanaka via cfe-commits
Thanks, fixed in r268318. > On May 2, 2016, at 3:05 PM, Richard Smith wrote: > > On Mon, May 2, 2016 at 2:52 PM, Akira Hatanaka via cfe-commits > mailto:cfe-commits@lists.llvm.org>> wrote: > Author: ahatanak > Date: Mon May 2 16:52:57 2016 > New Revision: 26831

Re: [PATCH] D19536: [CodeGenObjCXX] Fix handling of blocks in lambda

2016-05-02 Thread Akira Hatanaka via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CGBlocks.cpp:806 @@ -792,1 +805,3 @@ + } + src = Builder.CreateStructGEP(Addr, Idx, Offset, FD->getName()); } else { rjmccall wrote: > Hmm. It's become increasingly clear that my original deci

r268318 - Remove unneeded test in tryCaptureAsConstant.

2016-05-02 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Mon May 2 17:29:40 2016 New Revision: 268318 URL: http://llvm.org/viewvc/llvm-project?rev=268318&view=rev Log: Remove unneeded test in tryCaptureAsConstant. It isn't necessary to call hasDefaultArg because we can't rematerialize a captured variable that is a function param

Re: r268314 - [CodeGenObjCXX] Don't rematerialize default arguments of function

2016-05-02 Thread Akira Hatanaka via cfe-commits
It looks like turning it to an assert wouldn’t be correct, I’ll probably just remove it. > On May 2, 2016, at 3:12 PM, Akira Hatanaka via cfe-commits > wrote: > > I see. Perhaps this should be an assert? > >> On May 2, 2016, at 3:05 PM, Richard Smith > <mailto:ri

Re: r268314 - [CodeGenObjCXX] Don't rematerialize default arguments of function

2016-05-02 Thread Akira Hatanaka via cfe-commits
I see. Perhaps this should be an assert? > On May 2, 2016, at 3:05 PM, Richard Smith wrote: > > On Mon, May 2, 2016 at 2:52 PM, Akira Hatanaka via cfe-commits > mailto:cfe-commits@lists.llvm.org>> wrote: > Author: ahatanak > Date: Mon May 2 16:52:57 2016 > New Revi

r268314 - [CodeGenObjCXX] Don't rematerialize default arguments of function

2016-05-02 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Mon May 2 16:52:57 2016 New Revision: 268314 URL: http://llvm.org/viewvc/llvm-project?rev=268314&view=rev Log: [CodeGenObjCXX] Don't rematerialize default arguments of function parameters in the body of a block. This fixes a bug where clang would materialize the default ar

Re: [PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-29 Thread Akira Hatanaka via cfe-commits
PM, Richard Smith wrote: > > On Fri, Apr 29, 2016 at 12:12 PM, Akira Hatanaka via cfe-commits > mailto:cfe-commits@lists.llvm.org>> wrote: > Scope’s constructor passes the parameter ScopeFlags to Scope::Init, which > calls setFlags(Scope *parent, unsigned flags) and setFlags ini

Re: [PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-29 Thread Akira Hatanaka via cfe-commits
11:07 AM, Akira Hatanaka via cfe-commits > mailto:cfe-commits@lists.llvm.org>> wrote: > If I add an assert to check (F != Flags) in setFlags, 2700+ out of 5000+ > clang regression tests fail. I haven’t figured out which parts of clang are > passing the same value to setFlags. >

Re: [PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-29 Thread Akira Hatanaka via cfe-commits
6 at 7:34 PM, Akira Hatanaka via cfe-commits > mailto:cfe-commits@lists.llvm.org>> wrote: > ahatanak added a comment. > > Thanks for the review. I committed the patch in r267956 and r267975. > > Do you think I should make setFlags(unsigned F) return early if F == Flags? >

Re: [PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-28 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. Thanks for the review. I committed the patch in r267956 and r267975. Do you think I should make setFlags(unsigned F) return early if F == Flags? Repository: rL LLVM http://reviews.llvm.org/D19175 ___ cfe-commits mailing

r267975 - [Parser] Clear the TemplateParamScope bit of the current scope's flag

2016-04-28 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Thu Apr 28 21:24:14 2016 New Revision: 267975 URL: http://llvm.org/viewvc/llvm-project?rev=267975&view=rev Log: [Parser] Clear the TemplateParamScope bit of the current scope's flag if we are parsing a template specialization. This commit makes changes to clear the Template

Re: [PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-28 Thread Akira Hatanaka via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL267975: [Parser] Clear the TemplateParamScope bit of the current scope's flag (authored by ahatanak). Changed prior to commit: http://reviews.llvm.org/D19175?vs=55484&id=55523#toc Repository: rL LLVM

r267956 - [Sema] Fix a crash that occurs when a variable template is initialized

2016-04-28 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Thu Apr 28 18:50:12 2016 New Revision: 267956 URL: http://llvm.org/viewvc/llvm-project?rev=267956&view=rev Log: [Sema] Fix a crash that occurs when a variable template is initialized with a generic lambda. This patch fixes Sema::InstantiateVariableInitializer to switch to t

Re: [PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-28 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 55484. ahatanak added a comment. - Defined a private overload of Scope::setFlags which is called from Scope::setFlags and Scope::Init. - Stop checking TmplScope->isTemplateParamScope() in Sema::ActOnStartOfLambdaDefinition. - Fix test case test/CXX/drs/dr1x

Re: [PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-28 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. If I try calling Init(AnyParent, F) in Scope::setFlags, clang fails to compile the following code because it cannot find the definition of struct "foo": void foo3(void) struct foo { int a, f; }; char *np = nullptr; int *ip = &(((struct foo *)np)

Re: [PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-28 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 55453. ahatanak added a comment. Use ParseScopeFlags to clear the TemplateParamScope rather than calling setFlags directly. I tried calling Init(AnyParent, F) is Scope::setFlags, but it caused a lot of test cases to fail, which I'm currently investigating.

Re: [PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-27 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 55356. ahatanak added a comment. Made a couple of changes to distinguish between an explicit specialization ('template<>') and a template declaration which doesn't have a named template parameter (see the variable template fn0 in test case vartemplate-lambd

Re: [PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-26 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. I'm looking for a way to avoid the assert in Sema::PerformDependentDiagnostics that is fired when a template parameter doesn't have a name. In order to avoid the assert, CXXRecordDecl::isDependentLambda() should return true for the old lambda class, and in order to do

[PATCH] D19536: [CodeGenObjCXX] Fix handling of blocks in lambda

2016-04-26 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rjmccall. ahatanak added a subscriber: cfe-commits. This fixes a crash that occurs when a block nested in a c++ lambda captures a reference that is captured by the enclosing lambda. rdar://problem/18586651 http://reviews.llvm.org/D19536

Re: r266645 - [Parser][ObjC] Make sure c++11 in-class initialization is done when the

2016-04-18 Thread Akira Hatanaka via cfe-commits
Thanks for catching this, r266706. > On Apr 18, 2016, at 11:38 AM, Richard Smith wrote: > > On Mon, Apr 18, 2016 at 11:19 AM, Akira Hatanaka via cfe-commits > mailto:cfe-commits@lists.llvm.org>> wrote: > Author: ahatanak > Date: Mon Apr 18 13:19:45 2016 > New Revi

r266706 - Add a test case to check a member's default constructor is also run.

2016-04-18 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Mon Apr 18 21:21:47 2016 New Revision: 266706 URL: http://llvm.org/viewvc/llvm-project?rev=266706&view=rev Log: Add a test case to check a member's default constructor is also run. This is a follow-up to r266645. Modified: cfe/trunk/test/Parser/objc-default-ctor-init.m

Re: [PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-18 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 54088. ahatanak added a comment. Address Richard's review comments and add a test case. The test case currently asserts when fn0 is instantiated. This doesn't happen if I give the template parameter a name. template auto fn0 = [] {}; instead of template

r266645 - [Parser][ObjC] Make sure c++11 in-class initialization is done when the

2016-04-18 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Mon Apr 18 13:19:45 2016 New Revision: 266645 URL: http://llvm.org/viewvc/llvm-project?rev=266645&view=rev Log: [Parser][ObjC] Make sure c++11 in-class initialization is done when the constructor's definition is in an implementation block. Without this commit, ptr doesn't g

[PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

2016-04-15 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rsmith. ahatanak added a subscriber: cfe-commits. I'm sending a WIP patch which fixes PR27015 to get an early feedback from the community. This patch attempts to fix a crash which happens when a variable template is initialized with a g

Re: [PATCH] D18618: [ObjC] Pop all cleanups created in CodeGenFunction::EmitObjCForCollectionStmt

2016-04-12 Thread Akira Hatanaka via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL266147: [ObjC] Pop all cleanups created in EmitObjCForCollectionStmt before (authored by ahatanak). Changed prior to commit: http://reviews.llvm.org/D18618?vs=52609&id=53489#toc Repository: rL LLVM

r266147 - [ObjC] Pop all cleanups created in EmitObjCForCollectionStmt before

2016-04-12 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Tue Apr 12 18:10:58 2016 New Revision: 266147 URL: http://llvm.org/viewvc/llvm-project?rev=266147&view=rev Log: [ObjC] Pop all cleanups created in EmitObjCForCollectionStmt before exiting the for-in loop. This commit fixes a bug where EmitObjCForCollectionStmt didn't pop cl

[PATCH] D18815: [ObjC] Enter a new evaluation context before calling BuildBlockForLambdaConversion.

2016-04-05 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a subscriber: cfe-commits. Currently, when clang compiles the following code, id test() { return @{@"a": [](){}, @"b": [](){}}; } it builds an AST that is incorrect: ReturnStmt 0x10d080448 `-ExprWithCleanups 0x10d080428 |-cleanup Block 0x10d0

Re: [PATCH] D18618: [ObjC] Pop all cleanups created in CodeGenFunction::EmitObjCForCollectionStmt

2016-04-04 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. Also, fixed the regex in test case so that the test passes on release builds too. http://reviews.llvm.org/D18618 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

Re: [PATCH] D18618: [ObjC] Pop all cleanups created in CodeGenFunction::EmitObjCForCollectionStmt

2016-04-04 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 52609. ahatanak added a comment. Changed the patch based on review comments. Added code to enter RunCleanupsScope before the condition is evaluated and force its cleanup before emitting LoopEnd. http://reviews.llvm.org/D18618 Files: lib/CodeGen/CGObjC.

r265257 - Fix test case committed in r265197.

2016-04-02 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Sat Apr 2 22:36:22 2016 New Revision: 265257 URL: http://llvm.org/viewvc/llvm-project?rev=265257&view=rev Log: Fix test case committed in r265197. The test was failing on some release build because the basic block names I was expecting weren't printed. Modified: cfe/t

Re: [PATCH] D18196: [CodeGen] Emit lifetime.end intrinsic after destructor call in landing pad

2016-04-01 Thread Akira Hatanaka via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL265197: [CodeGen] Emit lifetime.end intrinsic after objects are destructed in (authored by ahatanak). Changed prior to commit: http://reviews.llvm.org/D18196?vs=52110&id=52440#toc Repository: rL LLVM

r265197 - [CodeGen] Emit lifetime.end intrinsic after objects are destructed in

2016-04-01 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Fri Apr 1 17:58:55 2016 New Revision: 265197 URL: http://llvm.org/viewvc/llvm-project?rev=265197&view=rev Log: [CodeGen] Emit lifetime.end intrinsic after objects are destructed in landing pads. Previously, lifetime.end intrinsics were inserted only on normal control flows

Re: [PATCH] D18479: [CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte alignment on Darwin

2016-03-31 Thread Akira Hatanaka via cfe-commits
ahatanak added inline comments. Comment at: cfe/trunk/include/clang/Basic/TargetInfo.h:426 @@ +425,3 @@ +/// we assume that alignment here. (It's generally 16 bytes, but +/// some targets overwrite it.) +return getDefaultAlignForAttributeAligned(); rj

r265035 - Fix the comment for the function added in r264998.

2016-03-31 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Thu Mar 31 13:32:38 2016 New Revision: 265035 URL: http://llvm.org/viewvc/llvm-project?rev=265035&view=rev Log: Fix the comment for the function added in r264998. Modified: cfe/trunk/include/clang/Basic/TargetInfo.h Modified: cfe/trunk/include/clang/Basic/TargetInfo.h

r264998 - [CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte

2016-03-30 Thread Akira Hatanaka via cfe-commits
Author: ahatanak Date: Thu Mar 31 01:36:07 2016 New Revision: 264998 URL: http://llvm.org/viewvc/llvm-project?rev=264998&view=rev Log: [CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte alignment on Darwin. Itanium C++ ABI specifies that _Unwind_Exception should be double-wo

Re: [PATCH] D18479: [CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte alignment on Darwin

2016-03-30 Thread Akira Hatanaka via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL264998: [CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte (authored by ahatanak). Changed prior to commit: http://reviews.llvm.org/D18479?vs=52171&id=52175#toc Repository: rL L

Re: [PATCH] D18479: [CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte alignment on Darwin

2016-03-30 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 52171. ahatanak added a comment. Thank you for the review, John. I've updated the patch as per your request. I defined virtual function getExnObjectAlignment instead of adding a ExnObjectAlignment field to TargetInfo since I found that getDefaultAlignForAt

Re: [PATCH] D18618: [ObjC] Pop all cleanups created in CodeGenFunction::EmitObjCForCollectionStmt

2016-03-30 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. In CodeGenFunction::EmitARCRetainScalarExpr, if I move the declaration of "scope" above the call to enterFullExpression, the cleanup is popped before the loop body is entered right after the method returning the collection (foo1 in the test case) is called. if (const

Re: [PATCH] D18196: [CodeGen] Emit lifetime.end intrinsic after destructor call in landing pad

2016-03-30 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 52110. ahatanak added a comment. Add "REQUIRES: asserts" to test case to enable checking basic block names. http://reviews.llvm.org/D18196 Files: lib/CodeGen/CGCleanup.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/EHScopeStack.h test/CodeGenCXX/destructor

[PATCH] D18618: [ObjC] Pop all cleanups created in CodeGenFunction::EmitObjCForCollectionStmt

2016-03-30 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rjmccall. ahatanak added a subscriber: cfe-commits. This patch fixes a bug where EmitObjCForCollectionStmt doesn't pop cleanups for captures. For example, in the following for-in loop, a block which captures self is passed to foo1: for

Re: [PATCH] D18479: [CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte alignment on Darwin

2016-03-28 Thread Akira Hatanaka via cfe-commits
> On Mar 25, 2016, at 2:23 PM, Akira Hatanaka via cfe-commits > wrote: > >> >> On Mar 25, 2016, at 2:06 PM, David Majnemer via cfe-commits >> mailto:cfe-commits@lists.llvm.org>> wrote: >> >> >> >> On Fri, Mar 25, 2016 at 12:57

<    3   4   5   6   7   8   9   10   >