Skip to content

Commit

Permalink
Merge branch 'main' into find_end
Browse files Browse the repository at this point in the history
Resolved adjacent add/edit conflict in stl/src/vector_algorithms.cpp.
  • Loading branch information
StephanTLavavej committed Sep 12, 2024
2 parents 5de387c + 73b5791 commit 60825c4
Show file tree
Hide file tree
Showing 129 changed files with 3,554 additions and 3,535 deletions.
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
1 change: 1 addition & 0 deletions stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set(HEADERS
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_int128.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_iter_core.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_minmax.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_ostream.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_print.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_ranges_to.hpp
${CMAKE_CURRENT_LIST_DIR}/inc/__msvc_sanitizer_annotate_container.hpp
Expand Down
27 changes: 0 additions & 27 deletions stl/inc/__msvc_bit_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,45 +127,18 @@ _NODISCARD int _Checked_x86_x64_countl_zero(const _Ty _Val) noexcept {
#endif // (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || (defined(_M_X64) && !defined(_M_ARM64EC))

#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_HYBRID_X86_ARM64)
#ifdef __clang__ // TRANSITION, GH-1586
_NODISCARD constexpr int _Clang_arm_arm64_countl_zero(const unsigned short _Val) {
return __builtin_clzs(_Val);
}

_NODISCARD constexpr int _Clang_arm_arm64_countl_zero(const unsigned int _Val) {
return __builtin_clz(_Val);
}

_NODISCARD constexpr int _Clang_arm_arm64_countl_zero(const unsigned long _Val) {
return __builtin_clzl(_Val);
}

_NODISCARD constexpr int _Clang_arm_arm64_countl_zero(const unsigned long long _Val) {
return __builtin_clzll(_Val);
}
#endif // TRANSITION, GH-1586

template <class _Ty>
_NODISCARD int _Checked_arm_arm64_countl_zero(const _Ty _Val) noexcept {
constexpr int _Digits = _Unsigned_integer_digits<_Ty>;
if (_Val == 0) {
return _Digits;
}

#ifdef __clang__ // TRANSITION, GH-1586
if constexpr (is_same_v<remove_cv_t<_Ty>, unsigned char>) {
return _Clang_arm_arm64_countl_zero(static_cast<unsigned short>(_Val))
- (_Unsigned_integer_digits<unsigned short> - _Digits);
} else {
return _Clang_arm_arm64_countl_zero(_Val);
}
#else // ^^^ workaround / no workaround vvv
if constexpr (_Digits <= 32) {
return static_cast<int>(_CountLeadingZeros(_Val)) - (_Unsigned_integer_digits<unsigned long> - _Digits);
} else {
return static_cast<int>(_CountLeadingZeros64(_Val));
}
#endif // ^^^ no workaround ^^^
}
#endif // defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_HYBRID_X86_ARM64)
#endif // _HAS_COUNTL_ZERO_INTRINSICS
Expand Down
Loading

0 comments on commit 60825c4

Please sign in to comment.