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

2018-02-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 134430. ahatanak marked 14 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D41228 Files: docs/LanguageExtensions.rst include/clang/AST/Decl.h include/clang/AST/Type.h include/clang/Basic/Diagnost

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

2018-02-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/AST/Type.h:1137 +return isNonTrivialToPrimitiveDestroy() == PCK_Struct; + } + rjmccall wrote: > Are these four queries really important enough to provide API for them on > QualType? I removed these f

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

2018-02-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 134560. ahatanak marked 3 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D42776 Files: include/clang/AST/APValue.h lib/AST/APValue.cpp lib/AST/ExprConstant.cpp test/SemaCXX/constexpr-default-arg

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

2018-02-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/AST/ExprConstant.cpp:589-598 +/// Keep track of the version of MTEs that are used by CXXDefaultArgExpr. +/// The version number is updated every time VisitCXXDefaultArgExpr is +/// called. +unsigned getDefaultArgNum(

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

2018-02-16 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC325321: [Sema] Take into account the current context when checking the (authored by ahatanak, committed by ). Repository: rC Clang https://reviews.llvm.org/D36918 Files: lib/Sema/SemaAccess.cpp te

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

2018-02-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CGDecl.cpp:1423 + if (capturedByInit) +drillIntoBlockVariable(*this, lvalue, cast(D)); + rjmccall wrote: > The "delay" is that we generally handle `__block` captures within > initializers by de

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

2018-02-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 135309. ahatanak marked 14 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D41228 Files: docs/LanguageExtensions.rst include/clang/AST/Decl.h include/clang/AST/Type.h include/clang/Basic/Diagnost

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

2018-02-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/AST/Type.h:1121 + /// after it is moved, as opposed to a truely destructive move in which the + /// source object is placed in an uninitialized state. + PrimitiveCopyKind isNonTrivialToPrimitiveDestructiveMove() const;

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

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

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

2018-02-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 135703. ahatanak marked 9 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D41228 Files: docs/LanguageExtensions.rst include/clang/AST/Decl.h include/clang/AST/Type.h include/clang/Basic/Diagnosti

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

2018-02-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/AST/Type.h:1108 +PCK_ARCStrong, // objc strong pointer. +PCK_Struct // non-trivial C struct. + }; rjmccall wrote: > These should all be /// documentation comments, and they mostly shouldn't >

[PATCH] D32520: Support __fp16 vectors

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

[PATCH] D33606: [Sema] Fix a crash-on-invalid when a template parameter list has a class definition or non-reference class type

2017-05-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. Currently clang crashes with an assertion failure in SemaAccess.cpp ("Assertion failed: (Access == AS_private || Access == AS_protected)") when compiling the following invalid code: class C0 { public: template) {} S0 *m; template void foo1(

[PATCH] D33526: Fix spurious Wunused-lambda-capture warning

2017-05-29 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaLambda.cpp:1524-1526 + if (!CurContext->isDependentContext() && !IsImplicit) +if ((IsGenericLambda && !From.isNonODRUsed()) || +(!IsGenericLambda && !From.isODRUsed())) kongyi wrote

[PATCH] D33563: Track whether a unary operation can overflow

2017-05-29 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:9 +VK_LValue, OK_Ordinary, Loc, true); // Construct the loop that copies all elements of this array. Can we pass false here if we know the array size is not too larg

[PATCH] D33356: [Nios2] Changes in frontend to support Nios2 LLVM target

2017-05-30 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. A couple of coding style nits. FYI, LLVM coding standard is documented here: http://llvm.org/docs/CodingStandards.html Comment at: include/clang/Basic/TargetBuiltins.h:154 + /// \brief Nios2 builtins + namespace Nios2 { + enum { ---

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

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

[PATCH] D33698: [CodeGen][ObjC] Fix assertion failure in CodeGenFunction::EmitARCStoreStrongCall

2017-05-30 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. The assertion fails because CGObjCRuntime::EmitValueForIvarAtOffset doesn't get the correct type of the ivar when the class the ivar belongs to is parameterized. It assigns the type of the ivar in the parameterized base class, instead of the type in the derived c

[PATCH] D33739: [Sema] Improve -Wstrict-prototypes diagnostic message for blocks

2017-05-31 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. Currently, clang prints the same warning message "this function declaration is not a prototype" for non-prototype declarations of blocks and normal functions. This commit makes changes needed to print a more accurate warning "this block declaration is not a proto

[PATCH] D33698: [CodeGen][ObjC] Fix assertion failure in CodeGenFunction::EmitARCStoreStrongCall

2017-06-01 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL304449: [CodeGen][ObjC] Fix assertion failure in EmitARCStoreStrongCall. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D33698?vs=100787&id=101060#toc Repository: rL LLVM

[PATCH] D33739: [Sema] Improve -Wstrict-prototypes diagnostic message for blocks

2017-06-01 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL304507: [Sema] Improve -Wstrict-prototypes diagnostic message for blocks. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D33739?vs=100916&id=101155#toc Repository: rL LLVM

[PATCH] D33719: Add _Float16 as a C/C++ source language type

2017-06-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/Basic/TokenKinds.def:379 +// C11 Extension +KEYWORD(_Float16, KEYALL) + Just wanted to confirm that your intention is to unconditionally support _Float16 (for example, c99 supports it

[PATCH] D33721: [ARM] Add support for target("arm") and target("thumb").

2017-06-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Basic/Targets.cpp:5444 +Feature = "-thumb-mode"; + if (Feature.compare("+thumb") == 0) +Feature = "+thumb-mode"; This can be "else if". https://reviews.llvm.org/D33721 _

[PATCH] D33719: Add _Float16 as a C/C++ source language type

2017-06-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Also, please create your new patch with context (git diff -U99 other-branch). https://reviews.llvm.org/D33719 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[PATCH] D33904: Add a __has_attribute_enhancement macro to clang

2017-06-12 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: docs/LanguageExtensions.rst:176 +For example, clang's ``overloadable`` attribute has existed since before Clang +3.5, but in Clang 5.0 it gained was modified to support so-called "unmarked +overloads". One can use ``__has_attribute_enh

[PATCH] D34185: [Parser][ObjC] Avoid crashing when skipping to EOF while parsing an ObjC interface/implementation

2017-06-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. This patch fixes the crash and that is fine, but the users might find the last error ("expected '}'" at the end of the file) confusing. This seems to happen because Parser::ParseLexedObjCMethodDefs consumes all tokens in the file until it sees the EOF after consuming a

[PATCH] D32520: Support __fp16 vectors

2017-06-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 102642. ahatanak marked 3 inline comments as done. ahatanak added a comment. Herald added a subscriber: kristof.beyls. Address review comments. https://reviews.llvm.org/D32520 Files: include/clang/Sema/Sema.h lib/CodeGen/CGExprScalar.cpp lib/Sema/Sem

[PATCH] D32520: Support __fp16 vectors

2017-06-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CGExprScalar.cpp:997 - // Allow bitcast from vector to integer/fp of the same size. - if (isa(SrcTy) || - isa(DstTy)) -return Builder.CreateBitCast(Src, DstTy, "conv"); + if (isa(SrcTy) || isa(DstTy)) { +au

[PATCH] D34251: Add a new driver option to disable warning about c++17's non-throwing exception specification in function signature

2017-06-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. The option allows disabling just the warning about non-throwing exception specification in function signature instead of disabling all c++1z compatibility warnings with -Wno-c++1z-compat. I'm not sure "-Wc++1z-compat-exception-spec" sounds right. Maybe -Wc++1z-c

[PATCH] D34185: [Parser][ObjC] Avoid crashing when skipping to EOF while parsing an ObjC interface/implementation

2017-06-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Parse/ParseObjc.cpp:220 CheckNestedObjCContexts(AtLoc); + if (isEofOrEom()) +return nullptr; Do you need this check here (and below)? Comment at: lib/Parse/ParseObjc.cpp:3674 + + // Clean

[PATCH] D33606: [Sema] Fix a crash-on-invalid when a template parameter list has a class definition or non-reference class type

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

[PATCH] D34235: [OpenCL] Fix OpenCL and SPIR version metadata generation.

