[PATCH] D34574: [Sema] Disable c++17 aligned new and delete operators if not implemented in the deployment target's c++ standard library

2017-06-29 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL306722: [Sema] Issue diagnostics if a new/delete expression generates a call to (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D34574?vs=104579&id=104712#toc Repository: rL

[PATCH] D34529: [Driver] Check that the iOS deployment target is iOS 10 or earlier if the target is 32-bit

2017-06-30 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 104906. ahatanak added a comment. Address review comments. - Change the error message from "invalid iOS deployment version '%0', maximum allowable version is iOS 10" to "invalid iOS deployment version '%0', iOS 10 is the maximum deployment target for 32-bi

[PATCH] D34529: [Driver] Check that the iOS deployment target is iOS 10 or earlier if the target is 32-bit

2017-06-30 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 104958. ahatanak marked an inline comment as done. ahatanak added a comment. Set Micro to 99 too. https://reviews.llvm.org/D34529 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Darwin.cpp test/Driver/darwin-version.c Index

[PATCH] D34529: [Driver] Check that the iOS deployment target is iOS 10 or earlier if the target is 32-bit

2017-06-30 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL306922: [Driver] Check that the iOS deployment target is iOS 10 or earlier if (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D34529?vs=104958&id=104972#toc Repository: rL L

[PATCH] D34556: [libcxx] Annotate c++17 aligned new/delete operators with availability attribute

2017-07-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I'm not exactly sure why the test failed, but the patch was reverted in r306859. Repository: rL LLVM https://reviews.llvm.org/D34556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/m

[PATCH] D34992: Emit static constexpr member as available_externally definition

2017-07-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2376 +const VarDecl *InitDecl; +const Expr *InitExpr = D->getAnyInitializer(InitDecl); +if (InitExpr) { Does getAnyInitializer ever return a null pointer here when D is a

[PATCH] D34574: [Sema] Disable c++17 aligned new and delete operators if not implemented in the deployment target's c++ standard library

2017-07-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a subscriber: EricWF. ahatanak added a comment. Does r307218 unbreak the tests? Repository: rL LLVM https://reviews.llvm.org/D34574 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D34301: [Sema] Make sure the definition of a referenced virtual function is emitted when it is final

2017-07-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 2 inline comments as done. ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:14715 +if (Method->isVirtual() && !(Method->hasAttr() || + Method->getParent()->hasAttr())) OdrUse = false; vsk

[PATCH] D34301: [Sema] Make sure the definition of a referenced virtual function is emitted when it is final

2017-07-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 106149. ahatanak marked an inline comment as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D34301 Files: include/clang/AST/DeclCXX.h include/clang/Sema/Sema.h lib/AST/DeclCXX.cpp lib/CodeGen/CGClass.cpp lib/Cod

[PATCH] D34301: [Sema] Make sure the definition of a referenced virtual function is emitted when it is final

2017-07-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 106347. ahatanak marked 2 inline comments as done. ahatanak added a comment. Define and use CXXMethodDecl::getDevirtualizedMethod, which returns the function that is called when a call is devirtualized. https://reviews.llvm.org/D34301 Files: include/cla

[PATCH] D34301: [Sema] Make sure the definition of a referenced virtual function is emitted when it is final

2017-07-12 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL307883: [Sema] Mark a virtual CXXMethodDecl as used if a call to it can be (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D34301?vs=106347&id=106380#toc Repository: rL LLVM

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

2017-07-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 106735. ahatanak marked 3 inline comments as done. ahatanak added a comment. Address review comments. - Allow attaching "noescape" to pointers other than block pointers. Update the docs accordingly. - Attach attribute "nocapture" to parameters that are anno

[PATCH] D35520: [Sema] Improve diagnostic message for unavailable c++17 aligned allocation functions

2017-07-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. This changes the error message Sema prints when an unavailable c++17 aligned allocation function is selected. Original message: "... possibly unavailable on x86_64-apple-macos10.12" New message: "... only available on macosx 10.13 or newer" This is a follow-up to

[PATCH] D35520: [Sema] Improve diagnostic message for unavailable c++17 aligned allocation functions

2017-07-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 107140. ahatanak marked 6 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D35520 Files: include/clang/Basic/AlignedAllocation.h include/clang/Basic/DiagnosticSemaKinds.td lib/Driver/ToolChains/Darw

[PATCH] D35520: [Sema] Improve diagnostic message for unavailable c++17 aligned allocation functions

2017-07-19 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL308496: [Sema] Improve diagnostic message for unavailable C++17 aligned (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D35520?vs=107140&id=107336#toc Repository: rL LLVM h

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

2017-07-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. Herald added subscribers: kristof.beyls, aemerson. When I compile the following code targeting arm64 and execute it, it terminates with an uncaught exception: "libc++abi.dylib: terminating with uncaught exception of type int": int foo1() noexcept { try {

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

2017-07-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added a comment. In https://reviews.llvm.org/D32210#810508, @rjmccall wrote: > In https://reviews.llvm.org/D32210#810292, @ahatanak wrote: > > > Address review comments. > > > > - Allow attaching "noescape" to pointers other than block pointers.

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

2017-07-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 107993. ahatanak marked an inline comment as done. ahatanak added a comment. Herald added a subscriber: javed.absar. Address review comments. https://reviews.llvm.org/D32210 Files: include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/c

[PATCH] D41228: [ObjC] Enable __strong pointers in structs under ARC

2018-01-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/AST/Type.h:1148 +DK_objc_weak_lifetime, +DK_c_struct_strong_field }; rjmccall wrote: > I don't think you want to refer to the fact that the C struct specifically > contains a __strong field her

[PATCH] D41039: Add support for attribute "trivial_abi"

2018-01-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I think I've addressed all the review comments. Any other comments from anyone? https://reviews.llvm.org/D41039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[PATCH] D41039: Add support for attribute "trivial_abi"

2018-01-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Yes, please document this in itanium-cxx-abi. Thanks! https://reviews.llvm.org/D41039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42521: [CodeGen] Use the non-virtual alignment when emitting the base class subobject constructor

2018-01-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, vsk. This patch fixes what looks like a bug in IRGen's member initialization where it uses the alignment of a complete object instead of its non-virtual alignment when emitting the base constructor. For example, when emitting t

[PATCH] D42521: [CodeGen] Use the non-virtual alignment when emitting the base class subobject constructor

2018-01-26 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC323578: [CodeGen] Use the non-virtual alignment when emitting the base (authored by ahatanak, committed by ). Repository: rC Clang https://reviews.llvm.org/D42521 Files: lib/CodeGen/CGClass.cpp te

[PATCH] D42776: [Sema] Fix an assertion failure in constant expression evaluation of calls to functions with default arguments

2018-01-31 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rsmith. The assertion fails when a function with a default argument that materializes a temporary is called more than once in an expression. The assertion fails in CallStackFrame::createTemporary when it searches map Temporaries using th

[PATCH] D29755: Cache FileID when translating diagnostics in PCH files

2017-02-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Frontend/ASTUnit.cpp:2551 continue; -FileID FID = SrcMgr.translateFile(FE); +FileID FID; +if (FE == CachedFE) { Since FID is always equal to CachedFID, I think you can simplify this a bit by remo

[PATCH] D29599: Clang Changes for alloc_align

2017-02-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Can this attribute be used on c++ template methods? Is the following code valid? template struct S { T foo(int a) __attribute__((alloc_align(1))); }; https://reviews.llvm.org/D29599 ___ cfe-commits mailing list

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. This patch disables moving a __block variable to return it from a function, which was causing a crash that occurred when compiling and executing the following code: #include #include #include class A { public: A(int x) : internal(x) {} int

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Posting John's review comment, which was sent to the review I abandoned: "Hmm. The behavior I think we actually want here is that we should move out of the __block variable but not perform NRVO, essentially like we would if the variable were a parameter. The block by

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D29908#676589, @ahatanak wrote: > Posting John's review comment, which was sent to the review I abandoned: > > "Hmm. The behavior I think we actually want here is that we should move out > of the __block variable but not perform NRVO, essent

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 88430. ahatanak added a comment. Update comment. https://reviews.llvm.org/D29908 Files: lib/Sema/SemaStmt.cpp test/SemaObjCXX/blocks.mm Index: test/SemaObjCXX/blocks.mm === --- test/Sema

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D29908#676788, @rjmccall wrote: > Oh, I see. Just to clarify: it doesn't matter that the object "ret" used to > point to has been destructed, what matters is that "ret" now holds a null > reference because it's been moved out of. Yes, tha

[PATCH] D29599: Clang Changes for alloc_align

2017-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. My question probably wasn't clear, but I wasn't sure how template functions in general (not just member functions) should be handled. I see a warning when the following function is compiled: template T __attribute__((alloc_align(1))) foo0(int a) { typedef type

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL295150: [Sema] Disallow returning a __block variable via a move. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D29908?vs=88430&id=88486#toc Repository: rL LLVM https://re

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Do we still issue a warning even when the struct can be returned in a register? For example, x86 can return a small struct (for example, a struct with one int field) in a single register, in which case it's fine to pass it to performSelector via @selector. If we shoul

[PATCH] D30166: Honor __unaligned in codegen for declarations and expressions

2017-02-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/AST/ASTContext.h:1910 +if (T.getQualifiers().hasUnaligned()) + TI.Align = 8; +return TI; Is it better to call TargetInfo::getCharWidth() instead of assigning a hardcoded number here? ==

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D30174#681843, @arphaman wrote: > Yes, we do. Primarily for the following reason: even if some target may > return a struct in a register, another target isn't guaranteed to do the same > thing. It's better to always warn about this rather t

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I'm not sure how common it is to pass a function that doesn't return an object or void, I think it's OK to allow returning primitive types if you think being too strict would catch too many false positives. Comment at: lib/AST/DeclObjC.cpp:987

[PATCH] D30372: [Driver] Consolidate tools and toolchains by target platform. (NFC)

2017-02-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Have you considered using "include_directories" in CMakeLists.txt to avoid including "../Something.h"? https://reviews.llvm.org/D30372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/m

[PATCH] D30372: [Driver] Consolidate tools and toolchains by target platform. (NFC)

2017-02-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D30372#687054, @dlj wrote: > In https://reviews.llvm.org/D30372#686871, @ahatanak wrote: > > > Have you considered using "include_directories" in CMakeLists.txt to avoid > > including "../Something.h"? > > > I don't want to take that approach

[PATCH] D25556: [Sema] Add variable captured by a block to the enclosing lambda's potential capture list

2017-02-28 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL296584: [Sema] Add variable captured by a block to the enclosing lambda's (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D25556?vs=86918&id=90123#toc Repository: rL LLVM h

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-03-05 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. Looks good, thanks! Repository: rL LLVM https://reviews.llvm.org/D30174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lis

[PATCH] D30662: Update clang filtering for mxcsr

2017-03-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Is it possible to add a test case (possibly in CodeGen)? Repository: rL LLVM https://reviews.llvm.org/D30662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[PATCH] D30662: Update clang filtering for mxcsr

2017-03-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D30662#693609, @andrew.w.kaylor wrote: > In https://reviews.llvm.org/D30662#693559, @ahatanak wrote: > > > Is it possible to add a test case (possibly in CodeGen)? > > > This is covered by CodeGen/ms-inline-asm.c, which Reid added after I brok

[PATCH] D30766: Add support for attribute "enum_extensibility"

2017-03-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. This patch adds support for a new attribute that will be used to distinguish between extensible and inextensible enums. The attribute was discussed on cfe-dev a few weeks ago and I've made a few modifications to the original proposal based on the feedback I recei

[PATCH] D30806: [nonnull] Teach Clang to attach the nonnull LLVM attribute to declarations and calls instead of just definitions, and then teach it to *not* attach such attributes even if the source c

2017-03-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Are users allowed to call these routines with a null pointer and a non-zero size? Or can we assume that if the size is known to be non-zero at compile time, the pointers are not null? I'm thinking we might miss optimization opportunities if it's not possible to mark t

[PATCH] D30810: Preserve vec3 type.

2017-03-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Could you elaborate on the motivation for this change? I was wondering why clang (CodeGen) needed the help of a command line option to decide whether vec3 should be converted to vec4. Can it just preserve vec3 when the architecture is spir? https://reviews.llvm.org/D

[PATCH] D30766: Add support for attribute "enum_extensibility"

2017-03-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 91577. ahatanak marked 2 inline comments as done. ahatanak added a comment. Address Alex's review comments. https://reviews.llvm.org/D30766 Files: include/clang/AST/Decl.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Ba

[PATCH] D30766: Add support for attribute "enum_extensibility"

2017-03-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: test/Sema/enum-attr.c:27 + +enum __attribute__((enum_extensibility(arg1))) EnumInvalidArg { // expected-warning{{'enum_extensibility' attribute argument not supported: 'arg1'}} + G arphaman wrote: > Should this be an

[PATCH] D26922: [ObjC++] Don't enter a C++ declarator context when the current context is an Objective-C declaration

2016-11-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I wonder whether it is possible to avoid calling DeclScopeObj.EnterDeclaratorScope at ParseDecl.cpp:5317 instead of fixing Sema::ActOnCXXEnterDeclaratorScope? I believe it's calling EnterDeclaratorScope to enable name lookup when a namespace-member variable is defined

[PATCH] D26800: [Sema] Make __attribute__((notnull)) inheritable through function parameters

2016-11-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: test/Sema/nonnull.c:171 + +void pr31040(char *p __attribute__((nonnull))); +void pr31040(char *p) {} Is this not pr30828? https://reviews.llvm.org/D26800 ___ cfe-commits

[PATCH] D26922: [ObjC++] Don't enter a C++ declarator context when the current context is an Objective-C declaration

2016-11-29 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Yes, I meant ParseDecl:5266. Reading the comment in ShouldEnterDeclaratorScope, it seemed to me that it shouldn't return true in this context (when parsing an objective-c). Also, the following code (which is not valid) crashes with ToT trunk, @property (nonatomic) i

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

2016-11-30 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL288267: [Sema] Teach -Wcast-align to look at the aligned attribute of the (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D21099?vs=78594&id=79792#toc Repository: rL LLVM h

[PATCH] D27214: [ObjC] Encode type arguments in property information string constants

2016-11-30 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Do you know whether this patch would have any effect on the objective-c runtime? I suspect it wouldn't cause the runtime to crash, but I don't know how the runtime uses the encoded type information. Other than that, the changes made in this patch look good to me. Rep

[PATCH] D26922: [ObjC++] Don't enter a C++ declarator context when the current context is an Objective-C declaration

2016-12-01 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 fine. I guess we can print a more helpful error message than "error: property requires fields to be named", but we can probably do it later. Repository: rL LLVM https:

[PATCH] D27304: [PATCH] [Sema][X86] Don't allow floating-point return types when SSE is disabled

2016-12-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D27304#610944, @thegameg wrote: > In https://reviews.llvm.org/D27304#610697, @joerg wrote: > > > I think this is the absolutely wrong place to put such logic. It really can > > not be anywhere but the backend. > > > I am aware of this. But th

[PATCH] D27299: [Sema] C++11 opaque enums should avoid the "case value not in enumerated type" switch warning

2016-12-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaStmt.cpp:1165 if (!hasCasesNotInSwitch) SS->setAllEnumCasesCovered(); This function used to call setAllEnumCasesCovered() when parsing a switch statement with an opaque enum condition, bu

[PATCH] D27478: Make ASTContext::getDeclAlign return the correct alignment for FunctionDecls

2016-12-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rsmith, doug.gregor. ahatanak added a subscriber: cfe-commits. This patch silences an incorrect warning that is issued when a function pointer is cast to another function pointer type. The warning gets issued because alignments of the sou

[PATCH] D27478: Make ASTContext::getDeclAlign return the correct alignment for FunctionDecls

2016-12-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 80464. ahatanak added a comment. Call getTypeInfoImpl from getDeclAlign to get the alignment of functions. https://reviews.llvm.org/D27478 Files: lib/AST/ASTContext.cpp test/Sema/warn-cast-align.c Index: test/Sema/warn-cast-align.c ==

[PATCH] D27299: [Sema] C++11 opaque enums should avoid the "case value not in enumerated type" switch warning

2016-12-06 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. That makes sense. Thanks for the explanation. Repository: rL LLVM https://reviews.llvm.org/D27299 ___ cfe-commits mailing list cfe-commits

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

2016-12-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/AST/Decl.h:3250 + /// This is true if this struct ends with an array marked 'flexible_array'. + bool HasFlexibleArrayAttr : 1; + rsmith wrote: > How is this different from `HasFlexibleArrayMember`? Do we

[PATCH] D27607: [ubsan] Treat ObjC's BOOL as if its range is always {0, 1}

2016-12-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:1221 +/// Check if \p Ty is defined as BOOL in a system header. In ObjC language +/// modes, it's safe to treat such a type as 'the builtin bool'. +static bool isObjCBool(QualType Ty, const SourceManager &SM,

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

2016-12-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/AST/Decl.h:3250 + /// This is true if this struct ends with an array marked 'flexible_array'. + bool HasFlexibleArrayAttr : 1; + ahatanak wrote: > rsmith wrote: > > How is this different from `HasFlexibl

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

2016-12-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 81090. ahatanak added a comment. Address review comments. - Arrays marked "flexible_array" are now treated as flexible arrays. - __builtin_object_size returns a more accurate numbers for normal C99 flexible arrays (see test/CodeGen/object-size.c). Note tha

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2016-12-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a subscriber: cfe-commits. ahatanak added a comment. Add cfe-commits. https://reviews.llvm.org/D27680 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27478: Make ASTContext::getDeclAlign return the correct alignment for FunctionDecls

2016-12-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. This doesn't happen for objective-c block pointers. Sema::CheckCastAlign returns early when the type isn't a PointerType (BlockPointerType isn't a subclass of PointerType). https://reviews.llvm.org/D27478 ___ cfe-commits

[PATCH] D23096: [Sema] Pass CombineWithOuterScope = true to constructor of LocalInstantiationScope

2016-12-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 81171. ahatanak added a comment. Rebase and ping. https://reviews.llvm.org/D23096 Files: lib/Sema/SemaTemplate.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/TreeTransform.h test/SemaCXX/vartemplate-lambda.cpp test/SemaTemplate/default-expr-ar

[PATCH] D24969: [Sema] Use the instantiated name of destructors in FindInstantiatedDecl and RebuildMemberExpr

2016-12-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 81172. ahatanak added a comment. Rebase and ping. https://reviews.llvm.org/D24969 Files: lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/TreeTransform.h test/SemaCXX/destructor.cpp Index: test/SemaCXX/destructor.cpp ==

[PATCH] D27424: Add the diagnose_if attribute to clang.

2016-12-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/Sema/Overload.h:754 +unsigned NumInlineBytesUsed; +llvm::AlignedCharArray InlineSpace; I guess you could use "void *" instead of ImplicitConversionSequence for the alignment to make it cl

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2016-12-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 81284. ahatanak added a comment. Address review comment. Use llvm::is_contained instead of std::find. https://reviews.llvm.org/D27680 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CGStmt.cpp lib/CodeGen/CodeGenFunction.h test/C

[PATCH] D32187: [CodeGen][ObjC]

2017-04-19 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL300722: [Sema][ObjC] Disallow jumping into ObjC fast enumeration loops. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D32187?vs=95667&id=95781#toc Repository: rL LLVM htt

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

2017-04-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D32210#730553, @jroelofs wrote: > This doesn't forbid assigning them to block properties... is that intentional? > > typedef void (^Block)(int); > > @interface Foo > @property Block B; > @end > > void foo(Foo *f, Block __attribut

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

2017-04-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D32210#730777, @rjmccall wrote: > The rule we actually want is that no reference to the block derived from the > parameter value will survive after the function returns. You can include > examples of things that would cause potential escape

[PATCH] D31972: Do not force the frame pointer by default for ARM EABI

2017-04-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: test/CodeGen/arm-fp-eabi.c:1 +// RUN: %clang %s -target arm-none-eabi -O2 -S -o nofp.s +// RUN: not grep '.setfp' nofp.s Instead of generating a .s file and looking for ".setfp", you can pass -### and check the presenc

[PATCH] D32424: Add a fix-it for -Wunguarded-availability

2017-04-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Do we want to enclose declaration statements in "if (@available)" too? I think doing so can cause compilation errors. int x = function(); ++x; // if declaration is wrapped, this is an error because x is undeclared in this scope. Also, when function is used in

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

2017-04-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 96637. ahatanak marked 4 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D32210 Files: include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/DiagnosticSemaKinds.td lib/S

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

2017-04-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/Basic/AttrDocs.td:118 + let Content = [{ +``noescape`` placed on a block parameter is used to inform the compiler that the block passed to a function cannot escape: that is, the block will not be invoked after the funct

[PATCH] D32520: Support __fp16 vectors

2017-04-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. Herald added subscribers: rengolin, aemerson. Currently, clang miscompiles operations on __fp16 vectors. For example, when the following code is compiled: typedef __fp16 half4 __attribute__ ((vector_size (8))); half4 hv0, hv1, hv2; void test() { hv0 =

[PATCH] D32543: [X86] Clang option -fuse-init-array has no effect when generating for MCU target

2017-04-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Do you need a front-end test? Since the changes are in the backend, I think it's better to add the test to the backend (using llc). https://reviews.llvm.org/D32543 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[PATCH] D32601: [CodeGen][ObjC] Don't retain/release capture objects at block creation that are const-qualified

2017-04-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. When a block captures an ObjC object pointer, clang emits a retain/release pair to prevent prematurely destroying the object the pointer points to before the block is called or copied. When the captured object pointer is const-qualified, we can avoid emitting the

[PATCH] D32601: [CodeGen][ObjC] Don't retain/release capture objects at block creation that are const-qualified

2017-04-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. There is a comment in test/CodeGenObjC/arc-foreach.m that states the variable introduced by fast enumeration should be retained, but I don't think that is needed? https://reviews.llvm.org/D32601 ___ cfe-commits mailing li

[PATCH] D32601: [CodeGen][ObjC] Don't retain/release capture objects at block creation that are const-qualified

2017-04-28 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL301667: [CodeGen][ObjC] Don't retain captured Objective-C pointers at block (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D32601?vs=96940&id=97136#toc Repository: rL LLVM

[PATCH] D24999: [Sema] Only relax array-at-end-of-object checks in __builtin_object_size when -fno-strict-aliasing is given.

2017-04-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a dependency: D21453: Add support for attribute "overallocated". ahatanak added a comment. Depends on https://reviews.llvm.org/D21453. Adding a dependency as a reminder to look into https://reviews.llvm.org/D21453 before committing this patch. https://reviews.llvm.org/D24999

[PATCH] D33030: [libcxxabi] Align unwindHeader on a double-word boundary

2017-05-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. r276215 made a change to annotate _Unwind_Exception with "__attribute__((__aligned__))" so that exception objects are double-word aligned. This fix hasn't been incorporated to unwind.h on Darwin yet and, since it is an ABI breaking change, I'm not sure it will e

[PATCH] D33030: [libcxxabi] Align unwindHeader on a double-word boundary

2017-05-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D33030#751187, @mehdi_amini wrote: > Something still isn't clear to me: the issue IIUC is not with the > `unwindHeader` itself, but with the misaligned thrown object that is > allocated right after the __cxa_exception itself. Isn't it? > > T

[PATCH] D25001: [Module] Merge function prototype with a non-prototype function declaration

2017-05-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 98578. ahatanak added a comment. Rebase. https://reviews.llvm.org/D25001 Files: lib/Serialization/ASTReaderDecl.cpp test/Modules/Inputs/merge-non-prototype-fn/header2.h test/Modules/Inputs/merge-non-prototype-fn/module.map test/Modules/merge-non-pr

[PATCH] D33030: [libcxxabi] Align unwindHeader on a double-word boundary

2017-05-10 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL302763: [libcxxabi] Align unwindHeader on a double-word boundary. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D33030?vs=98401&id=98583#toc Repository: rL LLVM https://r

[PATCH] D32520: Support __fp16 vectors

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

[PATCH] D120757: [NFC][Clang][OpaquePtr] Remove the call to Address::deprecated in CreatePointerBitCastOrAddrSpaceCast

2022-03-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: opaque-pointers. ahatanak added a project: clang. ahatanak requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D120757 Files: clang/lib/CodeGen/CGAtomic.cpp clang/lib/CodeGen/CGBuilder.h

[PATCH] D120757: [NFC][Clang][OpaquePtr] Remove the call to Address::deprecated in CreatePointerBitCastOrAddrSpaceCast

2022-03-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Herald added a project: All. Yes, check-clang passes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120757/new/ https://reviews.llvm.org/D120757 ___ cfe-commits mailing list cfe

[PATCH] D120757: [NFC][Clang][OpaquePtr] Remove the call to Address::deprecated in CreatePointerBitCastOrAddrSpaceCast

2022-03-02 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd112cc27569b: [NFC][Clang][OpaquePtr] Remove the call to Address::deprecated in (authored by ahatanak). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120757/

[PATCH] D120856: [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in CGBlocks.cpp

2022-03-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: opaque-pointers, rjmccall. ahatanak added a project: clang. Herald added a project: All. ahatanak requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D120856 Files: clang/lib/CodeGen/CGBlock

[PATCH] D120856: [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in CGBlocks.cpp

2022-03-03 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG3717b9661fd6: [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in (authored by ahatanak). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D121135: [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in a couple more files

2022-03-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: opaque-pointers, rjmccall. ahatanak added a project: clang. Herald added a project: All. ahatanak requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D121135 Files: clang/lib/CodeGen/CGNonTr

[PATCH] D121153: [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in CGBuiltin.cpp

2022-03-07 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: opaque-pointers. ahatanak added a project: clang. Herald added a project: All. ahatanak requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D121153 Files: clang/lib/CodeGen/CGBuiltin.cpp

[PATCH] D121153: [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in CGBuiltin.cpp

2022-03-08 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9bb8c80beaa0: [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in (authored by ahatanak). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121153/new

[PATCH] D101097: [Sema] Don't set BlockDecl's DoesNotEscape bit If the block is being passed to a function taking a reference parameter

2021-04-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, erik.pilkington. ahatanak added a project: clang. ahatanak requested review of this revision. In the following example, the block passed to the function is marked as `noescape`, which is incorrect as the `noescape` attribute appl

[PATCH] D101097: [Sema] Don't set BlockDecl's DoesNotEscape bit If the block is being passed to a function taking a reference parameter

2021-04-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:5917 if (auto *BE = dyn_cast(Arg->IgnoreParenNoopCasts(Context))) BE->getBlockDecl()->setDoesNotEscape(); rjmccall wrote: > We need to be checking that the parameter typ

[PATCH] D101097: [Sema] Don't set BlockDecl's DoesNotEscape bit If the block is being passed to a function taking a reference parameter

2021-04-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:5917 if (auto *BE = dyn_cast(Arg->IgnoreParenNoopCasts(Context))) BE->getBlockDecl()->setDoesNotEscape(); rjmccall wrote: > ahatanak wrote: > > rjmccall wrote: > > > We

[PATCH] D101097: [Sema] Don't set BlockDecl's DoesNotEscape bit If the block is being passed to a function taking a reference parameter

2021-04-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 340234. ahatanak added a comment. Check that the parameter has a block pointer type. Add more test cases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101097/new/ https://reviews.llvm.org/D101097 Files: cl

[PATCH] D101097: [Sema] Don't set BlockDecl's DoesNotEscape bit If the block is being passed to a function taking a reference parameter

2021-04-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/test/SemaObjCXX/noescape.mm:20 +template +void noescapeFunc5(__attribute__((noescape)) T); // expected-warning {{'noescape' attribute only applies to pointer arguments}} +template I didn't realize clang rejects

<    7   8   9   10   11   12   13   >