Skip to content

Commit

Permalink
Merge pull request #22 from microsoft/main
Browse files Browse the repository at this point in the history
Updated the fork to the current main.
  • Loading branch information
tylerbrawl authored Jan 2, 2023
2 parents fb386c0 + 8ddf4da commit 78e37c8
Show file tree
Hide file tree
Showing 325 changed files with 5,862 additions and 2,666 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/move-ready-for-review-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

name: Move PR To Initial Review
on:
issue_comment:
types: [created]
branch:
- main

jobs:
move-pr-to-initial-review:
if: >
github.event.issue.pull_request
&& github.event.comment.user.login == github.event.issue.user.login
&& contains(github.event.comment.body, '/pr review')
runs-on: ubuntu-latest
steps:
- name: Move To Initial Review
uses: actions/github-script@v6
with:
script: |
// Find "Code Reviews" project manually by name matching
// This avoids hardcoding the project ID
const projects = await github.paginate(github.rest.projects.listForRepo, {
owner: context.repo.owner,
repo: context.repo.repo,
});
const code_reviews = projects.find(project => project.name === 'Code Reviews');
if (!code_reviews) {
console.error("'Code Reviews' project not found!");
return;
}
// Find "Initial Review" column manually by name matching
// This assumes the card is in "Work In Progress" column
// This avoids hardcoding the column ID and card ID
const columns = await github.paginate(github.rest.projects.listColumns, {
project_id: code_reviews.id,
});
const work_in_progress = columns.find(column => column.name === 'Work In Progress');
if (!work_in_progress) {
console.error("'Work In Progress' column not found!");
return;
}
const initial_review = columns.find(column => column.name === 'Initial Review');
if (!initial_review) {
console.error("'Initial Review' column not found!");
return;
}
const pr_card = await github.paginate(github.rest.projects.listCards, {
column_id: work_in_progress.id,
}).then(cards => cards.find(card => card.content_url === context.payload.issue.url));
if (!pr_card) {
console.error("Corresponding card for PR not found!");
return;
}
github.rest.projects.moveCard({
card_id: pr_card.id,
position: 'bottom',
column_id: initial_review.id,
}).catch(error => {
console.error(`Error occurred while moving card to 'Initial Review': ${error}`);
});
73 changes: 73 additions & 0 deletions .github/workflows/move-work-in-progress-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

name: Move PR To Work In Progress
on:
issue_comment:
types: [created]
branch:
- main

jobs:
move-pr-to-wip:
if: >
github.event.issue.pull_request
&& github.event.comment.user.login == github.event.issue.user.login
&& contains(github.event.comment.body, '/pr wip')
runs-on: ubuntu-latest
steps:
- name: Move To Work In Progress
uses: actions/github-script@v6
with:
script: |
// Find "Code Reviews" project manually by name matching
// This avoids hardcoding the project ID
const projects = await github.paginate(github.rest.projects.listForRepo, {
owner: context.repo.owner,
repo: context.repo.repo,
});
const code_reviews = projects.find(project => project.name === 'Code Reviews');
if (!code_reviews) {
console.error("'Code Reviews' project not found!");
return;
}
// Find "Work In Progress" column manually by name matching
// Also find the card of the PR in either "Initial Review" or "Final Review"
// This avoids hardcoding the column ID and card ID
const columns = await github.paginate(github.rest.projects.listColumns, {
project_id: code_reviews.id,
});
const work_in_progress = columns.find(column => column.name === 'Work In Progress');
if (!work_in_progress) {
console.error("'Work In Progress' column not found!");
return;
}
const move_card_in_column = async (column) => {
const cards = await github.paginate(github.rest.projects.listCards, {
column_id: column.id,
});
const pr_card = cards.find(card => card.content_url === context.payload.issue.url);
if (!pr_card) {
return; // the PR card is not in this column
}
await github.rest.projects.moveCard({
card_id: pr_card.id,
position: 'bottom',
column_id: work_in_progress.id,
});
};
columns.forEach(column => {
if (column.name !== 'Initial Review' && column.name !== 'Final Review') {
return; // no reason to search through other columns and avoids unnecessary API calls
}
move_card_in_column(column).catch(error => {
console.error(`Error occurred while moving card to 'Work In Progress': ${error}`);
});
});
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@
"files.eol": "\r\n",
"files.exclude": {
"benchmarks/google-benchmark": true,
"boost-math": true,
"llvm-project": true,
"stl/msbuild": true,
"boost-math": true
"stl/msbuild": true
},
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"git.ignoredRepositories": [
"benchmarks/google-benchmark",
"boost-math",
"llvm-project"
],
"python.analysis.extraPaths": [
"./llvm-project/libcxx/utils",
"./llvm-project/llvm/utils/lit",
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.25)

# TRANSITION, CMake-24249
cmake_policy(SET CMP0141 OLD)

set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
project(msvc_standard_libraries LANGUAGES CXX)

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ reproducing the bug.

* You should be reasonably confident that you're looking at an actual implementation bug, instead of undefined behavior
or surprising-yet-Standard behavior. Comparing against other implementations can help (but remember that implementations
can differ while conforming to the Standard); try Godbolt's [Compiler Explorer][]. If you still aren't
can differ while conforming to the Standard); try [Compiler Explorer][]. If you still aren't
sure, ask the nearest C++ expert.

* You should prepare a self-contained command-line test case, ideally as small as possible. We need a source file, a
Expand All @@ -141,11 +141,11 @@ 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.4 Preview 3 or later.
1. Install Visual Studio 2022 17.5 Preview 2 or later.
* Select "Windows 11 SDK (10.0.22000.0)" in the VS Installer.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja.
* Otherwise, install [CMake][] 3.24 or later, and [Ninja][] 1.11.0 or later.
* Otherwise, install [CMake][] 3.25 or later, and [Ninja][] 1.11.0 or later.
* We recommend selecting "Python 3 64-bit" in the VS Installer.
* Otherwise, make sure [Python][] 3.9 or later is available to CMake.
2. Open Visual Studio, and choose the "Clone or check out code" option. Enter the URL of this repository,
Expand All @@ -157,11 +157,11 @@ 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.4 Preview 3 or later.
1. Install Visual Studio 2022 17.5 Preview 2 or later.
* Select "Windows 11 SDK (10.0.22000.0)" in the VS Installer.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja.
* Otherwise, install [CMake][] 3.24 or later, and [Ninja][] 1.11.0 or later.
* Otherwise, install [CMake][] 3.25 or later, and [Ninja][] 1.11.0 or later.
* We recommend selecting "Python 3 64-bit" in the VS Installer.
* Otherwise, make sure [Python][] 3.9 or later is available to CMake.
2. Open a command prompt.
Expand Down
2 changes: 0 additions & 2 deletions azure-devops/cmake-configure-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ steps:
cmake ${{ parameters.cmakeAdditionalFlags}} -G Ninja ^
-DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_BUILD_TYPE=Release ^
-DLIT_FLAGS=$(litFlags) ^
-DSTL_USE_ANALYZE=ON ^
-DSTL_BINARY_DIR=$(${{ parameters.buildOutputLocationVar }}) ^
-S $(Build.SourcesDirectory)/benchmarks -B $(${{ parameters.benchmarkBuildOutputLocationVar }})
displayName: 'Configure the benchmarks'
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 @@ -91,7 +91,7 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) {
$PsExecPath = Join-Path $ExtractedPsToolsPath 'PsExec64.exe'

# https://github.com/PowerShell/PowerShell/releases/latest
$PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.2.6/PowerShell-7.2.6-win-x64.zip'
$PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/PowerShell-7.3.1-win-x64.zip'
Write-Host "Downloading: $PowerShellZipUrl"
$ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl
$PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe'
Expand Down Expand Up @@ -141,7 +141,7 @@ $Workloads = @(
$ReleaseInPath = 'Preview'
$Sku = 'Enterprise'
$VisualStudioBootstrapperUrl = 'https://aka.ms/vs/17/pre/vs_enterprise.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.10.8/python-3.10.8-amd64.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.11.1/python-3.11.1-amd64.exe'

$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_511.23_windows.exe'

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ variables:
benchmarkBuildOutputLocation: 'D:\benchmark'

pool:
name: 'StlBuild-2022-10-11T1916-Pool'
name: 'StlBuild-2022-12-13T1747-Pool'
demands: EnableSpotVM -equals true

pr:
Expand Down
5 changes: 3 additions & 2 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.25)
project(msvc_standard_libraries_benchmarks LANGUAGES CXX)

if(DEFINED STL_BINARY_DIR)
Expand Down Expand Up @@ -105,5 +105,6 @@ function(add_benchmark name)
target_compile_definitions(benchmark-${name} PRIVATE BENCHMARK_STATIC_DEFINE)
endfunction()

add_benchmark(std_copy src/std_copy.cpp)
add_benchmark(locale_classic src/locale_classic.cpp)
add_benchmark(random_integer_generation src/random_integer_generation.cpp)
add_benchmark(std_copy src/std_copy.cpp)
16 changes: 16 additions & 0 deletions benchmarks/src/locale_classic.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <benchmark/benchmark.h>
#include <locale>
using namespace std;

// GH-3048 <locale>: Double-checked locking for locale::classic
static void BM_locale_classic(benchmark::State& state) {
for (auto _ : state) {
benchmark::DoNotOptimize(locale::classic());
}
}
BENCHMARK(BM_locale_classic);

BENCHMARK_MAIN();
3 changes: 2 additions & 1 deletion stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
set(HEADERS
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_all_public_headers.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_chrono.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_cxx_stdatomic.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_format_ucd_tables.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_int128.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_iter_core.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_sanitizer_annotate_container.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_system_error_abi.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_tzdb.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_xlocinfo_types.hpp
Expand Down Expand Up @@ -191,7 +193,6 @@ set(HEADERS
${CMAKE_CURRENT_LIST_DIR}/inc/sstream
${CMAKE_CURRENT_LIST_DIR}/inc/stack
${CMAKE_CURRENT_LIST_DIR}/inc/stacktrace
${CMAKE_CURRENT_LIST_DIR}/inc/stdatomic.h
${CMAKE_CURRENT_LIST_DIR}/inc/stdexcept
${CMAKE_CURRENT_LIST_DIR}/inc/stop_token
${CMAKE_CURRENT_LIST_DIR}/inc/streambuf
Expand Down
28 changes: 23 additions & 5 deletions stl/debugger/STL.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Type>


<Type Name="std::error_category">
<DisplayString>[{name(),sb}]</DisplayString>
<Expand>
<Synthetic Name="hint">
<DisplayString>Enable "Allow Function Calls In Value Formatting" if you see "???" here</DisplayString>
</Synthetic>
</Expand>
</Type>

<Type Name="std::error_code">
<DisplayString>{{ value={_Myval}, category={*_Mycat} }}</DisplayString>
<Expand>
<Synthetic Name="hint">
<DisplayString>Enable "Allow Function Calls In Value Formatting" if you see "???" here</DisplayString>
</Synthetic>
<Item Name="[value]">_Myval</Item>
<Item Name="[category]">_Mycat</Item>
</Expand>
</Type>

<Type Name="std::exception_ptr">
<CustomVisualizer Condition="_Data1 != 0" VisualizerId="CEB58A03-E78D-4D19-9AE7-4738E200649E" />
<DisplayString Condition="_Data1 == 0">null</DisplayString>
Expand Down Expand Up @@ -104,12 +124,10 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Type>

<Type Name="std::optional&lt;*&gt;">
<Intrinsic Name="has_value" Expression="_Has_value"/>
<Intrinsic Name="value" Expression="_Value"/>
<DisplayString Condition="!has_value()">nullopt</DisplayString>
<DisplayString Condition="has_value()">{value()}</DisplayString>
<DisplayString Condition="!_Has_value">nullopt</DisplayString>
<DisplayString Condition="_Has_value">{_Value}</DisplayString>
<Expand>
<Item Condition="has_value()" Name="value">value()</Item>
<Item Condition="_Has_value" Name="value">_Value</Item>
</Expand>
</Type>

Expand Down
15 changes: 5 additions & 10 deletions stl/inc/__msvc_all_public_headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,24 +139,19 @@
#include <vector>

#ifndef _M_CEE_PURE
#include <__msvc_cxx_stdatomic.hpp>
#include <atomic>
#include <barrier>
#include <latch>
#include <semaphore>
#ifndef __clang__ // TRANSITION, GH-2862
#include <stdatomic.h>
#endif // TRANSITION, GH-2862
#include <stop_token>
#endif // _M_CEE_PURE

#ifndef _M_CEE
#include <condition_variable>
#include <execution>
#include <future>
#include <latch>
#include <mutex>
#include <semaphore>
#include <shared_mutex>
#include <stop_token>
#include <thread>
#endif // _M_CEE
#endif // _M_CEE_PURE

// Non-Core C Wrapper Headers
#include <ccomplex>
Expand Down
Loading

0 comments on commit 78e37c8

Please sign in to comment.