diff options
author | Nikolas Klauser <nikolasklauser@berlin.de> | 2022-08-13 22:33:12 +0200 |
---|---|---|
committer | Nikolas Klauser <nikolasklauser@berlin.de> | 2022-12-23 15:42:13 +0100 |
commit | 841399a2188aaf244e83e3df7be66885ec905ede (patch) | |
tree | 0584ba9836530c245c45cf8537d4b26a1cdcffd4 /libcxx/include/__format | |
parent | 0026874c8bd0616b520779b9fcfdb05e53ea4dca (diff) | |
download | llvm-841399a2188aaf244e83e3df7be66885ec905ede.zip llvm-841399a2188aaf244e83e3df7be66885ec905ede.tar.gz llvm-841399a2188aaf244e83e3df7be66885ec905ede.tar.bz2 |
[libc++] Add custom clang-tidy checks
Reviewed By: #libc, ldionne
Spies: jwakely, beanz, smeenai, cfe-commits, tschuett, avogelsgesang, Mordante, sstefan1, libcxx-commits, ldionne, mgorny, arichardson, miyuki
Differential Revision: https://reviews.llvm.org/D131963
Diffstat (limited to 'libcxx/include/__format')
-rw-r--r-- | libcxx/include/__format/format_arg_store.h | 4 | ||||
-rw-r--r-- | libcxx/include/__format/format_functions.h | 2 | ||||
-rw-r--r-- | libcxx/include/__format/format_string.h | 2 | ||||
-rw-r--r-- | libcxx/include/__format/formatter_floating_point.h | 2 | ||||
-rw-r--r-- | libcxx/include/__format/formatter_integral.h | 6 | ||||
-rw-r--r-- | libcxx/include/__format/formatter_output.h | 12 | ||||
-rw-r--r-- | libcxx/include/__format/parser_std_format_spec.h | 6 |
7 files changed, 17 insertions, 17 deletions
diff --git a/libcxx/include/__format/format_arg_store.h b/libcxx/include/__format/format_arg_store.h index 1820c03..6f4f4c3 100644 --- a/libcxx/include/__format/format_arg_store.h +++ b/libcxx/include/__format/format_arg_store.h @@ -198,7 +198,7 @@ _LIBCPP_HIDE_FROM_ABI void __create_packed_storage(uint64_t& __types, __basic_fo int __shift = 0; ( [&] { - basic_format_arg<_Context> __arg = __create_format_arg<_Context>(__args); + basic_format_arg<_Context> __arg = __format::__create_format_arg<_Context>(__args); if (__shift != 0) __types |= static_cast<uint64_t>(__arg.__type_) << __shift; else @@ -212,7 +212,7 @@ _LIBCPP_HIDE_FROM_ABI void __create_packed_storage(uint64_t& __types, __basic_fo template <class _Context, class... _Args> _LIBCPP_HIDE_FROM_ABI void __store_basic_format_arg(basic_format_arg<_Context>* __data, _Args&&... __args) noexcept { - ([&] { *__data++ = __create_format_arg<_Context>(__args); }(), ...); + ([&] { *__data++ = __format::__create_format_arg<_Context>(__args); }(), ...); } template <class _Context, size_t N> diff --git a/libcxx/include/__format/format_functions.h b/libcxx/include/__format/format_functions.h index 7e3afd9..185148c 100644 --- a/libcxx/include/__format/format_functions.h +++ b/libcxx/include/__format/format_functions.h @@ -304,7 +304,7 @@ __vformat_to(_ParseCtx&& __parse_ctx, _Ctx&& __ctx) { if (*__begin != _CharT('{')) [[likely]] { __ctx.advance_to(_VSTD::move(__out_it)); __begin = - __handle_replacement_field(__begin, __end, __parse_ctx, __ctx); + __format::__handle_replacement_field(__begin, __end, __parse_ctx, __ctx); __out_it = __ctx.out(); // The output is written and __begin points to the next character. So diff --git a/libcxx/include/__format/format_string.h b/libcxx/include/__format/format_string.h index dc4e8df..d9caf86 100644 --- a/libcxx/include/__format/format_string.h +++ b/libcxx/include/__format/format_string.h @@ -73,7 +73,7 @@ __parse_automatic(const _CharT* __begin, const _CharT*, auto& __parse_ctx) { template <class _CharT> _LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT> __parse_manual(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) { - __parse_number_result<_CharT> __r = __parse_number(__begin, __end); + __parse_number_result<_CharT> __r = __format::__parse_number(__begin, __end); __parse_ctx.check_arg_id(__r.__value); return __r; } diff --git a/libcxx/include/__format/formatter_floating_point.h b/libcxx/include/__format/formatter_floating_point.h index 29b3711..a544b53 100644 --- a/libcxx/include/__format/formatter_floating_point.h +++ b/libcxx/include/__format/formatter_floating_point.h @@ -498,7 +498,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form( const __float_result& __result, _VSTD::locale __loc, __format_spec::__parsed_specifications<_CharT> __specs) { - const auto& __np = use_facet<numpunct<_CharT>>(__loc); + const auto& __np = std::use_facet<numpunct<_CharT>>(__loc); string __grouping = __np.grouping(); char* __first = __result.__integral; // When no radix point or exponent are present __last will be __result.__last. diff --git a/libcxx/include/__format/formatter_integral.h b/libcxx/include/__format/formatter_integral.h index 87c6d55..fe3a063 100644 --- a/libcxx/include/__format/formatter_integral.h +++ b/libcxx/include/__format/formatter_integral.h @@ -217,7 +217,7 @@ _LIBCPP_HIDE_FROM_ABI auto __format_integer( # ifndef _LIBCPP_HAS_NO_LOCALIZATION if (__specs.__std_.__locale_specific_form_) { - const auto& __np = use_facet<numpunct<_CharT>>(__ctx.locale()); + const auto& __np = std::use_facet<numpunct<_CharT>>(__ctx.locale()); string __grouping = __np.grouping(); ptrdiff_t __size = __last - __first; // Writing the grouped form has more overhead than the normal output @@ -310,7 +310,7 @@ __format_integer(_Tp __value, auto& __ctx, __format_spec::__parsed_specification auto __r = std::__to_unsigned_like(__value); bool __negative = __value < 0; if (__negative) - __r = __complement(__r); + __r = std::__complement(__r); return __formatter::__format_integer(__r, __ctx, __specs, __negative); } @@ -342,7 +342,7 @@ __format_bool(bool __value, auto& __ctx, __format_spec::__parsed_specifications< -> decltype(__ctx.out()) { # ifndef _LIBCPP_HAS_NO_LOCALIZATION if (__specs.__std_.__locale_specific_form_) { - const auto& __np = use_facet<numpunct<_CharT>>(__ctx.locale()); + const auto& __np = std::use_facet<numpunct<_CharT>>(__ctx.locale()); basic_string<_CharT> __str = __value ? __np.truename() : __np.falsename(); return __formatter::__write_string_no_precision(basic_string_view<_CharT>{__str}, __ctx.out(), __specs); } diff --git a/libcxx/include/__format/formatter_output.h b/libcxx/include/__format/formatter_output.h index adef574..70eae15 100644 --- a/libcxx/include/__format/formatter_output.h +++ b/libcxx/include/__format/formatter_output.h @@ -171,7 +171,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, c } else { if (__specs.__width_ > __size) { // Determine padding and write padding. - __padding = __padding_size(__size, __specs.__width_, __specs.__alignment_); + __padding = __formatter::__padding_size(__size, __specs.__width_, __specs.__alignment_); __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_); } @@ -285,7 +285,7 @@ _LIBCPP_HIDE_FROM_ABI auto __write_transformed(const _CharT* __first, const _Cha if (__size >= __specs.__width_) return __formatter::__transform(__first, __last, _VSTD::move(__out_it), __op); - __padding_size_result __padding = __padding_size(__size, __specs.__width_, __specs.__alignment_); + __padding_size_result __padding = __formatter::__padding_size(__size, __specs.__width_, __specs.__alignment_); __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_); __out_it = __formatter::__transform(__first, __last, _VSTD::move(__out_it), __op); return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_); @@ -312,7 +312,7 @@ _LIBCPP_HIDE_FROM_ABI auto __write_using_trailing_zeros( _LIBCPP_ASSERT(__num_trailing_zeros > 0, "The overload not writing trailing zeros should have been used"); __padding_size_result __padding = - __padding_size(__size + __num_trailing_zeros, __specs.__width_, __specs.__alignment_); + __formatter::__padding_size(__size + __num_trailing_zeros, __specs.__width_, __specs.__alignment_); __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_); __out_it = __formatter::__copy(__first, __exponent, _VSTD::move(__out_it)); __out_it = __formatter::__fill(_VSTD::move(__out_it), __num_trailing_zeros, _CharT('0')); @@ -368,7 +368,7 @@ _LIBCPP_HIDE_FROM_ABI auto __write_string( int __size = __formatter::__truncate(__str, __specs.__precision_); - return __write(__str.begin(), __str.end(), _VSTD::move(__out_it), __specs, __size); + return __formatter::__write(__str.begin(), __str.end(), _VSTD::move(__out_it), __specs, __size); } # if _LIBCPP_STD_VER > 20 @@ -401,7 +401,7 @@ __write_escaped_code_unit(basic_string<_CharT>& __str, char32_t __value, const _ // lower-case hexadecimal digits. template <class _CharT> _LIBCPP_HIDE_FROM_ABI void __write_well_formed_escaped_code_unit(basic_string<_CharT>& __str, char32_t __value) { - __write_escaped_code_unit(__str, __value, _LIBCPP_STATICALLY_WIDEN(_CharT, "\\u{")); + __formatter::__write_escaped_code_unit(__str, __value, _LIBCPP_STATICALLY_WIDEN(_CharT, "\\u{")); } // [format.string.escaped]/2.2.3 @@ -411,7 +411,7 @@ _LIBCPP_HIDE_FROM_ABI void __write_well_formed_escaped_code_unit(basic_string<_C // lower-case hexadecimal digits. template <class _CharT> _LIBCPP_HIDE_FROM_ABI void __write_escape_ill_formed_code_unit(basic_string<_CharT>& __str, char32_t __value) { - __write_escaped_code_unit(__str, __value, _LIBCPP_STATICALLY_WIDEN(_CharT, "\\x{")); + __formatter::__write_escaped_code_unit(__str, __value, _LIBCPP_STATICALLY_WIDEN(_CharT, "\\x{")); } template <class _CharT> diff --git a/libcxx/include/__format/parser_std_format_spec.h b/libcxx/include/__format/parser_std_format_spec.h index 26d7eb4..69623c6 100644 --- a/libcxx/include/__format/parser_std_format_spec.h +++ b/libcxx/include/__format/parser_std_format_spec.h @@ -891,7 +891,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_ // unit is non-ASCII we omit the current code unit and let the Grapheme // clustering algorithm do its work. const _CharT* __it = __str.begin(); - if (__is_ascii(*__it)) { + if (__format_spec::__is_ascii(*__it)) { do { --__maximum; ++__it; @@ -899,12 +899,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_ return {__str.size(), __str.end()}; if (__maximum == 0) { - if (__is_ascii(*__it)) + if (__format_spec::__is_ascii(*__it)) return {static_cast<size_t>(__it - __str.begin()), __it}; break; } - } while (__is_ascii(*__it)); + } while (__format_spec::__is_ascii(*__it)); --__it; ++__maximum; } |