2017-06-16 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:516 + llvm::LLVMContext &Ctx = TheModule.getContext(); + llvm::Type *Int32Ty = llvm::Type::getInt32Ty(Ctx); + // SPIR v2.0 s2.12 - The SPIR version used by the module is stored in the ---

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

2017-06-16 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. Herald added a subscriber: Prazek. The test case I added used to fail because of a linker error. Linkage failed because Sema::MarkDeclRefReferenced would prevent the virtual method definition from being emitted by setting OdrUse=false and then code-gen would devi

[PATCH] D34185: [Parser][ObjC] Avoid crashing when skipping to EOF while parsing an ObjC interface/implementation

2017-06-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Thanks, LGTM. Comment at: lib/Parse/ParseObjc.cpp:3636 + Eof.setEofData(MCDecl); + Eof.setLocation(Tok.getLocation()); + LM.Toks.push_back(Eof); You can use OrigLoc instead of calling Tok.getLocation(). Repository: rL LLVM http

[PATCH] D34251: Add a new driver option to disable warning about c++17's non-throwing exception specification in function signature

2017-06-19 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL305772: Add a subgroup of c++1z-compat to enable and disable the warning about (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D34251?vs=102725&id=103159#toc Repository: rL

[PATCH] D34439: Add GCC's noexcept-type alias for c++1z-compat-mangling

2017-06-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I didn't know gcc had its own option. This change seems reasonable to me. Since c++1z-compat-mangling was added just a few days ago, should we just rename it instead of adding an alias? https://reviews.llvm.org/D34439 ___

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

2017-06-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. The following changes are made to the driver since 32-bit apps do not run on iOS 11 or later: - If the deployment target is set explicitly, either with a command-line option or an environment variable, the driver should report an error if the version is greater

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

2017-06-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. This is needed because older versions of libc++ do not have these operators. If users target an older deployment target and try to compile programs in which these operators are explicitly called, the compiler will complain. The following is the list of minimum de

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

2017-06-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. This patch stops declaring implicitly the new and delete operators with alignment if the deployment target is earlier than the version in which support for them was introduced . This fixes linker errors which we see when the compiler emits a new or delete operato

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

2017-06-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 103785. ahatanak added a comment. Remove -fno-aligned-allocation from the RUN lines. The test cases should check that new or delete operators with alignment are disabled without providing -fno-aligned-allocation. https://reviews.llvm.org/D34574 Files:

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

2017-06-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. The motivation for this change was to silence linker errors I saw when compiling and linking programs in which operator new was called to allocate over-aligned types (similar to the code in cxx1z-aligned-allocation.cpp). Linkage failed because clang would emit the call

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

2017-06-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp:12-16 +// test availability of new/delete operators introduced in c++17. + +#ifdef __APPLE__ +#undef _LIBCPP_DISABLE_AVAILABILITY +#endif

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

2017-06-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 103880. ahatanak marked an inline comment as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D34556 Files: include/__config include/new test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_d

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

2017-06-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I suppose it's possible to define a new driver option that can be used to tell clang to annotate the implicit declarations with an availability attribute, which will enable the link time error to be caught at compile time. Alternatively, it's also possible to put the a

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

2017-06-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 103883. ahatanak added a comment. Fix line number and remove #else. https://reviews.llvm.org/D34556 Files: include/__config include/new test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp Index: test/

[PATCH] D34496: [clang] Fix printf check for CFIndex

2017-06-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. This looks correct to me. The commit log of the original commit (r163266) doesn't say that CFIndex has been dropped intentionally, so this should be fine. Repository: rL LLVM https://r

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

2017-06-26 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL306310: [libcxx] Annotate c++17 aligned new/delete operators with availability (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D34556?vs=103883&id=103992#toc Repository: rL

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

2017-12-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, doug.gregor, rsmith. Herald added a subscriber: mgorny. ObjectiveC ARC in C mode currently disallows having __strong and __weak pointers in structs. This patch takes the first step towards lifting that restriction. In order to p

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

2017-12-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I just found that the code that creates the mangled name for a special function is not correct. Two structs with different record layouts can end up having functions that have the same name. I'll fix the bug and update the patch today. https://reviews.llvm.org/D41228

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

2017-12-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 127231. ahatanak added a comment. Fixed a bug where the code gets stuck in an infinite loop when a struct with an array field is passed to FieldInfoToString. Encoded the offset of an array in a struct into the function name. Also, added comments that descri

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

2017-12-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 127233. ahatanak added a comment. Insert an underscore before src-alignment in the BNF rule for alignment-info. ::= ["_" ] https://reviews.llvm.org/D41228 Files: include/clang/AST/Decl.h include/clang/AST/Type.h include/clang/Basic/DiagnosticSemaK

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

2017-12-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 9 inline comments as done. ahatanak added a comment. Address review comments. Comment at: lib/CodeGen/CGDecl.cpp:1421 +destroyer = CodeGenFunction::destroyNonTrivialCStruct; +cleanupKind = getARCCleanupKind(); +break; rjmccall wrote:

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

2017-12-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 127456. ahatanak marked 5 inline comments as done. ahatanak added a comment. Update patch. https://reviews.llvm.org/D41228 Files: docs/LanguageExtensions.rst include/clang/AST/Decl.h include/clang/AST/Type.h include/clang/Basic/DiagnosticSemaKinds.

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

2017-12-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 127591. ahatanak added a comment. Address review comments. Changed the mangling of special functions to make it a bit easier to read. https://reviews.llvm.org/D41228 Files: docs/LanguageExtensions.rst include/clang/AST/Decl.h include/clang/AST/Type.

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

2017-12-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 2 inline comments as done. ahatanak added inline comments. Comment at: lib/CodeGen/CGExprAgg.cpp:315 +} + } } rjmccall wrote: > ahatanak wrote: > > rjmccall wrote: > > > Do these functions have a memcpy as a precondition? I would expect the

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

