[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-10-10 Thread Louis Dionne via cfe-commits
https://github.com/ldionne closed https://github.com/llvm/llvm-project/pull/66576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-10-08 Thread via cfe-commits
philnik777 wrote: @jyknight I don't think we have to worry much about that. The step count is quite arbitrary (maybe something like AST nodes?) and doesn't seem to have anything to do with the actual cost or compile time of the program. e.g. a `__builtin_memmove` of arbitrary size and a single

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-10-07 Thread James Y Knight via cfe-commits
https://github.com/jyknight edited https://github.com/llvm/llvm-project/pull/66576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-10-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I don't think I will be able to work on that the discussed Clang > > diagnostics anytime soon. Unless someone else is volunteering to implement > > it, that may not be implemented at all. > > So, I'd like to hear explicit consensus is that folks are generally OK to > >

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-10-05 Thread via cfe-commits
philnik777 wrote: I didn't consider that blocking either. IMO that's actually out-of-scope for this patch. https://github.com/llvm/llvm-project/pull/66576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-10-05 Thread Louis Dionne via cfe-commits
ldionne wrote: @jyknight Is there anything you need in order to make progress on this? If so, please let us know and we'll try to help. I think this patch is pretty much ready to go based on @philnik777 's comment above. https://github.com/llvm/llvm-project/pull/66576 _

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-27 Thread Louis Dionne via cfe-commits
ldionne wrote: I just want to slide in to say that I *really* like this patch from the point of view of `std::string`'s implementation. Our `__default_init()` method and the `if (is_constant_evaluated())` were pretty awful, and I think it's great to remove them. I agree it could cause a porta

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-27 Thread via cfe-commits
https://github.com/philnik777 approved this pull request. LGTM % nit. https://github.com/llvm/llvm-project/pull/66576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-27 Thread via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/66576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-27 Thread via cfe-commits
@@ -0,0 +1,22 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/66576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-26 Thread James Y Knight via cfe-commits
@@ -1969,7 +1955,8 @@ private: allocator_type __a = __str.__alloc(); auto __allocation = std::__allocate_at_least(__a, __str.__get_long_cap()); __begin_lifetime(__allocation.ptr, __allocation.count); -

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-26 Thread James Y Knight via cfe-commits
@@ -880,7 +880,7 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string() _NOEXCEPT_(is_nothrow_default_constructible::value) : __r_(__default_init_tag(), __default_init_tag()) { -__default_init(); +__r_.first() = __rep();

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-26 Thread James Y Knight via cfe-commits
@@ -1746,26 +1747,8 @@ private: #endif // _LIBCPP_STD_VER >= 20 } -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __default_init() { -__r_.first() = __rep(); -if (__libcpp_is_constant_evaluated()) { -size_type __sz = __recommend(0)

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-26 Thread James Y Knight via cfe-commits
https://github.com/jyknight updated https://github.com/llvm/llvm-project/pull/66576 >From 209a8f9c06a7633737e9f022bc4e61d580ad95e7 Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Sat, 16 Sep 2023 12:32:21 + Subject: [PATCH 1/4] [libcxx] Allow string to use SSO in constant evaluation. P

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-26 Thread James Y Knight via cfe-commits
https://github.com/jyknight updated https://github.com/llvm/llvm-project/pull/66576 >From 209a8f9c06a7633737e9f022bc4e61d580ad95e7 Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Sat, 16 Sep 2023 12:32:21 + Subject: [PATCH 1/3] [libcxx] Allow string to use SSO in constant evaluation. P