Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions benchmarks/src/regex_match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ void bm_match_sequence_of_as(benchmark::State& state, const char* pattern, synta
}
}

void bm_match_sequence_of_9a1b(benchmark::State& state, const char* pattern, syntax_option_type syntax = ECMAScript) {
string input;
for (int i = 0; i < state.range(); ++i) {
input += "aaaaaaaaab";
}

regex re{pattern, syntax};

for (auto _ : state) {
benchmark::DoNotOptimize(input);
const char* pos = input.data();
const char* end = input.data() + input.size();
cmatch match;
regex_match(pos, end, match, re);
}
}

void common_args(auto bm) {
bm->Arg(100)->Arg(200)->Arg(400);
}
Expand All @@ -36,5 +53,6 @@ BENCHMARK_CAPTURE(bm_match_sequence_of_as, "(b|a)*", "(b|a)*")->Apply(common_arg
BENCHMARK_CAPTURE(bm_match_sequence_of_as, "(a)(?:b|a)*", "(a)(?:b|a)*")->Apply(common_args);
BENCHMARK_CAPTURE(bm_match_sequence_of_as, "(a)(b|a)*", "(a)(b|a)*")->Apply(common_args);
BENCHMARK_CAPTURE(bm_match_sequence_of_as, "(a)(?:b|a)*c", "(a)(?:b|a)*c")->Apply(common_args);
BENCHMARK_CAPTURE(bm_match_sequence_of_9a1b, "(?:a*b)*", "(?:a*b)*")->Apply(common_args);

BENCHMARK_MAIN();
156 changes: 58 additions & 98 deletions stl/debugger/STL.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,16 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Expand>
</Type>


<!-- std::compare_three_way, std::ranges::less and similar -->
<Type Name="std::ranges::equal_to"><DisplayString>ranges::equal_to</DisplayString><Expand/></Type>
<Type Name="std::ranges::not_equal_to"><DisplayString>ranges::not_equal_to</DisplayString><Expand/></Type>
<Type Name="std::ranges::greater"><DisplayString>ranges::greater</DisplayString><Expand/></Type>
<Type Name="std::ranges::less"><DisplayString>ranges::less</DisplayString><Expand/></Type>
<Type Name="std::ranges::greater_equal"><DisplayString>ranges::greater_equal</DisplayString><Expand/></Type>
<Type Name="std::ranges::less_equal"><DisplayString>ranges::less_equal</DisplayString><Expand/></Type>
<Type Name="std::compare_three_way"><DisplayString>compare_three_way</DisplayString><Expand/></Type>

<!-- std::less<> and similar -->
<Type Name="std::plus&lt;void&gt;"><DisplayString>plus&lt;&gt;</DisplayString><Expand/></Type>
<Type Name="std::minus&lt;void&gt;"><DisplayString>minus&lt;&gt;</DisplayString><Expand/></Type>
<Type Name="std::multiplies&lt;void&gt;"><DisplayString>multiplies&lt;&gt;</DisplayString><Expand/></Type>
Expand All @@ -607,101 +616,26 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
<Type Name="std::bit_xor&lt;void&gt;"><DisplayString>bit_xor&lt;&gt;</DisplayString><Expand/></Type>
<Type Name="std::bit_not&lt;void&gt;"><DisplayString>bit_not&lt;&gt;</DisplayString><Expand/></Type>


<Type Name="std::plus&lt;*&gt;">
<DisplayString>plus</DisplayString>
<Expand/>
</Type>

<Type Name="std::minus&lt;*&gt;">
<DisplayString>minus</DisplayString>
<Expand/>
</Type>

<Type Name="std::multiplies&lt;*&gt;">
<DisplayString>multiplies</DisplayString>
<Expand/>
</Type>

<Type Name="std::divides&lt;*&gt;">
<DisplayString>divides</DisplayString>
<Expand/>
</Type>

<Type Name="std::modulus&lt;*&gt;">
<DisplayString>modulus</DisplayString>
<Expand/>
</Type>

<Type Name="std::negate&lt;*&gt;">
<DisplayString>negate</DisplayString>
<Expand/>
</Type>

<Type Name="std::equal_to&lt;*&gt;">
<DisplayString>equal_to</DisplayString>
<Expand/>
</Type>

<Type Name="std::not_equal_to&lt;*&gt;">
<DisplayString>not_equal_to</DisplayString>
<Expand/>
</Type>

<Type Name="std::greater&lt;*&gt;">
<DisplayString>greater</DisplayString>
<Expand/>
</Type>

<Type Name="std::less&lt;*&gt;">
<DisplayString>less</DisplayString>
<Expand/>
</Type>

<Type Name="std::greater_equal&lt;*&gt;">
<DisplayString>greater_equal</DisplayString>
<Expand/>
</Type>

<Type Name="std::less_equal&lt;*&gt;">
<DisplayString>less_equal</DisplayString>
<Expand/>
</Type>

<Type Name="std::logical_and&lt;*&gt;">
<DisplayString>logical_and</DisplayString>
<Expand/>
</Type>

<Type Name="std::logical_or&lt;*&gt;">
<DisplayString>logical_or</DisplayString>
<Expand/>
</Type>

<Type Name="std::logical_not&lt;*&gt;">
<DisplayString>logical_not</DisplayString>
<Expand/>
</Type>

<Type Name="std::bit_and&lt;*&gt;">
<DisplayString>bit_and</DisplayString>
<Expand/>
</Type>

<Type Name="std::bit_or&lt;*&gt;">
<DisplayString>bit_or</DisplayString>
<Expand/>
</Type>

<Type Name="std::bit_xor&lt;*&gt;">
<DisplayString>bit_xor</DisplayString>
<Expand/>
</Type>

<Type Name="std::bit_not&lt;*&gt;">
<DisplayString>bit_not</DisplayString>
<Expand/>
</Type>
<!-- std::less<T> and similar -->
<Type Name="std::plus&lt;*&gt;"><DisplayString>plus</DisplayString><Expand/></Type>
<Type Name="std::minus&lt;*&gt;"><DisplayString>minus</DisplayString><Expand/></Type>
<Type Name="std::multiplies&lt;*&gt;"><DisplayString>multiplies</DisplayString><Expand/></Type>
<Type Name="std::divides&lt;*&gt;"><DisplayString>divides</DisplayString><Expand/></Type>
<Type Name="std::modulus&lt;*&gt;"><DisplayString>modulus</DisplayString><Expand/></Type>
<Type Name="std::negate&lt;*&gt;"><DisplayString>negate</DisplayString><Expand/></Type>
<Type Name="std::equal_to&lt;*&gt;"><DisplayString>equal_to</DisplayString><Expand/></Type>
<Type Name="std::not_equal_to&lt;*&gt;"><DisplayString>not_equal_to</DisplayString><Expand/></Type>
<Type Name="std::greater&lt;*&gt;"><DisplayString>greater</DisplayString><Expand/></Type>
<Type Name="std::less&lt;*&gt;"><DisplayString>less</DisplayString><Expand/></Type>
<Type Name="std::greater_equal&lt;*&gt;"><DisplayString>greater_equal</DisplayString><Expand/></Type>
<Type Name="std::less_equal&lt;*&gt;"><DisplayString>less_equal</DisplayString><Expand/></Type>
<Type Name="std::logical_and&lt;*&gt;"><DisplayString>logical_and</DisplayString><Expand/></Type>
<Type Name="std::logical_or&lt;*&gt;"><DisplayString>logical_or</DisplayString><Expand/></Type>
<Type Name="std::logical_not&lt;*&gt;"><DisplayString>logical_not</DisplayString><Expand/></Type>
<Type Name="std::bit_and&lt;*&gt;"><DisplayString>bit_and</DisplayString><Expand/></Type>
<Type Name="std::bit_or&lt;*&gt;"><DisplayString>bit_or</DisplayString><Expand/></Type>
<Type Name="std::bit_xor&lt;*&gt;"><DisplayString>bit_xor</DisplayString><Expand/></Type>
<Type Name="std::bit_not&lt;*&gt;"><DisplayString>bit_not</DisplayString><Expand/></Type>


<Type Name="std::unary_negate&lt;*&gt;">
Expand Down Expand Up @@ -1084,6 +1018,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
<Type Name="std::_Array_iterator&lt;*&gt;" Priority="MediumLow">
<AlternativeType Name="std::_Array_const_iterator&lt;*&gt;" />
<SmartPointer Usage="Indexable">_Ptr,na</SmartPointer>
<DisplayString>{*_Ptr}</DisplayString>
<Expand>
<Item Name="[ptr]">_Ptr</Item>
</Expand>
Expand Down Expand Up @@ -1228,14 +1163,27 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Expand>
</Type>

<Type Name="std::_Vector_iterator&lt;*&gt;">
<!-- This is for _ITERATOR_DEBUG_LEVEL == 0 and must have lower priority. -->
<Type Name="std::_Vector_iterator&lt;*&gt;" Priority="MediumLow">
<AlternativeType Name="std::_Vector_const_iterator&lt;*&gt;" />
<SmartPointer Usage="Indexable">_Ptr,na</SmartPointer>
<DisplayString>{*_Ptr}</DisplayString>
<Expand>
<Item Name="[ptr]">_Ptr</Item>
</Expand>
</Type>

<!-- This is for _ITERATOR_DEBUG_LEVEL != 0 and must have higher priority. -->
<Type Name="std::_Vector_iterator&lt;*&gt;" Priority="Medium">
<AlternativeType Name="std::_Vector_const_iterator&lt;*&gt;" />
<Intrinsic Name="my_cont_end" Expression="((_Myvec_t *)_Myproxy-&gt;_Mycont)-&gt;_Mylast" />
<SmartPointer Usage="Indexable">_Ptr,na</SmartPointer>
<DisplayString Condition="_Ptr == my_cont_end()">end</DisplayString>
<DisplayString Condition="_Ptr != my_cont_end()">{*_Ptr}</DisplayString>
<Expand>
<Item Name="[ptr]">_Ptr</Item>
</Expand>
</Type>

<!-- VC 2015 -->
<Type Name="std::map&lt;*&gt;" Priority="Medium">
Expand Down Expand Up @@ -1838,13 +1786,25 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Expand>
</Type>

<Type Name="std::_Span_iterator&lt;*&gt;">
<!-- This is for _ITERATOR_DEBUG_LEVEL == 0 and must have lower priority. -->
<Type Name="std::_Span_iterator&lt;*&gt;" Priority="MediumLow">
<SmartPointer Usage="Indexable">_Myptr,na</SmartPointer>
<DisplayString>{*_Myptr}</DisplayString>
<Expand>
<Item Name="[ptr]">_Myptr</Item>
</Expand>
</Type>

<!-- This is for _ITERATOR_DEBUG_LEVEL != 0 and must have higher priority. -->
<Type Name="std::_Span_iterator&lt;*&gt;" Priority="Medium">
<SmartPointer Usage="Indexable">_Myptr,na</SmartPointer>
<DisplayString Condition="_Myptr == _Myend">end</DisplayString>
<DisplayString Condition="_Myptr != _Myend">{*_Myptr}</DisplayString>
<Expand>
<Item Name="[ptr]">_Myptr</Item>
</Expand>
</Type>

<Type Name="std::default_sentinel_t">
<DisplayString>default sentinel</DisplayString>
</Type>
Expand Down
7 changes: 4 additions & 3 deletions stl/inc/cmath
Original file line number Diff line number Diff line change
Expand Up @@ -1686,14 +1686,15 @@ _EXPORT_STD _NODISCARD constexpr inline double lerp(

_EXPORT_STD _NODISCARD constexpr inline long double lerp(
const long double _ArgA, const long double _ArgB, const long double _ArgT) noexcept {
return _Common_lerp(_ArgA, _ArgB, _ArgT);
return _Common_lerp(static_cast<double>(_ArgA), static_cast<double>(_ArgB), static_cast<double>(_ArgT));
}

_EXPORT_STD template <class _Ty1, class _Ty2, class _Ty3>
requires is_arithmetic_v<_Ty1> && is_arithmetic_v<_Ty2> && is_arithmetic_v<_Ty3>
_NODISCARD constexpr auto lerp(const _Ty1 _ArgA, const _Ty2 _ArgB, const _Ty3 _ArgT) noexcept {
using _Tgt = conditional_t<_Is_any_of_v<long double, _Ty1, _Ty2, _Ty3>, long double, double>;
return _Common_lerp(static_cast<_Tgt>(_ArgA), static_cast<_Tgt>(_ArgB), static_cast<_Tgt>(_ArgT));
using _Common = _Common_float_type_t<_Ty1, _Common_float_type_t<_Ty2, _Ty3>>;
return static_cast<_Common>(
_Common_lerp(static_cast<double>(_ArgA), static_cast<double>(_ArgB), static_cast<double>(_ArgT)));
}
#endif // _HAS_CXX20
_STD_END
Expand Down
Loading