2017-12-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 2 inline comments as done. ahatanak added inline comments. Comment at: lib/CodeGen/CGExprAgg.cpp:315 +} + } } ahatanak wrote: > rjmccall wrote: > > ahatanak wrote: > > > rjmccall wrote: > > > > Do these functions have a memcpy as a precondit

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

2017-12-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 127818. ahatanak added a comment. - Improved IRGen for copying trivial fields in a non-trivial C struct. IRGen in CGNonTrivialStruct.cpp now calls a single memcpy if there are consecutive trivial fields in a struct (it does something similar to what FieldMe

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

2017-12-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/AST/Type.h:1152 +NTFK_Struct, // non-trivial C struct. +NTFK_Array// array that has non-trivial elements. + }; rjmccall wrote: > We don't actually distinguish arrays in DestructionKind. Is i

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

2017-12-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/AST/Type.h:1152 +NTFK_Struct, // non-trivial C struct. +NTFK_Array// array that has non-trivial elements. + }; rjmccall wrote: > ahatanak wrote: > > rjmccall wrote: > > > We don't actually di

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

2017-12-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128061. ahatanak added a comment. Rename functions. Check whether a non-trivial type passed to Sema::isValidVarArgType is a struct. https://reviews.llvm.org/D41228 Files: docs/LanguageExtensions.rst include/clang/AST/Decl.h include/clang/AST/Type.h

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

2017-12-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: include/clang/AST/Type.h:1152 +NTFK_Struct, // non-trivial C struct. +NTFK_Array// array that has non-trivial elements. + }; rjmccall wrote: > ahatanak wrote: > >

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

2018-01-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128642. ahatanak added a comment. I've only fixed the places where the bits to track the triviality of special functions are set or reset, so this is still a WIP. I'll update the patch again later today, but let me know if anyone has any feedback in the mea

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

2018-01-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128694. ahatanak added a comment. No worries. Upload the patch again. https://reviews.llvm.org/D41039 Files: include/clang/AST/Decl.h include/clang/AST/DeclCXX.h include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128767. ahatanak added a comment. Address review comments. I also made changes so that FunctionDecl::IsTrivialForCall is always set to true for special functions of "trivial_abi" classes. There is still one microsoft IRGen test failing because I haven't im

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 10 inline comments as done. ahatanak added inline comments. Comment at: include/clang/AST/DeclCXX.h:443 +/// SMF_MoveConstructor, and SMF_Destructor are meaningful here. +unsigned HasTrivialSpecialMembersForCall : 6; + rjmccall wrote: > I

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: include/clang/Basic/AttrDocs.td:2261 +- The class or its subobjects have Objective-C pointer type members and ARC is + enabled. + }]; rjmccall wrote: > I think the right list

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128781. https://reviews.llvm.org/D41039 Files: include/clang/AST/Decl.h include/clang/AST/DeclCXX.h include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Se

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Sorry, the patch I've just uploaded was missing some changes I made. 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] D41039: Add support for attribute "trivial_abi"

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128784. ahatanak added a comment. - Serialize/deserialize the bits I added to FunctionDecl and CXXRecordDecl. - Enable passing non-trivial structs when clang abi-compat version is 4.0 or lower. - Fix a bug in Sema::CheckCompletedCXXClass where the CXXRecordD

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128798. ahatanak marked an inline comment as done. https://reviews.llvm.org/D41039 Files: include/clang/AST/Decl.h include/clang/AST/DeclCXX.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/DiagnosticSemaKinds.td

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 3 inline comments as done. ahatanak added inline comments. Comment at: include/clang/AST/DeclCXX.h:1489-1491 + bool shouldBeDestructedInCallee() const { +return data().CanPassInRegisters && hasNonTrivialDestructor(); + } rsmith wrote: > This

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 2 inline comments as done. ahatanak added inline comments. Comment at: lib/CodeGen/CGDecl.cpp:1827 + + if (!IsScalar && !CurFuncIsThunk && + (getTarget().getCXXABI().areArgsDestroyedLeftToRightInCallee() || This is not correct since it isn't

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128815. ahatanak marked an inline comment as done. ahatanak added a comment. Check whether the argument is passed indirectly before pushing the cleanup. https://reviews.llvm.org/D41039 Files: include/clang/AST/Decl.h include/clang/AST/DeclCXX.h inclu

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128838. https://reviews.llvm.org/D41039 Files: include/clang/AST/Decl.h include/clang/AST/DeclCXX.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/AST/DeclCXX

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: lib/CodeGen/MicrosoftCXXABI.cpp:833 // passed in registers, which is non-conforming. if (RD->hasNonTrivialDestructor() && getContext().getTypeSize(RD->getTypeForDecl()) > 64)

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

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128839. ahatanak marked 3 inline comments as done. ahatanak added a comment. Rename variable to HasTrivialABIOverride. https://reviews.llvm.org/D41039 Files: include/clang/AST/Decl.h include/clang/AST/DeclCXX.h include/clang/Basic/Attr.td include/c

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. It doesn't look like this patch would break IRGen for functions that receive fp16 types. fp16 is passed as i32 or float (without promotion) on ARM and as half on ARM64. It should work fine. https://reviews.llvm.org/D41311 ___

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2321 + ArgI.getCoerceToType() == + ConvertType(isPromoted ? Ty : Arg->getType()) && ArgI.getDirectOffset() == 0) { Maybe a comment explaining why different t

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

2018-01-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128895. ahatanak added a comment. Address review comments. Also, emit the declaration of the destructor of a trivial-abi override class in Sema::ActOnParamDeclarator and mark it as referenced. This is necessary because a trivial-abi type that is passed by

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

2018-01-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 4 inline comments as done. ahatanak added a comment. In https://reviews.llvm.org/D41039#969171, @rjmccall wrote: > I'll trust Richard on the tricky Sema/AST bits. The functionality of the > patch looks basically acceptable to me, although I'm still not thrilled about > the idea

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

2018-01-08 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 128960. ahatanak marked 7 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D41039 Files: include/clang/AST/Decl.h include/clang/AST/DeclCXX.h include/clang/AST/Type.h include/clang/Basic/Attr.td

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

2018-01-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 129038. ahatanak added a comment. Add more tests for template instantiation of "trivial_abi" classes. https://reviews.llvm.org/D41039 Files: include/clang/AST/ASTContext.h include/clang/AST/Decl.h include/clang/AST/DeclCXX.h include/clang/AST/Type.

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

2018-01-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 7 inline comments as done. ahatanak added inline comments. Comment at: lib/Sema/SemaDecl.cpp:11700 +} + } + rsmith wrote: > rjmccall wrote: > > I think it's correct not to call CheckDestructorAccess and > > DiagnoseUseOfDecl here, since acco

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

