diff --git a/libcxx/include/__chrono/formatter.h b/libcxx/include/__chrono/formatter.h --- a/libcxx/include/__chrono/formatter.h +++ b/libcxx/include/__chrono/formatter.h @@ -10,6 +10,7 @@ #ifndef _LIBCPP___CHRONO_FORMATTER_H #define _LIBCPP___CHRONO_FORMATTER_H +#include <__availability> #include <__chrono/convert_to_tm.h> #include <__chrono/day.h> #include <__chrono/parser_std_format_spec.h> diff --git a/libcxx/include/__chrono/parser_std_format_spec.h b/libcxx/include/__chrono/parser_std_format_spec.h --- a/libcxx/include/__chrono/parser_std_format_spec.h +++ b/libcxx/include/__chrono/parser_std_format_spec.h @@ -10,6 +10,7 @@ #ifndef _LIBCPP___CHRONO_PARSER_STD_FORMAT_SPEC_H #define _LIBCPP___CHRONO_PARSER_STD_FORMAT_SPEC_H +#include <__availability> #include <__config> #include <__format/concepts.h> #include <__format/format_error.h> @@ -68,73 +69,73 @@ return static_cast<__flags>(static_cast(__lhs) & static_cast(__rhs)); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_second(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_second(__flags __flags) { if ((__flags & __flags::__second) != __flags::__second) std::__throw_format_error("The supplied date time doesn't contain a second"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_minute(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_minute(__flags __flags) { if ((__flags & __flags::__minute) != __flags::__minute) std::__throw_format_error("The supplied date time doesn't contain a minute"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_hour(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_hour(__flags __flags) { if ((__flags & __flags::__hour) != __flags::__hour) std::__throw_format_error("The supplied date time doesn't contain an hour"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_time(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_time(__flags __flags) { if ((__flags & __flags::__time) != __flags::__time) std::__throw_format_error("The supplied date time doesn't contain a time"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_day(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_day(__flags __flags) { if ((__flags & __flags::__day) != __flags::__day) std::__throw_format_error("The supplied date time doesn't contain a day"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_month(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_month(__flags __flags) { if ((__flags & __flags::__month) != __flags::__month) std::__throw_format_error("The supplied date time doesn't contain a month"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_year(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_year(__flags __flags) { if ((__flags & __flags::__year) != __flags::__year) std::__throw_format_error("The supplied date time doesn't contain a year"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_date(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_date(__flags __flags) { if ((__flags & __flags::__date) != __flags::__date) std::__throw_format_error("The supplied date time doesn't contain a date"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_date_or_duration(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_date_or_duration(__flags __flags) { if (((__flags & __flags::__date) != __flags::__date) && ((__flags & __flags::__duration) != __flags::__duration)) std::__throw_format_error("The supplied date time doesn't contain a date or duration"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_date_time(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_date_time(__flags __flags) { if ((__flags & __flags::__date_time) != __flags::__date_time) std::__throw_format_error("The supplied date time doesn't contain a date and time"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_weekday(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_weekday(__flags __flags) { if ((__flags & __flags::__weekday) != __flags::__weekday) std::__throw_format_error("The supplied date time doesn't contain a weekday"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_duration(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_duration(__flags __flags) { if ((__flags & __flags::__duration) != __flags::__duration) std::__throw_format_error("The supplied date time doesn't contain a duration"); } -_LIBCPP_HIDE_FROM_ABI constexpr void __validate_time_zone(__flags __flags) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __validate_time_zone(__flags __flags) { if ((__flags & __flags::__time_zone) != __flags::__time_zone) std::__throw_format_error("The supplied date time doesn't contain a time zone"); } template -class _LIBCPP_TEMPLATE_VIS __parser_chrono { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __parser_chrono { public: _LIBCPP_HIDE_FROM_ABI constexpr auto __parse(basic_format_parse_context<_CharT>& __parse_ctx, __fields __fields, __flags __flags) diff --git a/libcxx/include/__format/buffer.h b/libcxx/include/__format/buffer.h --- a/libcxx/include/__format/buffer.h +++ b/libcxx/include/__format/buffer.h @@ -16,6 +16,7 @@ #include <__algorithm/min.h> #include <__algorithm/transform.h> #include <__algorithm/unwrap_iter.h> +#include <__availability> #include <__config> #include <__format/concepts.h> #include <__format/enable_insertable.h> @@ -50,7 +51,7 @@ /// type-erasure for the formatting functions. This reduces the number to /// template instantiations. template <__fmt_char_type _CharT> -class _LIBCPP_TEMPLATE_VIS __output_buffer { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __output_buffer { public: using value_type = _CharT; @@ -223,7 +224,7 @@ /// This storage is used when writing a single element to the output iterator /// is expensive. template <__fmt_char_type _CharT> -class _LIBCPP_TEMPLATE_VIS __internal_storage { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __internal_storage { public: _LIBCPP_HIDE_FROM_ABI _CharT* __begin() { return __buffer_; } @@ -239,7 +240,7 @@ /// Since the output is directly written to the underlying storage this class /// is just an empty class. template <__fmt_char_type _CharT> -class _LIBCPP_TEMPLATE_VIS __direct_storage {}; +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __direct_storage {}; template concept __enable_direct_output = __fmt_char_type<_CharT> && @@ -251,7 +252,7 @@ /// Write policy for directly writing to the underlying output. template -class _LIBCPP_TEMPLATE_VIS __writer_direct { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __writer_direct { public: _LIBCPP_HIDE_FROM_ABI explicit __writer_direct(_OutIt __out_it) : __out_it_(__out_it) {} @@ -270,7 +271,7 @@ /// Write policy for copying the buffer to the output. template -class _LIBCPP_TEMPLATE_VIS __writer_iterator { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __writer_iterator { public: _LIBCPP_HIDE_FROM_ABI explicit __writer_iterator(_OutIt __out_it) : __out_it_{_VSTD::move(__out_it)} {} @@ -300,18 +301,18 @@ /// Extract the container type of a \ref back_insert_iterator. template -struct _LIBCPP_TEMPLATE_VIS __back_insert_iterator_container { +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __back_insert_iterator_container { using type = void; }; template <__insertable _Container> -struct _LIBCPP_TEMPLATE_VIS __back_insert_iterator_container> { +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __back_insert_iterator_container> { using type = _Container; }; /// Write policy for inserting the buffer in a container. template -class _LIBCPP_TEMPLATE_VIS __writer_container { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __writer_container { public: using _CharT = typename _Container::value_type; @@ -330,7 +331,7 @@ /// Selects the type of the writer used for the output iterator. template -class _LIBCPP_TEMPLATE_VIS __writer_selector { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __writer_selector { using _Container = typename __back_insert_iterator_container<_OutIt>::type; public: @@ -341,7 +342,7 @@ /// The generic formatting buffer. template -requires(output_iterator<_OutIt, const _CharT&>) class _LIBCPP_TEMPLATE_VIS +requires(output_iterator<_OutIt, const _CharT&>) class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __format_buffer { using _Storage = conditional_t<__enable_direct_output<_OutIt, _CharT>, @@ -377,7 +378,7 @@ /// Since \ref formatted_size only needs to know the size, the output itself is /// discarded. template <__fmt_char_type _CharT> -class _LIBCPP_TEMPLATE_VIS __formatted_size_buffer { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatted_size_buffer { public: _LIBCPP_HIDE_FROM_ABI auto __make_output_iterator() { return __output_.__make_output_iterator(); } @@ -397,7 +398,7 @@ /// The base of a buffer that counts and limits the number of insertions. template requires(output_iterator<_OutIt, const _CharT&>) -struct _LIBCPP_TEMPLATE_VIS __format_to_n_buffer_base { +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __format_to_n_buffer_base { using _Size = iter_difference_t<_OutIt>; public: @@ -427,7 +428,7 @@ /// exceed the maximum number of code units. template requires(output_iterator<_OutIt, const _CharT&>) -class _LIBCPP_TEMPLATE_VIS __format_to_n_buffer_base<_OutIt, _CharT, true> { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __format_to_n_buffer_base<_OutIt, _CharT, true> { using _Size = iter_difference_t<_OutIt>; public: @@ -477,7 +478,7 @@ /// The buffer that counts and limits the number of insertions. template requires(output_iterator<_OutIt, const _CharT&>) -struct _LIBCPP_TEMPLATE_VIS __format_to_n_buffer final +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __format_to_n_buffer final : public __format_to_n_buffer_base< _OutIt, _CharT, __enable_direct_output<_OutIt, _CharT>> { using _Base = __format_to_n_buffer_base<_OutIt, _CharT, __enable_direct_output<_OutIt, _CharT>>; using _Size = iter_difference_t<_OutIt>; @@ -492,6 +493,7 @@ return {_VSTD::move(this->__writer_).__out_it(), this->__size_}; } }; + } // namespace __format #endif //_LIBCPP_STD_VER > 17 diff --git a/libcxx/include/__format/format_arg.h b/libcxx/include/__format/format_arg.h --- a/libcxx/include/__format/format_arg.h +++ b/libcxx/include/__format/format_arg.h @@ -11,6 +11,7 @@ #define _LIBCPP___FORMAT_FORMAT_ARG_H #include <__assert> +#include <__availability> #include <__concepts/arithmetic.h> #include <__config> #include <__format/format_error.h> @@ -140,7 +141,7 @@ /// This is a separate type so it's possible to store the values and types in /// separate arrays. template -class __basic_format_arg_value { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __basic_format_arg_value { using _CharT = typename _Context::char_type; public: @@ -218,7 +219,7 @@ template class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg { public: - class _LIBCPP_TEMPLATE_VIS handle; + class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT handle; _LIBCPP_HIDE_FROM_ABI basic_format_arg() noexcept : __type_{__format::__arg_t::__none} {} @@ -251,7 +252,7 @@ }; template -class _LIBCPP_TEMPLATE_VIS basic_format_arg<_Context>::handle { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg<_Context>::handle { public: _LIBCPP_HIDE_FROM_ABI void format(basic_format_parse_context& __parse_ctx, _Context& __ctx) const { diff --git a/libcxx/include/__format/format_context.h b/libcxx/include/__format/format_context.h --- a/libcxx/include/__format/format_context.h +++ b/libcxx/include/__format/format_context.h @@ -45,7 +45,7 @@ * This is needed since the constructor is private. */ template -_LIBCPP_HIDE_FROM_ABI basic_format_context<_OutIt, _CharT> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_format_context<_OutIt, _CharT> __format_context_create( _OutIt __out_it, basic_format_args> __args, @@ -55,7 +55,7 @@ } #else template -_LIBCPP_HIDE_FROM_ABI basic_format_context<_OutIt, _CharT> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_format_context<_OutIt, _CharT> __format_context_create( _OutIt __out_it, basic_format_args> __args) { diff --git a/libcxx/include/__format/format_functions.h b/libcxx/include/__format/format_functions.h --- a/libcxx/include/__format/format_functions.h +++ b/libcxx/include/__format/format_functions.h @@ -10,10 +10,6 @@ #ifndef _LIBCPP___FORMAT_FORMAT_FUNCTIONS #define _LIBCPP___FORMAT_FORMAT_FUNCTIONS -// TODO FMT This is added to fix Apple back-deployment. -#include -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) - #include <__algorithm/clamp.h> #include <__availability> #include <__concepts/convertible_to.h> @@ -85,7 +81,7 @@ /// When parsing a handle which is not enabled the code is ill-formed. /// This helper uses the parser of the appropriate formatter for the stored type. template -class _LIBCPP_TEMPLATE_VIS __compile_time_handle { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __compile_time_handle { public: _LIBCPP_HIDE_FROM_ABI constexpr void __parse(basic_format_parse_context<_CharT>& __parse_ctx) const { __parse_(__parse_ctx); } @@ -110,7 +106,7 @@ // Dummy format_context only providing the parts used during constant // validation of the basic_format_string. template -struct _LIBCPP_TEMPLATE_VIS __compile_time_basic_format_context { +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __compile_time_basic_format_context { public: using char_type = _CharT; @@ -147,7 +143,7 @@ size_t __size_; }; -_LIBCPP_HIDE_FROM_ABI +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __compile_time_validate_integral(__arg_t __type) { switch (__type) { case __arg_t::__int: @@ -165,7 +161,7 @@ // _HasPrecision does the formatter have a precision? template -_LIBCPP_HIDE_FROM_ABI constexpr void +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __compile_time_validate_argument(basic_format_parse_context<_CharT>& __parse_ctx, __compile_time_basic_format_context<_CharT>& __ctx) { formatter<_Tp, _CharT> __formatter; @@ -185,9 +181,10 @@ } template -_LIBCPP_HIDE_FROM_ABI constexpr void __compile_time_visit_format_arg(basic_format_parse_context<_CharT>& __parse_ctx, - __compile_time_basic_format_context<_CharT>& __ctx, - __arg_t __type) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __compile_time_visit_format_arg( + basic_format_parse_context<_CharT>& __parse_ctx, + __compile_time_basic_format_context<_CharT>& __ctx, + __arg_t __type) { switch (__type) { case __arg_t::__none: __throw_format_error("Invalid argument"); @@ -236,7 +233,7 @@ } template -_LIBCPP_HIDE_FROM_ABI constexpr const _CharT* +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr const _CharT* __handle_replacement_field(const _CharT* __begin, const _CharT* __end, _ParseCtx& __parse_ctx, _Ctx& __ctx) { __format::__parse_number_result __r = @@ -287,7 +284,7 @@ } template -_LIBCPP_HIDE_FROM_ABI constexpr typename _Ctx::iterator +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr typename _Ctx::iterator __vformat_to(_ParseCtx&& __parse_ctx, _Ctx&& __ctx) { using _CharT = typename _ParseCtx::char_type; static_assert(same_as); @@ -341,7 +338,7 @@ _Context{__types_.data(), __handles_.data(), sizeof...(_Args)}); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr basic_string_view<_CharT> get() const noexcept { + _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<_CharT> get() const noexcept { return __str_; } @@ -387,18 +384,18 @@ #endif template -requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt +/*requires(output_iterator<_OutIt, const _CharT&>)*/ _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt __vformat_to( _OutIt __out_it, basic_string_view<_CharT> __fmt, basic_format_args> __args) { if constexpr (same_as<_OutIt, _FormatOutIt>) return _VSTD::__format::__vformat_to( - basic_format_parse_context{__fmt, __args.__size()}, + basic_format_parse_context<_CharT>{__fmt, __args.__size()}, _VSTD::__format_context_create(_VSTD::move(__out_it), __args)); else { __format::__format_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it)}; _VSTD::__format::__vformat_to( - basic_format_parse_context{__fmt, __args.__size()}, + basic_format_parse_context<_CharT>{__fmt, __args.__size()}, _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args)); return _VSTD::move(__buffer).__out_it(); @@ -409,14 +406,14 @@ // https://reviews.llvm.org/D110499#inline-1180704 // TODO FMT Evaluate whether we want to file a Clang bug report regarding this. template _OutIt> -_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt +/*_LIBCPP_ALWAYS_INLINE*/ _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt vformat_to(_OutIt __out_it, string_view __fmt, format_args __args) { return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args); } #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _OutIt> -_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt +/*_LIBCPP_ALWAYS_INLINE*/ _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt vformat_to(_OutIt __out_it, wstring_view __fmt, wformat_args __args) { return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args); } @@ -438,7 +435,7 @@ } #endif -_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string +/*_LIBCPP_ALWAYS_INLINE*/ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string vformat(string_view __fmt, format_args __args) { string __res; _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args); @@ -446,7 +443,7 @@ } #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring +/*_LIBCPP_ALWAYS_INLINE */inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring vformat(wstring_view __fmt, wformat_args __args) { wstring __res; _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args); @@ -469,11 +466,13 @@ #endif template -_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, - basic_string_view<_CharT> __fmt, - basic_format_args<_Context> __args) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> +__vformat_to_n(_OutIt __out_it, + iter_difference_t<_OutIt> __n, + basic_string_view<_CharT> __fmt, + basic_format_args<_Context> __args) { __format::__format_to_n_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it), __n}; - _VSTD::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()}, + _VSTD::__format::__vformat_to(basic_format_parse_context<_CharT>{__fmt, __args.__size()}, _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args)); return _VSTD::move(__buffer).__result(); } @@ -494,9 +493,10 @@ #endif template -_LIBCPP_HIDE_FROM_ABI size_t __vformatted_size(basic_string_view<_CharT> __fmt, auto __args) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t +__vformatted_size(basic_string_view<_CharT> __fmt, auto __args) { __format::__formatted_size_buffer<_CharT> __buffer; - _VSTD::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()}, + _VSTD::__format::__vformat_to(basic_format_parse_context<_CharT>{__fmt, __args.__size()}, _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args)); return _VSTD::move(__buffer).__result(); } @@ -518,19 +518,19 @@ #ifndef _LIBCPP_HAS_NO_LOCALIZATION template -requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt +requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt __vformat_to( _OutIt __out_it, locale __loc, basic_string_view<_CharT> __fmt, basic_format_args> __args) { if constexpr (same_as<_OutIt, _FormatOutIt>) return _VSTD::__format::__vformat_to( - basic_format_parse_context{__fmt, __args.__size()}, + basic_format_parse_context<_CharT>{__fmt, __args.__size()}, _VSTD::__format_context_create(_VSTD::move(__out_it), __args, _VSTD::move(__loc))); else { __format::__format_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it)}; _VSTD::__format::__vformat_to( - basic_format_parse_context{__fmt, __args.__size()}, + basic_format_parse_context<_CharT>{__fmt, __args.__size()}, _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args, _VSTD::move(__loc))); return _VSTD::move(__buffer).__out_it(); @@ -605,12 +605,15 @@ #endif template -_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, - locale __loc, basic_string_view<_CharT> __fmt, - basic_format_args<_Context> __args) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> __vformat_to_n( + _OutIt __out_it, + iter_difference_t<_OutIt> __n, + locale __loc, + basic_string_view<_CharT> __fmt, + basic_format_args<_Context> __args) { __format::__format_to_n_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it), __n}; _VSTD::__format::__vformat_to( - basic_format_parse_context{__fmt, __args.__size()}, + basic_format_parse_context<_CharT>{__fmt, __args.__size()}, _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args, _VSTD::move(__loc))); return _VSTD::move(__buffer).__result(); } @@ -634,10 +637,11 @@ #endif template -_LIBCPP_HIDE_FROM_ABI size_t __vformatted_size(locale __loc, basic_string_view<_CharT> __fmt, auto __args) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t +__vformatted_size(locale __loc, basic_string_view<_CharT> __fmt, auto __args) { __format::__formatted_size_buffer<_CharT> __buffer; _VSTD::__format::__vformat_to( - basic_format_parse_context{__fmt, __args.__size()}, + basic_format_parse_context<_CharT> {__fmt, __args.__size()}, _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args, _VSTD::move(__loc))); return _VSTD::move(__buffer).__result(); } @@ -658,11 +662,8 @@ #endif // _LIBCPP_HAS_NO_LOCALIZATION - #endif //_LIBCPP_STD_VER > 17 _LIBCPP_END_NAMESPACE_STD -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) - #endif // _LIBCPP___FORMAT_FORMAT_FUNCTIONS diff --git a/libcxx/include/__format/format_parse_context.h b/libcxx/include/__format/format_parse_context.h --- a/libcxx/include/__format/format_parse_context.h +++ b/libcxx/include/__format/format_parse_context.h @@ -10,6 +10,7 @@ #ifndef _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H #define _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H +#include <__availability> #include <__config> #include <__format/format_error.h> #include diff --git a/libcxx/include/__format/formatter_floating_point.h b/libcxx/include/__format/formatter_floating_point.h --- a/libcxx/include/__format/formatter_floating_point.h +++ b/libcxx/include/__format/formatter_floating_point.h @@ -16,6 +16,7 @@ #include <__algorithm/min.h> #include <__algorithm/rotate.h> #include <__algorithm/transform.h> +#include <__availability> #include <__concepts/arithmetic.h> #include <__concepts/same_as.h> #include <__config> @@ -132,7 +133,7 @@ /// Depending on the maxium size required for a value, the buffer is allocated /// on the stack or the heap. template -class _LIBCPP_TEMPLATE_VIS __float_buffer { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __float_buffer { using _Traits = __traits<_Fp>; public: @@ -214,7 +215,7 @@ /// eSdd and eSdddd (S = sign, d = digit) /// /// \returns a pointer to the exponent or __last when not found. -constexpr inline _LIBCPP_HIDE_FROM_ABI char* __find_exponent(char* __first, char* __last) { +constexpr inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT char* __find_exponent(char* __first, char* __last) { ptrdiff_t __size = __last - __first; if (__size >= 4) { __first = __last - _VSTD::min(__size, ptrdiff_t(6)); @@ -227,7 +228,7 @@ } template -_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_default(const __float_buffer<_Fp>& __buffer, _Tp __value, +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT __float_result __format_buffer_default(const __float_buffer<_Fp>& __buffer, _Tp __value, char* __integral) { __float_result __result; __result.__integral = __integral; @@ -256,7 +257,7 @@ } template -_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_hexadecimal_lower_case(const __float_buffer<_Fp>& __buffer, +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT __float_result __format_buffer_hexadecimal_lower_case(const __float_buffer<_Fp>& __buffer, _Tp __value, int __precision, char* __integral) { __float_result __result; @@ -309,7 +310,7 @@ } template -_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_hexadecimal_upper_case(const __float_buffer<_Fp>& __buffer, +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT __float_result __format_buffer_hexadecimal_upper_case(const __float_buffer<_Fp>& __buffer, _Tp __value, int __precision, char* __integral) { __float_result __result = @@ -320,7 +321,7 @@ } template -_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_scientific_lower_case(const __float_buffer<_Fp>& __buffer, +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT __float_result __format_buffer_scientific_lower_case(const __float_buffer<_Fp>& __buffer, _Tp __value, int __precision, char* __integral) { __float_result __result; @@ -348,7 +349,7 @@ } template -_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_scientific_upper_case(const __float_buffer<_Fp>& __buffer, +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT __float_result __format_buffer_scientific_upper_case(const __float_buffer<_Fp>& __buffer, _Tp __value, int __precision, char* __integral) { __float_result __result = @@ -358,7 +359,7 @@ } template -_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_fixed(const __float_buffer<_Fp>& __buffer, _Tp __value, +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT __float_result __format_buffer_fixed(const __float_buffer<_Fp>& __buffer, _Tp __value, int __precision, char* __integral) { __float_result __result; __result.__integral = __integral; @@ -381,7 +382,7 @@ } template -_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_general_lower_case(__float_buffer<_Fp>& __buffer, _Tp __value, +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT __float_result __format_buffer_general_lower_case(__float_buffer<_Fp>& __buffer, _Tp __value, int __precision, char* __integral) { __buffer.__remove_trailing_zeros(); @@ -420,7 +421,7 @@ } template -_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_general_upper_case(__float_buffer<_Fp>& __buffer, _Tp __value, +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT __float_result __format_buffer_general_upper_case(__float_buffer<_Fp>& __buffer, _Tp __value, int __precision, char* __integral) { __float_result __result = __formatter::__format_buffer_general_lower_case(__buffer, __value, __precision, __integral); if (__result.__exponent != __result.__last) @@ -445,7 +446,7 @@ /// - localization needs to do grouping in the integral part. template // TODO FMT _Fp should just be _Tp when to_chars has proper long double support. -_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer( +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT __float_result __format_buffer( __float_buffer<_Fp>& __buffer, _Tp __value, bool __negative, @@ -492,7 +493,7 @@ # ifndef _LIBCPP_HAS_NO_LOCALIZATION template -_LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form( +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt __format_locale_specific_form( _OutIt __out_it, const __float_buffer<_Fp>& __buffer, const __float_result& __result, @@ -578,7 +579,7 @@ # endif // _LIBCPP_HAS_NO_LOCALIZATION template -_LIBCPP_HIDE_FROM_ABI _OutIt __format_floating_point_non_finite( +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt __format_floating_point_non_finite( _OutIt __out_it, __format_spec::__parsed_specifications<_CharT> __specs, bool __negative, bool __isnan) { char __buffer[4]; char* __last = __formatter::__insert_sign(__buffer, __negative, __specs.__std_.__sign_); @@ -604,7 +605,7 @@ } template -_LIBCPP_HIDE_FROM_ABI auto +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT auto __format_floating_point(_Tp __value, auto& __ctx, __format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__ctx.out()) { bool __negative = _VSTD::signbit(__value); @@ -721,7 +722,7 @@ } // namespace __formatter template <__fmt_char_type _CharT> -struct _LIBCPP_TEMPLATE_VIS __formatter_floating_point { +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_floating_point { public: _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) { diff --git a/libcxx/include/__format/formatter_pointer.h b/libcxx/include/__format/formatter_pointer.h --- a/libcxx/include/__format/formatter_pointer.h +++ b/libcxx/include/__format/formatter_pointer.h @@ -30,7 +30,7 @@ #if _LIBCPP_STD_VER > 17 template <__fmt_char_type _CharT> -struct _LIBCPP_TEMPLATE_VIS __formatter_pointer { +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_pointer { public: constexpr __formatter_pointer() { __parser_.__alignment_ = __format_spec::__alignment::__right; } diff --git a/libcxx/include/__format/formatter_string.h b/libcxx/include/__format/formatter_string.h --- a/libcxx/include/__format/formatter_string.h +++ b/libcxx/include/__format/formatter_string.h @@ -30,7 +30,7 @@ #if _LIBCPP_STD_VER > 17 template <__fmt_char_type _CharT> -struct _LIBCPP_TEMPLATE_VIS __formatter_string { +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_string { public: _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) { diff --git a/libcxx/include/__format/parser_std_format_spec.h b/libcxx/include/__format/parser_std_format_spec.h --- a/libcxx/include/__format/parser_std_format_spec.h +++ b/libcxx/include/__format/parser_std_format_spec.h @@ -19,6 +19,7 @@ #include <__algorithm/find_if.h> #include <__algorithm/min.h> #include <__assert> +#include <__availability> #include <__config> #include <__debug> #include <__format/format_arg.h> @@ -47,7 +48,7 @@ namespace __format_spec { template -_LIBCPP_HIDE_FROM_ABI constexpr __format::__parse_number_result< _CharT> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr __format::__parse_number_result< _CharT> __parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) { // This function is a wrapper to call the real parser. But it does the // validation for the pre-conditions and post-conditions. @@ -65,7 +66,7 @@ } template -_LIBCPP_HIDE_FROM_ABI constexpr uint32_t +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr uint32_t __substitute_arg_id(basic_format_arg<_Context> __format_arg) { return visit_format_arg( [](auto __arg) -> uint32_t { @@ -241,7 +242,7 @@ /// set to zero. That way they can be repurposed if a future revision of the /// Standards adds new fields to std-format-spec. template -class _LIBCPP_TEMPLATE_VIS __parser { +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __parser { public: _LIBCPP_HIDE_FROM_ABI constexpr auto __parse(basic_format_parse_context<_CharT>& __parse_ctx, __fields __fields) -> decltype(__parse_ctx.begin()) { @@ -563,7 +564,7 @@ static_assert(sizeof(__parser) == 16); # endif -_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_string(__format_spec::__type __type) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __process_display_type_string(__format_spec::__type __type) { switch (__type) { case __format_spec::__type::__default: case __format_spec::__type::__string: @@ -575,7 +576,7 @@ } template -_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_bool_string(__parser<_CharT>& __parser) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __process_display_type_bool_string(__parser<_CharT>& __parser) { if (__parser.__sign_ != __sign::__default) std::__throw_format_error("A sign field isn't allowed in this format-spec"); @@ -590,12 +591,12 @@ } template -_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_char(__parser<_CharT>& __parser) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __process_display_type_char(__parser<_CharT>& __parser) { __format_spec::__process_display_type_bool_string(__parser); } template -_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_bool(__parser<_CharT>& __parser) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __process_parsed_bool(__parser<_CharT>& __parser) { switch (__parser.__type_) { case __format_spec::__type::__default: case __format_spec::__type::__string: @@ -616,7 +617,7 @@ } template -_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_char(__parser<_CharT>& __parser) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __process_parsed_char(__parser<_CharT>& __parser) { switch (__parser.__type_) { case __format_spec::__type::__default: case __format_spec::__type::__char: @@ -637,7 +638,7 @@ } template -_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_integer(__parser<_CharT>& __parser) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __process_parsed_integer(__parser<_CharT>& __parser) { switch (__parser.__type_) { case __format_spec::__type::__default: case __format_spec::__type::__binary_lower_case: @@ -658,7 +659,7 @@ } template -_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_floating_point(__parser<_CharT>& __parser) { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr void __process_parsed_floating_point(__parser<_CharT>& __parser) { switch (__parser.__type_) { case __format_spec::__type::__default: case __format_spec::__type::__hexfloat_lower_case: @@ -723,7 +724,7 @@ /// /// This version expects a value less than 0x1'0000, which is a 3-byte UTF-8 /// character. -_LIBCPP_HIDE_FROM_ABI constexpr int __column_width_3(uint32_t __c) noexcept { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr int __column_width_3(uint32_t __c) noexcept { _LIBCPP_ASSERT(__c < 0x10000, "Use __column_width_4 or __column_width for larger values"); // clang-format off @@ -745,7 +746,7 @@ /// /// This version expects a value greater than or equal to 0x1'0000, which is a /// 4-byte UTF-8 character. -_LIBCPP_HIDE_FROM_ABI constexpr int __column_width_4(uint32_t __c) noexcept { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr int __column_width_4(uint32_t __c) noexcept { _LIBCPP_ASSERT(__c >= 0x10000, "Use __column_width_3 or __column_width for smaller values"); // clang-format off @@ -760,7 +761,7 @@ /// @overload /// /// The general case, accepting all values. -_LIBCPP_HIDE_FROM_ABI constexpr int __column_width(uint32_t __c) noexcept { +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr int __column_width(uint32_t __c) noexcept { if (__c < 0x10000) return __detail::__column_width_3(__c); @@ -768,7 +769,7 @@ } template -_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_width_grapheme_clustering( +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr __column_width_result<_CharT> __estimate_column_width_grapheme_clustering( const _CharT* __first, const _CharT* __last, size_t __maximum, __column_width_rounding __rounding) noexcept { __unicode::__extended_grapheme_cluster_view<_CharT> __view{__first, __last}; @@ -840,7 +841,7 @@ /// \c __down result.__width_ <= __maximum /// \c __up result.__width_ <= __maximum + 1 template -_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_width( +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr __column_width_result<_CharT> __estimate_column_width( basic_string_view<_CharT> __str, size_t __maximum, __column_width_rounding __rounding) noexcept { // The width estimation is done in two steps: // - Quickly process for the ASCII part. ASCII has the following properties @@ -887,7 +888,7 @@ } # else // !defined(_LIBCPP_HAS_NO_UNICODE) template -_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr __column_width_result<_CharT> __estimate_column_width(basic_string_view<_CharT> __str, size_t __maximum, __column_width_rounding) noexcept { // When Unicode isn't supported assume ASCII and every code unit is one code // point. In ASCII the estimated column width is always one. Thus there's no diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -26,964 +26,17 @@ LLVM_HEAD_VERSION: "16" GCC_STABLE_VERSION: "12" steps: - # - # Light pre-commit tests for things like formatting or when people forget - # to update generated files. - # - - label: "Format" - command: "libcxx/utils/ci/run-buildbot check-format" - artifact_paths: - - "**/clang-format.patch" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - soft_fail: - - exit_status: 1 - timeout_in_minutes: 120 - - - label: "Generated output" - command: "libcxx/utils/ci/run-buildbot check-generated-output" - artifact_paths: - - "**/generated_output.patch" - - "**/generated_output.status" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Documentation" - command: "libcxx/utils/ci/run-buildbot documentation" - artifact_paths: - - "**/test-results.xml" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - # - # General testing with the default configuration, under all the supported - # Standard modes, with Clang and GCC. This catches most issues upfront. - # The goal of this step is to catch most issues while being very fast. - # - - wait - - - label: "C++2b" - command: "libcxx/utils/ci/run-buildbot generic-cxx2b" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "C++11" - command: "libcxx/utils/ci/run-buildbot generic-cxx11" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "C++03" - command: "libcxx/utils/ci/run-buildbot generic-cxx03" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Modular build" - command: "libcxx/utils/ci/run-buildbot generic-modules" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "GCC ${GCC_STABLE_VERSION} / C++latest" - command: "libcxx/utils/ci/run-buildbot generic-gcc" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "gcc-${GCC_STABLE_VERSION}" - CXX: "g++-${GCC_STABLE_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - # - # All other supported configurations of libc++. - # - - wait - - - label: "C++20" - command: "libcxx/utils/ci/run-buildbot generic-cxx20" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "C++17" - command: "libcxx/utils/ci/run-buildbot generic-cxx17" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "C++14" - command: "libcxx/utils/ci/run-buildbot generic-cxx14" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - # Tests with the supported compilers. - - label: "GCC ${GCC_STABLE_VERSION} / C++11" - command: "libcxx/utils/ci/run-buildbot generic-gcc-cxx11" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "gcc-${GCC_STABLE_VERSION}" - CXX: "g++-${GCC_STABLE_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Clang 14" - command: "libcxx/utils/ci/run-buildbot generic-cxx2b" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-14" - CXX: "clang++-14" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Clang 15" - command: "libcxx/utils/ci/run-buildbot generic-cxx2b" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-15" - CXX: "clang++-15" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - # Tests with the sanitizers. - - group: "Sanitizers" - steps: - - label: "ASAN" - command: "libcxx/utils/ci/run-buildbot generic-asan" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "TSAN" - command: "libcxx/utils/ci/run-buildbot generic-tsan" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "UBSAN" - command: "libcxx/utils/ci/run-buildbot generic-ubsan" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "MSAN" - command: "libcxx/utils/ci/run-buildbot generic-msan" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - # Tests with the various supported ways to build libc++. - - label: "Bootstrapping build" - command: "libcxx/utils/ci/run-buildbot bootstrapping-build" + - label: "Apple back-deployment macosx10.9" + command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-10.9" artifact_paths: - "**/test-results.xml" - "**/*.abilist" - - "**/crash_diagnostics/*" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-${LLVM_HEAD_VERSION}" - CLANG_CRASH_DIAGNOSTICS_DIR: "crash_diagnostics" agents: queue: "libcxx-builders" - os: "linux" + os: "macos" + arch: "x86_64" # We need to use x86_64 for back-deployment CI on this target since macOS didn't support arm64 back then. retry: automatic: - exit_status: -1 # Agent was lost limit: 2 timeout_in_minutes: 120 - - - group: "Legacy" - steps: - - label: "Legacy Lit configuration" - command: "libcxx/utils/ci/run-buildbot legacy-test-config" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Legacy LLVM_ENABLE_PROJECTS build" - command: "libcxx/utils/ci/run-buildbot legacy-project-build" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - # Tests with various build configurations. - - label: "Static libraries" - command: "libcxx/utils/ci/run-buildbot generic-static" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Shared library with merged ABI and unwinder libraries" - command: "libcxx/utils/ci/run-buildbot generic-merged" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Assertions enabled" - command: "libcxx/utils/ci/run-buildbot generic-assertions" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Debug mode" - command: "libcxx/utils/ci/run-buildbot generic-debug-mode" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "No transitive includes" - command: "libcxx/utils/ci/run-buildbot generic-no-transitive-includes" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "With LLVM's libunwind" - command: "libcxx/utils/ci/run-buildbot generic-with_llvm_unwinder" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - group: "Parts disabled" - steps: - - label: "No threads" - command: "libcxx/utils/ci/run-buildbot generic-no-threads" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "No filesystem" - command: "libcxx/utils/ci/run-buildbot generic-no-filesystem" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "No random device" - command: "libcxx/utils/ci/run-buildbot generic-no-random_device" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "No locale" - command: "libcxx/utils/ci/run-buildbot generic-no-localization" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "No Unicode" - command: "libcxx/utils/ci/run-buildbot generic-no-unicode" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "No wide characters" - command: "libcxx/utils/ci/run-buildbot generic-no-wide-characters" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "No experimental features" - command: "libcxx/utils/ci/run-buildbot generic-no-experimental" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "No exceptions" - command: "libcxx/utils/ci/run-buildbot generic-noexceptions" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Unstable ABI" - command: "libcxx/utils/ci/run-buildbot generic-abi-unstable" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - # Other non-testing CI jobs - - label: "Benchmarks" - command: "libcxx/utils/ci/run-buildbot benchmarks" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - # Tests on non-Unix platforms - - group: ":windows: Windows" - steps: - - label: "Clang-cl (DLL)" - command: "bash libcxx/utils/ci/run-buildbot clang-cl-dll" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "windows" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Clang-cl (Static)" - command: "bash libcxx/utils/ci/run-buildbot clang-cl-static" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "windows" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Clang-cl (no vcruntime exceptions)" - command: "bash libcxx/utils/ci/run-buildbot clang-cl-no-vcruntime" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "windows" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - - - label: "MinGW (DLL, x86_64)" - command: "bash libcxx/utils/ci/run-buildbot mingw-dll" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "windows" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "MinGW (Static, x86_64)" - command: "bash libcxx/utils/ci/run-buildbot mingw-static" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "windows" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "MinGW (DLL, i686)" - command: "bash libcxx/utils/ci/run-buildbot mingw-dll-i686" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "windows" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - group: ":apple: Apple" - steps: - - label: "MacOS x86_64" - command: "libcxx/utils/ci/run-buildbot generic-cxx20" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders" - os: "macos" - arch: "x86_64" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "MacOS arm64" - command: "libcxx/utils/ci/run-buildbot generic-cxx20" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders" - os: "macos" - arch: "arm64" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - # Build with the configuration we use to generate libc++.dylib on Apple platforms - - label: "Apple system" - command: "libcxx/utils/ci/run-buildbot apple-system" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders" - os: "macos" - arch: "arm64" # This can technically run on any architecture, but we have more resources on arm64 so we pin this job to arm64 - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - # Test back-deployment to older Apple platforms - - label: "Apple back-deployment macosx10.9" - command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-10.9" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders" - os: "macos" - arch: "x86_64" # We need to use x86_64 for back-deployment CI on this target since macOS didn't support arm64 back then. - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Apple back-deployment macosx10.15" - command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-10.15" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders" - os: "macos" - arch: "x86_64" # We need to use x86_64 for back-deployment CI on this target since macOS didn't support arm64 back then. - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Apple back-deployment macosx11.0 arm64" - command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-11.0" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders" - os: "macos" - arch: "arm64" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Apple back-deployment with assertions enabled" - command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-assertions-11.0" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders" - os: "macos" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - group: "ARM" - steps: - - label: "AArch64" - command: "libcxx/utils/ci/run-buildbot aarch64" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders-linaro-arm" - arch: "aarch64" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "AArch64 -fno-exceptions" - command: "libcxx/utils/ci/run-buildbot aarch64-noexceptions" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders-linaro-arm" - arch: "aarch64" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Armv8" - command: "libcxx/utils/ci/run-buildbot armv8" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders-linaro-arm" - arch: "armv8l" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Armv8 -fno-exceptions" - command: "libcxx/utils/ci/run-buildbot armv8-noexceptions" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders-linaro-arm" - arch: "armv8l" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Armv7" - command: "libcxx/utils/ci/run-buildbot armv7" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders-linaro-arm" - arch: "armv8l" # Compiling for v7, running on v8 hardware - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "Armv7 -fno-exceptions" - command: "libcxx/utils/ci/run-buildbot armv7-noexceptions" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders-linaro-arm" - arch: "armv8l" # Compiling for v7, running on v8 hardware - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - group: "AIX" - steps: - - label: "AIX (32-bit)" - command: "libcxx/utils/ci/run-buildbot aix" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang" - CXX: "clang++" - OBJECT_MODE: "32" - agents: - queue: libcxx-builders - os: aix - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - - label: "AIX (64-bit)" - command: "libcxx/utils/ci/run-buildbot aix" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang" - CXX: "clang++" - OBJECT_MODE: "64" - agents: - queue: libcxx-builders - os: aix - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -402,9 +402,6 @@ PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}" PARAMS+=";use_system_cxx_lib=True" PARAMS+=";enable_assertions=True" - # TODO: Enable experimental features during back-deployment -- right now some of the availability - # annotations are incorrect, leading to test failures that could be avoided. - PARAMS+=";enable_experimental=False" generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \