Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
62205ab
Workaround Intellisense bug in some `ranges::to` tests (#4895)
CaseyCarter Aug 19, 2024
1a84ba0
Update llvm-project (#4910)
StephanTLavavej Aug 25, 2024
3705e36
Floating minmax: fix negative zero handling and dedicated test covera…
AlexGuteniev Aug 25, 2024
5877281
Fix put_time() crash on invalid struct tm data (#4883)
TheStormN Aug 25, 2024
f3567b8
Use `wmemchr` in optimizations (#4894)
AlexGuteniev Aug 25, 2024
20a1c9f
Test LWG-4105 `ranges::ends_with`'s Returns misses difference casting…
frederick-vs-ja Aug 25, 2024
d5777f4
Avoid truncation warnings for contiguous iterators with unusual diffe…
ofAlpaca Aug 25, 2024
7782684
Casey's accumulated miscellaneous changes (#4900)
CaseyCarter Aug 25, 2024
c2ab040
Speculatively implement LWG-4139 [time.zone.leap] recursive constrain…
frederick-vs-ja Aug 25, 2024
75d3e6c
`<variant>`: Workaround for LLVM-59854 in the case of destructor of `…
frederick-vs-ja Aug 25, 2024
d1f63f3
Optimize equality comparison of two empty `string_view`s (#4904)
YexuanXiao Aug 25, 2024
5f11927
Fix MSVC-only compiler options for the internal test harness (#4905)
StephanTLavavej Aug 25, 2024
138e116
Standard Library Modules: Add compiler workarounds for `<random>` (#4…
StephanTLavavej Aug 25, 2024
d4b84bc
`<format>`: crash when formatting a floating-point value with #/L and…
Andor233 Aug 25, 2024
8af2cc4
`<ranges>`: rename `views::iota` and `views::repeat` parameters (#4908)
SuperWig Aug 25, 2024
d9f6f31
Adjust tests relying on CWG1351 noexcept behavior (#4914)
joemmett Aug 27, 2024
3e20579
Unskip tests that no longer have `ALLOW_RETRIES` (#4911)
CaseyCarter Aug 28, 2024
4811be8
Make the test suite more friendly to Clang 19 (#4912)
CaseyCarter Aug 28, 2024
3cf597e
`locale0.cpp`: Protect memory integrity of `_Fac_node` (#4916)
li-boxuan Aug 28, 2024
0b6e350
Compiler bug workaround for using `format()` in a user-defined module…
StephanTLavavej Aug 28, 2024
1acbeae
`<chrono>`: Add comments for compiler bug workarounds (#4920)
frederick-vs-ja Aug 28, 2024
91e4255
Avoid `rand()` in the legacy `tr1` test suite (#4921)
StephanTLavavej Aug 28, 2024
77b31f7
Vectorize `basic_string::find_first_of` (#4744)
AlexGuteniev Sep 4, 2024
a36ece0
Implement P3107R5 optimized `<print>` (#4821)
blackninja9939 Sep 4, 2024
64dc89d
Fix constraint on `unique_ptr<T, D>(auto_ptr<U>&&)` (#4922)
CaseyCarter Sep 4, 2024
79206df
Updated _MSVC_STL_UPDATE to September 2024 (#4926)
euvre Sep 4, 2024
1a54b61
`<algorithm>`: Relax const-ness requirements on `ranges::_Meow_bound_…
frederick-vs-ja Sep 4, 2024
c7c5ca7
Remove google/benchmark workaround (#4928)
StephanTLavavej Sep 4, 2024
e931261
Vectorize `std::search` of 1 and 2 bytes elements with `pcmpestri` (#…
AlexGuteniev Sep 9, 2024
592b639
Vectorize `minmax` on each code path (#4913)
AlexGuteniev Sep 9, 2024
6477481
Workaround Clang 18 issues in our test suite (#4932)
CaseyCarter Sep 9, 2024
479dcb9
Avoid squirrelly `memcpy()` call in `filesystem.cpp` (#4933)
StephanTLavavej Sep 9, 2024
1749e33
Reduce inclusion for IO stream headers in C++23 (#4936)
frederick-vs-ja Sep 9, 2024
a7a88f3
Avoid testing infinities in `/fp:fast` (#4937)
AlexGuteniev Sep 9, 2024
3da77eb
`<spanstream>`: Use `static_cast` to `std::span` to avoid ill-formed …
euvre Sep 9, 2024
0008e2f
`<source_location>`: Remove EDG workaround for DevCom-10199227 (#4939)
fsb4000 Sep 9, 2024
e067e3e
Explicitly spell the noexcept-specifier of the move constructor and m…
heckerpowered Sep 9, 2024
e34645f
Silence CodeQL false positive warnings (#4942)
StephanTLavavej Sep 9, 2024
ab20dbd
Begin removing EDG workaround from `ranges::to` tests (#4944)
CaseyCarter Sep 10, 2024
6cb175d
Toolset update: VS 2022 17.12 Preview 2, Clang 18.1.8 (#4947)
StephanTLavavej Sep 12, 2024
73b5791
Casey's accumulated nitpicks (#4945)
CaseyCarter Sep 12, 2024
770b2fc
Merge branch 'main' into reformat-flat_set
StephanTLavavej Sep 12, 2024
f8acc4f
Regen clang-format, no manual changes.
StephanTLavavej Sep 12, 2024
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
55 changes: 40 additions & 15 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# https://releases.llvm.org/17.0.1/tools/clang/docs/ClangFormatStyleOptions.html
# https://releases.llvm.org/18.1.8/tools/clang/docs/ClangFormatStyleOptions.html

# To update this .clang-format file for a new clang-format version:
# 1. Update the documentation link above.
# 2. Copy the output of `clang-format -dump-config` into a temporary file.
# a. Comment out all of its lines.
# b. Uncomment `BasedOnStyle: LLVM`.
# 3. Compare that temporary file to this .clang-format file.
# 4. Adjust this .clang-format file to record new and updated options.
# a. Read the new documentation to understand such changes.
# 5. The goal is for the comparison from the temporary file to this .clang-format file to be pure additions (green).
# a. That is, comments here are recording the defaults, while added lines are our customized settings.

---
# Language: Cpp
Expand All @@ -11,31 +22,34 @@ AccessModifierOffset: -4
# AlignAfterOpenBracket: Align
AlignAfterOpenBracket: DontAlign
# AlignArrayOfStructures: None
# TRANSITION, LLVM-51935 (try using AlignArrayOfStructures after this crash is fixed)
# AlignConsecutiveAssignments:
# Enabled: false
# AcrossEmptyLines: false
# AcrossComments: false
# AlignCompound: false
# AlignFunctionPointers: false
# PadOperators: true
AlignConsecutiveAssignments: Consecutive
# AlignConsecutiveBitFields:
# Enabled: false
# AcrossEmptyLines: false
# AcrossComments: false
# AlignCompound: false
# AlignFunctionPointers: false
# PadOperators: false
# AlignConsecutiveDeclarations:
# Enabled: false
# AcrossEmptyLines: false
# AcrossComments: false
# AlignCompound: false
# AlignFunctionPointers: false
# PadOperators: false
# AlignConsecutiveMacros:
# Enabled: false
# AcrossEmptyLines: false
# AcrossComments: false
# AlignCompound: false
# AlignFunctionPointers: false
# PadOperators: false
AlignConsecutiveMacros: Consecutive
# AlignConsecutiveShortCaseStatements:
Expand All @@ -54,8 +68,11 @@ AlignTrailingComments:
Kind: Never
# AllowAllArgumentsOnNextLine: true
# AllowAllParametersOfDeclarationOnNextLine: true
# AllowBreakBeforeNoexceptSpecifier: Never
AllowBreakBeforeNoexceptSpecifier: OnlyWithParen
# AllowShortBlocksOnASingleLine: Never
# AllowShortCaseLabelsOnASingleLine: false
# AllowShortCompoundRequirementOnASingleLine: true
# AllowShortEnumsOnASingleLine: true
# AllowShortFunctionsOnASingleLine: All
AllowShortFunctionsOnASingleLine: Empty
Expand Down Expand Up @@ -91,7 +108,9 @@ AlwaysBreakTemplateDeclarations: Yes
# SplitEmptyFunction: true
# SplitEmptyRecord: true
# SplitEmptyNamespace: true
# BreakAfterAttributes: Never
# BreakAdjacentStringLiterals: true
# BreakAfterAttributes: Leave
BreakAfterAttributes: Never
# BreakAfterJavaFieldAnnotations: false
# BreakArrays: true
# BreakBeforeBinaryOperators: None
Expand Down Expand Up @@ -138,20 +157,23 @@ IncludeBlocks: Regroup
# SortPriority: 0
# CaseSensitive: false
IncludeCategories:
- Regex: '^<yvals(_core)?\.h>$'
Priority: 1
- Regex: '^<(Windows|userenv)\.h>$'
Priority: 3
SortPriority: 3
- Regex: '^<WinIoCtl\.h>$'
Priority: 3
SortPriority: 4
- Regex: '^<__.*\.hpp>$'
Priority: 2
- Regex: '^<(yvals|yvals_core)\.h>$'
Priority: 10
- Regex: '^<__msvc_.*\.hpp>$'
Priority: 20
- Regex: '^<initguid\.h>$' # <initguid.h> should be included before any header that includes <guiddef.h>
Priority: 30
SortPriority: 30
- Regex: '^<(DbgEng|DbgHelp|Shlwapi|Windows)\.h>$'
Priority: 30
SortPriority: 31
- Regex: '^<winioctl\.h>$'
Priority: 30
SortPriority: 32
- Regex: '\.hpp[>"]$'
Priority: 5
Priority: 40
- Regex: '.*'
Priority: 2
Priority: 20
# IncludeIsMainRegex: '(Test)?$'
# IncludeIsMainSourceRegex: ''
# IndentAccessModifiers: false
Expand Down Expand Up @@ -203,6 +225,7 @@ NamespaceIndentation: All
# PenaltyBreakComment: 300
# PenaltyBreakFirstLessLess: 120
# PenaltyBreakOpenParenthesis: 0
# PenaltyBreakScopeResolution: 500
# PenaltyBreakString: 1000
# PenaltyBreakTemplateDeclaration: 10
# PenaltyExcessCharacter: 1000000
Expand All @@ -222,6 +245,7 @@ RemoveSemicolon: true
# RequiresExpressionIndentation: OuterScope
# SeparateDefinitionBlocks: Leave
# ShortNamespaceLines: 1
# SkipMacroDefinitionBody: false
# SortIncludes: CaseSensitive
# SortJavaStaticImport: Before
# SortUsingDeclarations: LexicographicNumeric
Expand All @@ -244,6 +268,7 @@ SpaceAfterCStyleCast: true
# AfterFunctionDeclarationName: false
# AfterIfMacros: true
# AfterOverloadedOperator: false
# AfterPlacementOperator: true
# AfterRequiresInClause: false
# AfterRequiresInExpression: false
# BeforeNonEmptyParentheses: false
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With The Visual Studio IDE

1. Install Visual Studio 2022 17.12 Preview 1 or later.
1. Install Visual Studio 2022 17.12 Preview 2 or later.
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
* Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer
if you would like to build the ARM64/ARM64EC target.
Expand All @@ -160,7 +160,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With A Native Tools Command Prompt

1. Install Visual Studio 2022 17.12 Preview 1 or later.
1. Install Visual Studio 2022 17.12 Preview 2 or later.
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
* Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer
if you would like to build the ARM64/ARM64EC target.
Expand Down
2 changes: 1 addition & 1 deletion azure-devops/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

variables:
- name: poolName
value: 'StlBuild-2024-08-14T0018-Pool'
value: 'StlBuild-2024-09-10T1506-Pool'
readonly: true
- name: poolDemands
value: 'EnableSpotVM -equals false'
Expand Down
4 changes: 2 additions & 2 deletions azure-devops/provision-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ foreach ($workload in $VisualStudioWorkloads) {
}

# https://github.com/PowerShell/PowerShell/releases/latest
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.4/PowerShell-7.4.4-win-x64.msi'
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.5/PowerShell-7.4.5-win-x64.msi'
$PowerShellArgs = @('/quiet', '/norestart')

$PythonUrl = 'https://www.python.org/ftp/python/3.12.5/python-3.12.5-amd64.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.12.6/python-3.12.6-amd64.exe'
$PythonArgs = @('/quiet', 'InstallAllUsers=1', 'PrependPath=1', 'CompileAll=1', 'Include_doc=0')

$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_551.61_windows.exe'
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ function(add_benchmark name)
target_compile_features(benchmark-${name} PRIVATE cxx_std_${arg_CXX_STANDARD})
target_include_directories(benchmark-${name} PRIVATE inc)
target_link_libraries(benchmark-${name} PRIVATE benchmark::benchmark)
# TRANSITION, google/benchmark#1450
target_compile_definitions(benchmark-${name} PRIVATE BENCHMARK_STATIC_DEFINE)
endfunction()

add_benchmark(bitset_to_string src/bitset_to_string.cpp)
add_benchmark(efficient_nonlocking_print src/efficient_nonlocking_print.cpp)
add_benchmark(find_and_count src/find_and_count.cpp)
add_benchmark(find_first_of src/find_first_of.cpp)
add_benchmark(iota src/iota.cpp)
Expand All @@ -121,6 +120,7 @@ add_benchmark(random_integer_generation src/random_integer_generation.cpp)
add_benchmark(replace src/replace.cpp)
add_benchmark(search src/search.cpp)
add_benchmark(std_copy src/std_copy.cpp)
add_benchmark(sv_equal src/sv_equal.cpp)
add_benchmark(swap_ranges src/swap_ranges.cpp)

add_benchmark(vector_bool_copy src/std/containers/sequences/vector.bool/copy/test.cpp)
Expand Down
44 changes: 44 additions & 0 deletions benchmarks/src/efficient_nonlocking_print.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// This benchmark inherently prints many lines to stdout. To view its results, run it with these options:
// --benchmark_out=efficient_nonlocking_print.log --benchmark_out_format=console

#include <benchmark/benchmark.h>
#include <cstdio>
#include <format>
#include <print>
#include <string>
#include <string_view>
#include <utility>

namespace {
using PrintType = void (*)(FILE*, std::string_view, std::format_args);

template <PrintType PrintFunction>
void BM_vprint(benchmark::State& state) {
for (auto _ : state) {
PrintFunction(stdout, "Hello cool I am going to print as unicode\n", std::make_format_args());
}
}
BENCHMARK(BM_vprint<&std::vprint_unicode>);
BENCHMARK(BM_vprint<&std::vprint_unicode_buffered>);

template <PrintType PrintFunction>
void BM_vprint_complex(benchmark::State& state) {
const int i = 42;
const std::string str = "Hello world!!!!!!!!!!!!!!!!!!!!!!!!";
const double f = -902.16283758;
const std::pair<int, double> p{16, 2.073f};
for (auto _ : state) {
PrintFunction(stdout,
"Hello cool I am going to print as unicode!! {:X}, {}, {:a}, "
"I am a big string, lots of words, multiple {} formats\n",
std::make_format_args(i, str, f, p));
}
}
BENCHMARK(BM_vprint_complex<&std::vprint_unicode>);
BENCHMARK(BM_vprint_complex<&std::vprint_unicode_buffered>);
} // namespace

BENCHMARK_MAIN();
36 changes: 26 additions & 10 deletions benchmarks/src/find_first_of.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,26 @@
#include <cstdint>
#include <cstdlib>
#include <numeric>
#include <string>
#include <type_traits>
#include <vector>

using namespace std;

template <class T>
enum class AlgType : bool { std_func, str_member };

template <AlgType Alg, class T, T Start = T{'a'}>
void bm(benchmark::State& state) {
const size_t Pos = static_cast<size_t>(state.range(0));
const size_t NSize = static_cast<size_t>(state.range(1));
const size_t HSize = Pos * 2;
const size_t Which = 0;

vector<T> h(HSize, T{'.'});
vector<T> n(NSize);
iota(n.begin(), n.end(), T{'a'});
using container = conditional_t<Alg == AlgType::str_member, basic_string<T>, vector<T>>;

container h(HSize, T{'.'});
container n(NSize, T{0});
iota(n.begin(), n.end(), Start);

if (Pos >= HSize || Which >= NSize) {
abort();
Expand All @@ -29,18 +35,28 @@ void bm(benchmark::State& state) {
h[Pos] = n[Which];

for (auto _ : state) {
benchmark::DoNotOptimize(find_first_of(h.begin(), h.end(), n.begin(), n.end()));
benchmark::DoNotOptimize(h);
benchmark::DoNotOptimize(n);
if constexpr (Alg == AlgType::str_member) {
benchmark::DoNotOptimize(h.find_first_of(n.data(), 0, n.size()));
} else {
benchmark::DoNotOptimize(find_first_of(h.begin(), h.end(), n.begin(), n.end()));
}
}
}

void common_args(auto bm) {
bm->Args({2, 3})->Args({7, 4})->Args({9, 3})->Args({22, 5})->Args({58, 2});
bm->Args({102, 4})->Args({325, 1})->Args({1011, 11})->Args({3056, 7});
bm->Args({102, 4})->Args({325, 1})->Args({1011, 11})->Args({1502, 23})->Args({3056, 7});
}

BENCHMARK(bm<uint8_t>)->Apply(common_args);
BENCHMARK(bm<uint16_t>)->Apply(common_args);
BENCHMARK(bm<uint32_t>)->Apply(common_args);
BENCHMARK(bm<uint64_t>)->Apply(common_args);
BENCHMARK(bm<AlgType::std_func, uint8_t>)->Apply(common_args);
BENCHMARK(bm<AlgType::std_func, uint16_t>)->Apply(common_args);
BENCHMARK(bm<AlgType::std_func, uint32_t>)->Apply(common_args);
BENCHMARK(bm<AlgType::std_func, uint64_t>)->Apply(common_args);

BENCHMARK(bm<AlgType::str_member, char>)->Apply(common_args);
BENCHMARK(bm<AlgType::str_member, wchar_t>)->Apply(common_args);
BENCHMARK(bm<AlgType::str_member, wchar_t, L'\x03B1'>)->Apply(common_args);

BENCHMARK_MAIN();
Loading