2018-01-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 129345. ahatanak marked 2 inline comments as done. ahatanak added a comment. Partially revert the changes I made to CodeGenFunction::EmitParmDecl add IRGen test case for exception handling. https://reviews.llvm.org/D41039 Files: include/clang/AST/ASTCon

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

2018-01-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaDecl.cpp:11700 +} + } + ahatanak wrote: > rsmith wrote: > > rjmccall wrote: > > > I think it's correct not to call CheckDestructorAccess and > > > DiagnoseUseOfDecl here, since according to the standa

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

2018-01-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 129359. ahatanak marked an inline comment as done. ahatanak added a comment. In EmitCallArg and EmitParmDecl, use the existing code for Microsoft C++ ABI to determine whether the argument should be destructed in the callee. Also, add a test case that checks

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

2018-01-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 129397. ahatanak added a comment. In CXXRecordDecl::addedMember, set HasTrivialSpecialMembersForCall if Method->isTrivialForCall() returns true. This fixes a bug where CXXRecordDecl::hasNonTrivialDestructorForCall would return false for the implicit destr

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

2018-02-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 136124. ahatanak marked 7 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D42776 Files: include/clang/AST/APValue.h lib/AST/APValue.cpp lib/AST/ExprConstant.cpp test/SemaCXX/constant-expression-c

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

2018-02-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/AST/ExprConstant.cpp:5236 if (Frame) { - Result.set(VD, Frame->Index); + Result.set({VD, Frame->Index}); return true; rsmith wrote: > Hmm. We should be versioning local variables as well. Curre

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

2018-02-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a subscriber: cfe-commits. ahatanak added a comment. Add cfe-commits to subscribers. https://reviews.llvm.org/D43839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2018-02-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak abandoned this revision. ahatanak added a comment. I'm going to send this patch again so that people can read the summary. https://reviews.llvm.org/D43839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin

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

2018-02-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rjmccall. This patch adds a command line option (-fdisable-tail-calls-esca ping-blocks) that annotates escaping block invoke functions with attribute "disable-tail-calls". This is an option that helps users in debugging their code who sp

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

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

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

2018-02-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. This one is abandoned. The new phab review is here: https://reviews.llvm.org/D43841 https://reviews.llvm.org/D43839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

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

2018-02-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I'm planning to work on a new patch this week. https://reviews.llvm.org/D39562 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2018-02-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. This is limited to escaping blocks because disabling tail-call optimizations for all blocks might impact performance. The user is claiming that non-escaping blocks are often used in areas that are performance-sensitive (for example, dispatch_sync() and -[NSArray enumer

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

2018-03-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 136580. ahatanak marked 3 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D43841 Files: include/clang/AST/Decl.h include/clang/Driver/Options.td include/clang/Frontend/CodeGenOptions.def lib/Code

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

2018-03-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/Driver/Options.td:1419 +def fno_disable_tail_calls_escaping_blocks : Flag<["-"], "fno-disable-tail-calls-escaping-blocks">, Group, Flags<[CC1Option]>; +def fdisable_tail_calls_escaping_blocks : Flag<["-"], "fdisable-tail

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

2018-03-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:4846 +if (auto *BE = dyn_cast(Arg->IgnoreParenNoopCasts(Context))) + BE->getBlockDecl()->setDoesNotEscape(); + rjmccall wrote: > Can this

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

2018-03-01 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 136584. ahatanak marked an inline comment as done. ahatanak added a comment. Check the function prototype's noescape bit. https://reviews.llvm.org/D43841 Files: include/clang/AST/Decl.h include/clang/Driver/Options.td include/clang/Frontend/CodeGenOp

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