[libcxx-commits] [libcxx] [libc++] Optimize num_get integral functions (PR #121795)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 6 08:24:53 PST 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 976f3a078bbac1889aa9e68e297f73f111a896d6 6d70f2129e7c941f7e8fa46c6af21b4a32478689 --extensions ,cpp,h -- libcxx/include/__algorithm/simd_utils.h libcxx/include/__configuration/abi.h libcxx/include/__locale_dir/locale_base_api.h libcxx/include/__locale_dir/support/bsd_like.h libcxx/include/__locale_dir/support/windows.h libcxx/include/locale libcxx/src/locale.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__algorithm/simd_utils.h b/libcxx/include/__algorithm/simd_utils.h
index a855cbea22..96ef7511e4 100644
--- a/libcxx/include/__algorithm/simd_utils.h
+++ b/libcxx/include/__algorithm/simd_utils.h
@@ -128,9 +128,10 @@ template <class _VecT, size_t _Np, class _Iter>
}
template <class _VecT>
-[[__nodiscard__]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _VecT __broadcast(__simd_vector_underlying_type_t<_VecT> __val) {
+[[__nodiscard__]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _VecT
+__broadcast(__simd_vector_underlying_type_t<_VecT> __val) {
return [&]<std::size_t... _Indices>(index_sequence<_Indices...>) {
- return _VecT{ ((void)_Indices, __val)...};
+ return _VecT{((void)_Indices, __val)...};
}(make_index_sequence<__simd_vector_size_v<_VecT>>());
}
_LIBCPP_DIAGNOSTIC_POP
diff --git a/libcxx/include/locale b/libcxx/include/locale
index 8757074a50..691728e494 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -866,14 +866,14 @@ _InputIterator num_get<_CharT, _InputIterator>::__do_get_integral(
}
// Calculate the actual number
- _Unsigned __val = 0;
+ _Unsigned __val = 0;
bool __overflowed = false;
for (; __first != __last; ++__first) {
auto __c = *__first;
if (!__grouping.empty() && __c == __thousands_sep) {
if (__g_end - __g < this->__num_get_buf_sz) {
*__g_end++ = __dc;
- __dc = 0;
+ __dc = 0;
}
continue;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/121795
More information about the libcxx-commits
mailing list