[PATCH] D27827: [ObjC] CodeGen support for @available on macOS

2017-02-21 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 89305. erik.pilkington added a comment. This new patch addresses all of Alex's comments: - Remove `ObjC` from function names - Rename `_IsOSVersionAtLeast` -> `__isOSVersionAtLeast` - Improve testcase https://reviews.llvm.org/D27827 Files:

[PATCH] D27827: [ObjC] CodeGen support for @available on macOS

2017-02-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: test/CodeGenObjC/availability-check.m:16 + // CHECK: br i1 true + if (__builtin_available(ios 10, *)) +; arphaman wrote: > Shouldn't this be `br i1 false`, since we are building for macOS so we have > no

[PATCH] D27827: [ObjC] CodeGen support for @available on macOS

2017-02-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 89067. erik.pilkington added a comment. This new patch just generates a call to the function `_IsOSVersionAtLeast` and branches on the result. `_IsOSVersionAtLeast` is going through review here: https://reviews.llvm.org/D30136. I decided to parse

[PATCH] D27827: [ObjC] CodeGen support for @available on macOS

2016-12-15 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: manmanren, dexonsmith, rjmccall, thakis. erik.pilkington added a subscriber: cfe-commits. This patch adds CodeGen support for `@available` on macos. This is done by compiling @available predicates into calls to

[PATCH] D27827: [ObjC] CodeGen support for @available on macOS

2016-12-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. I seem to remember that mapping from kernel versions to marketing versions was tossed around as a potential alternative to Gestalt. I think that the problem was Apple sometimes introduces (or reserves the right to introduce) new SDKs in a patch release (ie, Z

[PATCH] D28670: [ObjC] Disallow vector parameters and return values in Objective-C methods on older X86 targets

2017-01-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi Alex, thanks for CCing me! Comment at: include/clang/Basic/DiagnosticSemaKinds.td:1157 +def err_objc_method_unsupported_param_ret_type : Error< + "%0 %select{parameter|return value}1 is unsupported for this target">; +

[PATCH] D24639: [Sema] Warn when returning a lambda that captures a local variable by reference

2016-12-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D24639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26893: [Sema] Fix assert on valid during template argument deduction

2017-01-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington abandoned this revision. erik.pilkington added a comment. @rsmith fixed this in r291064. https://reviews.llvm.org/D26893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D24639: [Sema] Warn when returning a lambda that captures a local variable by reference

2016-12-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D24639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-03-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D30837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-03-30 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 93488. erik.pilkington marked 2 inline comments as done. erik.pilkington added a comment. In this new patch, use an explicit specialization of std::allocator that specifically only performs a rebind. This needs to be a specialization of

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-04-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D30837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-04-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: include/memory:3606 +template <> +class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type> +{ EricWF wrote: > I would prefer using an entirely different allocator type, not a >

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-04-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 95210. erik.pilkington added a comment. This new patch includes @EricWF's static_assert & test. Thanks, Erik https://reviews.llvm.org/D30837 Files: include/memory

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-03-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D30837#698305, @EricWF wrote: > We can't just use an arbitrary allocator type for a number of reasons: > > - You just changed the type of the control block. That's ABI breaking. Ah, I didn't think of that. This new patch only selects

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-03-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 91660. erik.pilkington added a comment. In this new patch: - We only select `allocator` when _Yp is a function type, fixing the ABI break @EricWF pointed out. - Only try to select a different allocator if we're using the `__shared_ptr_pointer`

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-03-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. This patch adds support for `shared_ptr` types, so that the following works: void Func(); void Del(void (*)()) std::shared_ptr x(Func, Del); Where previously this would fail to compile. In PR27566, the use case described for this was a

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-03-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 91385. erik.pilkington added a comment. This new patch replaces the allocator from `allocator` to `allocator`, I didn't realize `allocator` was deprecated. Thanks, Erik https://reviews.llvm.org/D30837 Files: include/memory

[PATCH] D36200: [Sema] Improve some -Wunguarded-availability diagnostic messages

2017-08-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. This patch improves the decl-level unguarded availability warnings to use the same messages as the function-level ones. This makes the diagnostic have different parameters than deprecated/unavailable, so I moved some things around in

[PATCH] D36191: [CodeGen] Don't make availability attributes imply default visibility on macos

2017-08-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Previously, the presence of `__attribute__((availability(macos, ...)))` on a declaration caused clang to make the vis of that decl implicitly default. This is a hack that is incomparable with how we're treating availability attributes now, and should be

[PATCH] D36777: [Sema] Don't emit -Wunguarded-availability for switch cases

2017-08-15 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Currently, this has pretty terrible ergonomics for the fairly common case of switching over an enum which has some entries that are partial. Thanks to Nico Weber for pointing this out! Thanks, Erik https://reviews.llvm.org/D36777 Files:

[PATCH] D36200: [Sema] Improve some -Wunguarded-availability diagnostic messages

2017-08-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D36200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35379: Add documentation for @available

2017-07-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a reviewer: arphaman. erik.pilkington added a subscriber: arphaman. erik.pilkington added a comment. This looks great, thanks for working on this! LGTM, but @arphaman might have some thoughts. Comment at: docs/LanguageExtensions.rst:1290 -..

[PATCH] D35379: Add documentation for @available

2017-07-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: docs/LanguageExtensions.rst:1309 + void my_fun(NSSomeClass* var) { +if (@available(macOS 10.12)) { + [var fancyNewMethod]; thakis wrote: > erik.pilkington wrote: > > Don't forget the '*', ie

[PATCH] D35159: [libcxxabi][demangler] Use an AST to represent the demangled name

2017-07-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington marked 4 inline comments as done. erik.pilkington added inline comments. Comment at: src/cxa_demangle.cpp:44 +class string_ref +{ mehdi_amini wrote: > If this is supposed to be *the* ultimate LLVM demangler, can we follow LLVM > coding

[PATCH] D35158: [libcxxabi][demangler] NFC: Don't make everything a template

2017-07-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington closed this revision. erik.pilkington added a comment. Landed as r307482 & r307481, thanks! (for some reason phab wasn't automatically closing this) https://reviews.llvm.org/D35158 ___ cfe-commits mailing list

[PATCH] D35158: [libcxxabi][demangler] NFC: Don't make everything a template

2017-07-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Herald added a reviewer: EricWF. This is a NFC patch to not make every parse_* function templated on Db, which makes it easier to use methods on Db because it isn't dependent anymore. This is a prerequisite to using an AST to demangle, as per this thread:

[PATCH] D35061: [ObjC] Avoid the -Wunguarded-availability warnings for protocol requirements in protocol/class/category declarations

2017-07-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaExpr.cpp:142 if (Result == AR_NotYetIntroduced) { +if (AvoidAvailabilityChecks) + return; arphaman wrote: > erik.pilkington wrote: > > Why are we doing this just for partials? Doesn't

[PATCH] D35061: [ObjC] Avoid the -Wunguarded-availability warnings for protocol requirements in protocol/class/category declarations

2017-07-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM, thanks! Comment at: lib/Sema/SemaExpr.cpp:132 + bool ObjCPropertyAccess, + bool

[PATCH] D35726: unguarded availability: add a fixit for the "annotate '...' with an availability attribute to silence" note

2017-07-24 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM, thanks for working on this! Comment at: lib/Sema/SemaDeclAttr.cpp:7230 +return; + for (const auto : S.getPreprocessor().macros()) { +

[PATCH] D35781: [Sema] Make sure that -Wunguarded-availability emits notes at the right redeclaration

2017-07-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington planned changes to this revision. erik.pilkington added a comment. On second thought, I think it makes more sense to do this right before we emit a diagnostic so we have the most recent redecl with all the inherited availability attributes until then. I'll put a diff up for that

[PATCH] D35781: [Sema] Make sure that -Wunguarded-availability emits notes at the right redeclaration

2017-07-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. This is done by modifying ShouldDiagnoseAvailabilityOfDecl() so that the OffendingDecl is the one with the original availability attribute. Also, keep track of this availability attribute so we don't have to constantly recompute it via

[PATCH] D35159: [libcxxabi][demangler] Use an AST to represent the demangled name

2017-07-12 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. > Looks like this demangler's design is similar to my demangler for Microsoft > name mangling scheme (https://reviews.llvm.org/D34667). Is that a > coincidence? Both demanglers create AST, stringize it using > print_left/print_right (I named them

[PATCH] D35726: unguarded availability: add a fixit for the "annotate '...' with an availability attribute to silence" note

2017-07-21 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Thanks for working on this! This looks like it would be very useful. Comment at: lib/Sema/SemaDeclAttr.cpp:7230 +return; + for (const auto : S.getPreprocessor().macros()) { +if (M.first->getName() != "API_AVAILABLE")

[PATCH] D33816: [Sema][ObjC] Don't allow -Wunguarded-availability to be silenced with redeclarations

2017-06-28 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 104437. erik.pilkington added a comment. Improve diagnostics for unnamed types. https://reviews.llvm.org/D33816 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/DelayedDiagnostic.h include/clang/Sema/Sema.h

[PATCH] D35061: [ObjC] Avoid the -Wunguarded-availability warnings for protocol requirements in protocol/class/category declarations

2017-07-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaExpr.cpp:142 if (Result == AR_NotYetIntroduced) { +if (AvoidAvailabilityChecks) + return; Why are we doing this just for partials? Doesn't this also apply to unavailable/deprecated?

[PATCH] D36427: [libcxxabi][demangler] Improve representation of substitutions/templates

2017-08-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: src/cxa_demangle.cpp:1575-1577 -sub_type names; -template_param_type subs; -Vector template_param; dexonsmith wrote: > - Why not rename `names` as well? > - Please rename these in a separate prep

[PATCH] D36427: [libcxxabi][demangler] Improve representation of substitutions/templates

2017-08-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 110281. erik.pilkington marked 14 inline comments as done. erik.pilkington added a comment. Address review comments. Thanks! Erik https://reviews.llvm.org/D36427 Files: src/cxa_demangle.cpp test/unittest_demangle.pass.cpp Index:

[PATCH] D36200: [Sema] Improve some -Wunguarded-availability diagnostic messages

2017-08-02 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D36200#829104, @arphaman wrote: > This needs a test for the fixits as well, see test/FixIt/fixit-availability* Why? This patch doesn't change the behavior of the fixits, so there isn't any new behavior to test.

[PATCH] D36427: [libcxxabi][demangler] Improve representation of substitutions/templates

2017-08-07 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. This patch changes the demangler so that it represents substitutions/templates more linearly. Previously, substitions were represented by a `vector>` and template parameter substitutions by a `vector>>`! I wrote a

[PATCH] D36492: [time-report] Add preprocessor timer

2017-08-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. This looks really usefull, thanks for working on this! Comment at: lib/Lex/Preprocessor.cpp:746 void Preprocessor::Lex(Token ) { + llvm::TimeRegion(PPOpts->getTimer()); + Doesn't this just start a timer and immediately end

[PATCH] D36777: [Sema] Don't emit -Wunguarded-availability for switch cases

2017-08-17 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 111528. erik.pilkington added a comment. Ah, good point. This new patch does that. Thanks, Erik https://reviews.llvm.org/D36777 Files: lib/Sema/SemaDeclAttr.cpp test/SemaObjC/unguarded-availability.m Index:

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-05-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! @mclow.lists: Do you have any thoughts here? https://reviews.llvm.org/D30837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33049: [libcxx] Support for Objective-C++ tests

2017-05-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. This patch adds lit testing support for Objective-C++. I'm going to be working on improving Objective-C++ support in libc++ this summer, and it would be nice to write tests. I tested this patch on Ubuntu 16.04 with gcc 5.4, and it works fine (the .mm

[PATCH] D33250: [Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong location

2017-05-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 99235. erik.pilkington added a comment. Just noticed this can be simplified a bit, NFC compared to the last version of the diff. https://reviews.llvm.org/D33250 Files: lib/Sema/SemaDeclAttr.cpp test/SemaObjC/unguarded-availability.m Index:

[PATCH] D33250: [Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong location

2017-05-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Previously, we used TypeLocs to find the correct SourceLocations to emit -Wunguarded-availability. Unfortunately, TypeLocs can't be trusted as they sometimes have an an empty SourceLocation component. This new patch maintains the enclosing SourceLocation

[PATCH] D33000: Add support for pretty platform names to `@available`/`__builtin_available`

2017-05-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM, thanks for working on this! Repository: rL LLVM https://reviews.llvm.org/D33000 ___ cfe-commits mailing list

[PATCH] D34264: Introduce -Wunguarded-availability-new, which is like -Wunguarded-availability, except that it's enabled by default for new deployment targets

2017-06-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:7031 +Introduced) && +!S.Diags.isIgnored(diag::warn_unguarded_availability_new, Loc); +diag = NewWarning ? diag::warn_partial_availability_new Sorry to keep this

[PATCH] D34264: Introduce -Wunguarded-availability-new, which is like -Wunguarded-availability, except that it's enabled by default for new deployment targets

2017-06-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM, thanks for working on this! Repository: rL LLVM https://reviews.llvm.org/D34264 ___ cfe-commits mailing list

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

2017-06-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp:35 + // expected-error@-10 {{call to unavailable function 'operator new[]': introduced in macOS 10.13}} + //

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

2017-06-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D33606 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D33816: [Sema][ObjC] Don't allow -Wunguarded-availability to be silenced with redeclarations

2017-06-24 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 103852. erik.pilkington added a comment. Improve enum diagnostics, as @arphaman suggested. This causes a bit of churn throughout the availability diagnostic machinery, if it would make it at all easier to review, I would be happy to separate out

[PATCH] D33816: [Sema][ObjC] Don't allow -Wunguarded-availability to be silenced with redeclarations

2017-06-26 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 103958. erik.pilkington added a comment. Make the diagnostic reference the context declaration instead of the offending decl if no enclosing decl is found, fixing the diagnostic bug @arphaman pointed out. https://reviews.llvm.org/D33816 Files:

[PATCH] D33393: [PATCH] Libcxxabi Demangler PR32890

2017-05-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. > You could append my test case as a quick-check. Sure, I added the test case here to my patch and it works. > So, I'll go ahead and abandon this revision? Guess so, sorry for the confusion here. https://reviews.llvm.org/D33393

[PATCH] D33450: Warn about uses of `@available` that can't suppress the -Wunguarded-availability warnings

2017-05-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2889 + "use if (%select{@available|__builtin_available}0) instead">, + InGroup>; Might be a bit more clear if you

[PATCH] D33250: [Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong location

2017-05-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 99605. erik.pilkington added a comment. > Can we ignore the TypeLocs with invalid location and instead look at > ObjCPropertyRefExprs with a class receiver? Sure, good idea. This new patch does exactly that. Thanks, Erik

[PATCH] D33368: [libcxxabi][demangler] Fix a crash in the demangler

2017-05-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: src/cxa_demangle.cpp:3036 break; -if (db.names.size() < 2) +if (k1 <= k0) return first; compnerd wrote: > I'm not sure

[PATCH] D33661: [Sema][ObjC] Don't emit availability diagnostics for categories extending unavailable interfaces

2017-05-29 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Previously, @implementations of categories that extended unavailable/deprecated/partial @interfaces triggered availability diagnostics. There was no way to turn this off, as we check the use of the unavailable decl outside of the context of the

[PATCH] D33816: [Sema][ObjC] Don't allow -Wunguarded-availability to be silenced with redeclarations

2017-06-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. This patch drops support for suppressing -Wunguarded-availability with redeclarations. This was behavior left over from the -Wpartial-availability days, where it was the only way of silencing the diagnostic. Now that we have @available and better support

[PATCH] D33977: [libcxx][WIP] Experimental support for a scheduler for use in the parallel stl algorithms

2017-06-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Herald added a reviewer: EricWF. This patch adds a simple work-stealing scheduler meant for use as a fallback implementation for the C++17 parallel stl algorithms. This scheme follows a very simple fork/join API that should be easy to map onto different

[PATCH] D34264: Introduce -Wunguarded-availability-new, which is like -Wunguarded-availability, except that it's enabled by default for new deployment targets

2017-06-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:6944 -diag = !ObjCPropertyAccess ? diag::err_unavailable - : diag::err_property_method_unavailable; -diag_message = diag::err_unavailable_message;

[PATCH] D34096: [Sema][C++1z] Ensure structured binding's bindings in dependent foreach have non-null type

2017-06-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. A DecompositionDecls' bindings have a null type until the initializer is attached, if the initializer is dependent, then the bindings should be set to have dependent type. For non-foreach bindings, this is done in

[PATCH] D34264: Introduce -Wunguarded-availability-new, which is like -Wunguarded-availability, except that it's enabled by default for new deployment targets

2017-06-15 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:7315 + default: +assert(!Triple.isMacOSX() && "MacOS should be handled in the switch"); +// New targets should always warn about availability. This assert seems a bit

[PATCH] D33816: [Sema][ObjC] Don't allow -Wunguarded-availability to be silenced with redeclarations

2017-06-15 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D33816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33977: [libcxx][WIP] Experimental support for a scheduler for use in the parallel stl algorithms

2017-06-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D33977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-05-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 97313. erik.pilkington added a comment. Rebase n' ping! https://reviews.llvm.org/D30837 Files: include/memory test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp

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

2017-05-05 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rL LLVM https://reviews.llvm.org/D32424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2017-05-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi Alex, thanks for working on this! This looks right, but I have a couple of comments. Thanks, Erik Comment at: lib/Sema/SemaDeclAttr.cpp:7151 +Visitor.Scope = Scope; +Visitor.TraverseStmt(const_cast(Scope)); +return

[PATCH] D32891: [Sema][ObjC++] Objective-C++ support for __is_base_of(B, D)

2017-05-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. This patch adds Objective-C interfaces support for the type trait `is_base_of`, so that `__is_base_of(NSString, NSMutableString)` is true. rdar://24308607 Thanks for taking a look! Erik https://reviews.llvm.org/D32891 Files: lib/Sema/SemaExprCXX.cpp

[PATCH] D33368: [libcxxabi][demangler] Fix a crash in the demangler

2017-05-24 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. > Also, are you now maintaining this code? > I am trying to find someone who wants to be CC-ed to other demangler bugs > automatically reported by oss-fuzz. I don’t think I’ll accept the title of maintainer, (I only have one commit in this file!) but I have

[PATCH] D33368: [libcxxabi][demangler] Fix a crash in the demangler

2017-05-24 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. r303806 removes the assertion (instead just returning first). I though this should never happen, I'm looking into this testcase to see if there is another bug here. Thanks, Erik Repository: rL LLVM https://reviews.llvm.org/D33368

[PATCH] D33049: [libcxx] Support for Objective-C++ tests

2017-05-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 99628. erik.pilkington added a comment. In this new patch: - Add support for toggling -fobjc-arc, this is done by using file extensions, ie: `foo.arc.pass.mm` instead of `foo.pass.mm`. (Thanks @dexonsmith for the suggestion!) - Clean up/simplify

[PATCH] D33049: [libcxx] Support for Objective-C++ tests

2017-05-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 99633. erik.pilkington marked an inline comment as done. erik.pilkington added a comment. This new patch checks to make sure ARC is enabled in the tests, thanks for the suggestion! https://reviews.llvm.org/D33049 Files:

[PATCH] D38483: [ExprConstant] Allow constexpr ctor to modify non static data members in body

2017-10-02 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Previously, clang rejected the following (copied from PR19741): struct A { int a = 0; constexpr A() { a = 1; } }; constexpr bool f() { constexpr A a; static_assert(a.a == 1, ""); return a.a == 1; } static_assert(f(), "");

[PATCH] D38483: [ExprConstant] Allow constexpr ctor to modify non static data members in body

2017-10-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 117529. erik.pilkington marked 2 inline comments as done. erik.pilkington added a comment. Thanks for the feedback, in this new patch: - insert EvaluatingDecl into EvaluatingConstructors instead of checking it in isEvaluatingDecl() - Add a comment

[PATCH] D38483: [ExprConstant] Allow constexpr ctor to modify non static data members in body

2017-10-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/AST/ExprConstant.cpp:588 + : EI(EI), Object(Object) { +DidInsert = EI.EvaluatingConstructors.insert(Object).second; + } rsmith wrote: > Can the `DidInsert == false` case actually

[PATCH] D40445: [C++17] Allow an empty expression in an if init statement

2017-11-24 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi, thanks for working on this! Can you add tests to make sure that this also works with switch statements (which also have this bug), and not with while? Also, it makes it a lot easier to review these patches if you add context lines to the diff. Thanks, Erik

[PATCH] D40566: Check if MemberExpr arguments are type-dependent.

2017-11-29 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi, thanks for working on this! Why don't we just set the TypeDependent bit to false when building the underlying MemberExpr here? Based on the section of the standard you quoted that node shouldn't be considered type-dependent, but it is by clang. I think this

[PATCH] D40372: [ExprConstant] Fix assert when initializing constexpr array

2017-11-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Previously, clang would assert on the following: struct S { constexpr S (const int& ir = 0) {} }; constexpr S foo[2]; The problem was that while initializing foo, CallStackFrame::createTemporary() was called twice for the

[PATCH] D40284: [Sema] Improve diagnostics for template arg deduction

2017-11-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. This looks correct, but I definitely agree that RAII would make this a lot nicer. Have you considered adding a `CancelableSaveAndRestore` or something to SaveAndRestore.h? It seems useful and generic enough to make it worthwhile. Otherwise, you could just write

[PATCH] D41261: [libcxxabi][demangler] Special case demangling for pass_object_size attribute

2017-12-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: EricWF, george.burgess.iv. This patch adds demangling for pass_object_size attribute (https://clang.llvm.org/docs/AttributeReference.html#pass-object-size). This attribute applies to function parameters. This attribute is

[PATCH] D41261: [libcxxabi][demangler] Special case demangling for pass_object_size attribute

2017-12-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 127067. erik.pilkington added a comment. Add a testcase with pass_object_size[0-3]. https://reviews.llvm.org/D41261 Files: src/cxa_demangle.cpp test/test_demangle.pass.cpp Index: test/test_demangle.pass.cpp

[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-17 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. > It's harder as we don't know the distinction between declaration/definition > at merge time. Right now the C++ implementation of this warning actually > checks the

[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Any thoughts on having this for regular functions and C++ member functions? Seems just as useful there. Comment at: include/clang/Sema/Sema.h:2406 + /// This will warn on any missing clauses in the declaration. + void

[PATCH] D40279: [libcxxabi][demangler] Add demangling for __attribute__((abi_tag))

2017-11-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. This patch adds demangling support for `__attribute__((abi_tag))`. I.e, the following function: `__attribute__((abi_tag("foo"))) void f() {}` mangles to `_Z1fB3foov`, and now demangles to `f[abi:foo]()` (this syntax is the same as GCC's demangler). This

[PATCH] D40279: [libcxxabi][demangler] Add demangling for __attribute__((abi_tag))

2017-11-21 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington marked 5 inline comments as done. erik.pilkington added inline comments. Comment at: src/cxa_demangle.cpp:10 +// FIXME: (possibly) incomplete list of features that clang mangles that this +// file does not yet support: EricWF wrote: > Awesome

[PATCH] D40279: [libcxxabi][demangler] Add demangling for __attribute__((abi_tag))

2017-11-21 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 123787. erik.pilkington added a comment. In this new patch: - Update the comment BNF to show the new attribute, fix comment formatting - Move call to parse_abi_tag_seq() from parse_unqualified_name() to parse_operator_name() to more closely model

[PATCH] D40372: [ExprConstant] Fix assert when initializing constexpr array

2017-12-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D40372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D46747: [Sema] Use dotted form of macOS version for unguarded availability FixIts

2018-05-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. Thanks for the explanation, LGTM. https://reviews.llvm.org/D46747 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D46747: [Sema] Use dotted form of macOS version for unguarded availability FixIts

2018-05-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. That test passes for me without this patch applied, why is UsesUnderscores actually getting set in the radar? Repository: rC Clang https://reviews.llvm.org/D46747 ___ cfe-commits mailing list

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-05-15 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. > One way we could deal with this is by adding an attribute to the compiler to > indicate "the const is a lie", that we can apply to `std::pair::first`, with > the semantics being that a top-level `const` is ignored when determining the > "real" type of the

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-05-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D46845#1098634, @rsmith wrote: > One way we could deal with this is by adding an attribute to the compiler to > indicate "the const is a lie", that we can apply to `std::pair::first`, with > the semantics being that a top-level

[PATCH] D46747: [Sema] Use dotted form of macOS version for unguarded availability FixIts

2018-05-15 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. > I am now thinking about just switching to dot format in > ParseAvailabilityAttribute() because it's much simpler to maintain > consistency that way. Okay, but if we're going to treat underscores as dots while printing diagnostics and fixits (which I think we

[PATCH] D46747: [Sema] Use dotted form of macOS version for unguarded availability FixIts

2018-05-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. Great, LGTM! https://reviews.llvm.org/D46747 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-06-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D46845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D47886: Move VersionTuple from clang/Basic to llvm/Support, clang part

2018-06-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM. Looks like LLDB has some uses of VersionTuple, you should fix those to #include the LLVM version before removing the header here. (Or, better yet, do it all atomically

[PATCH] D47887: Move VersionTuple from clang/Basic to llvm/Support, llvm part

2018-06-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM, thanks for adding the test! Repository: rL LLVM https://reviews.llvm.org/D47887 ___ cfe-commits mailing list

[PATCH] D47607: [libcxx] Almost fix some UB in and

2018-05-31 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, EricWF, mclow.lists. Herald added subscribers: christof, kosarev. and define `__value_type` as a union between pair and pair so that various operations can move into/from these pairs [1]. This is a pretty blatant

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-06-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: libcxx/include/__hash_table:2261 +_NodeHandle +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_extract_unique( +key_type const& __key) EricWF wrote: > If I'm not mistaken,

[PATCH] D47607: [libcxx] Almost fix some UB in and

2018-06-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 149449. erik.pilkington marked 10 inline comments as done. erik.pilkington added a comment. Address review comments. Thanks! https://reviews.llvm.org/D47607 Files: libcxx/include/__hash_table libcxx/include/__tree libcxx/include/map

  1   2   3   4   5   6   >