diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 6d3f2efaf848ce..978b716216ae93 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,19 +3,19 @@
"isRoot": true,
"tools": {
"coverlet.console": {
- "version": "1.7.2",
+ "version": "3.1.0",
"commands": [
"coverlet"
]
},
"dotnet-reportgenerator-globaltool": {
- "version": "4.5.8",
+ "version": "5.0.2",
"commands": [
"reportgenerator"
]
},
"microsoft.dotnet.xharness.cli": {
- "version": "1.0.0-prerelease.21622.1",
+ "version": "1.0.0-prerelease.22053.2",
"commands": [
"xharness"
]
diff --git a/docs/coding-guidelines/interop-guidelines.md b/docs/coding-guidelines/interop-guidelines.md
index 997aa1fd3772a8..55d4e9ddcae0ab 100644
--- a/docs/coding-guidelines/interop-guidelines.md
+++ b/docs/coding-guidelines/interop-guidelines.md
@@ -166,6 +166,12 @@ Using enums instead of partial, static classes can lead to needing lots of casts
When defining the P/Invoke signatures and structs, we follow the guidelines in the [interop best practices documentation](https://docs.microsoft.com/en-us/dotnet/standard/native-interop/best-practices).
+The runtime repo makes use of [source-generated p/invokes](../design/features/source-generator-pinvokes.md) whenever possible (see [the compatibility doc](../design/libraries/DllImportGenerator/Compatibility.md) for unsupported scenarios). Methods should be marked `GeneratedDllImport` and be `static` and `partial`.
+
+If implicit framework references are disabled (as is the case for most libraries projects), explicit references to the below are required for marshalling arrays:
+ - `System.Memory`
+ - `System.Runtime.CompilerServices.Unsafe`
+
## UNIX shims
Often, various UNIX flavors offer the same API from the point-of-view of compatibility with C/C++ source code, but they do not have the same ABI. e.g. Fields can be laid out differently, constants can have different numeric values, exports can be named differently, etc. There are not only differences between operating systems (Mac OS X vs. Ubuntu vs. FreeBSD), but also differences related to the underlying processor architecture (x64 vs. x86 vs. ARM).
@@ -174,6 +180,8 @@ This leaves us with a situation where we can't write portable P/Invoke declarati
To address this, we're moving to a model where all UNIX interop from dotnet/runtime starts with a P/Invoke to a C++ lib written specifically for dotnet/runtime. These libs -- System.*.Native.so (aka "shims") -- are intended to be very thin layers over underlying platform libraries. Generally, they are not there to add any significant abstraction, but to create a stable ABI such that the same IL assembly can work across UNIX flavors.
+The System.Native shims are a private implementation detail of the Microsoft.NETCore.App shared framework and are intended only for use by code inside of the shared framework. Calling into the shims from external to Microsoft.NETCore.App has similar risks to using private reflection, with no guarantees from version to version or even patch to patch of stable exports. Assemblies that ship outside of the shared framework (e.g. Microsoft.Extensions.*) must not directly access the shims.
+
Guidelines for shim C++ API:
- Keep them as "thin"/1:1 as possible.
diff --git a/docs/design/mono/debugger.md b/docs/design/mono/debugger.md
index 3a3a2936b79eb4..2268d81bf1047b 100644
--- a/docs/design/mono/debugger.md
+++ b/docs/design/mono/debugger.md
@@ -18,4 +18,11 @@ Web Assembly Debugger supports usage of following attributes:
- Stepping In/Over: results in an additional stepping need to proceed to the next line.
- __System.Diagnostics.DebuggerDisplay__
- __System.Diagnostics.DebuggerTypeProxy__
-- ...
\ No newline at end of file
+- __System.Diagnostics.DebuggerBrowsable__ ([doc](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.debuggerbrowsableattribute?view=net-6.0))
+ - Collapsed - displayed normally.
+ - RootHidden:
+ - Simple type - not displayed in the debugger window.
+ - Collection / Array - the values of a collection are displayed in a flat view, using the naming convention: *rootName[idx]*.
+
+ - Never - not displayed in the debugger window.
+
diff --git a/docs/workflow/Codespaces.md b/docs/workflow/Codespaces.md
index 391cd4087429e6..858da337216f25 100644
--- a/docs/workflow/Codespaces.md
+++ b/docs/workflow/Codespaces.md
@@ -5,13 +5,11 @@ Codespaces allows you to develop in a Docker container running in the cloud. You
dotnet/runtime runs a nightly GitHub Action to build the latest code in the repo. This allows you to immediately start developing and testing after creating a codespace without having to build the whole repo. When the machine is created, it will have built the repo using the code as of 6 AM UTC that morning.
-**NOTE**: In order to use a prebuilt codespace, when you create your machine be sure to select an **`8 core`** machine.
-
1. From https://github.com/dotnet/runtime, drop-down the `Code` button and select the `Codespaces` tab.

-2. Select `8-core` for the Machine type. This will ensure you get a "pre built" image.
+2. Select the Machine type. For dotnet/runtime, it is recommended to select at least a `4-core` machine. You can also verify that a "Prebuild" is ready.

diff --git a/docs/workflow/codespace-machine-size.png b/docs/workflow/codespace-machine-size.png
index 07945fb9ff672d..d0687c85b05f36 100644
Binary files a/docs/workflow/codespace-machine-size.png and b/docs/workflow/codespace-machine-size.png differ
diff --git a/docs/workflow/debugging/coreclr/debugging-aot-compilers.md b/docs/workflow/debugging/coreclr/debugging-aot-compilers.md
index 048d571df45f21..0a216b7320100a 100644
--- a/docs/workflow/debugging/coreclr/debugging-aot-compilers.md
+++ b/docs/workflow/debugging/coreclr/debugging-aot-compilers.md
@@ -19,7 +19,7 @@ Built in debugging aids in the managed compilers
---------------------------------
- When debugging a multi-threaded component of the compiler and not investigating a multi-threading issue itself, it is generally advisable to disable the use of multiple threads.
-To do this use the `--parallelism 1` switch (for crossgen2) or `--singlethreaded` (for ILC) to specify that the maximum parallelism of the process shall be 1.
+To do this use the `--parallelism 1` switch to specify that the maximum parallelism of the process shall be 1.
- When debugging the behavior of compiling a single method, the compiler may be instructed to only compile a single method. This is done via the various --singlemethod options
diff --git a/eng/Subsets.props b/eng/Subsets.props
index f0bb31a28aea72..772fbfcb995329 100644
--- a/eng/Subsets.props
+++ b/eng/Subsets.props
@@ -243,7 +243,7 @@
-
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index e3a571f451cdea..6267584b91fd12 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -1,8 +1,8 @@
-
+ https://github.com/dotnet/icu
- d9371f17932fbf828f1d1e2f21a99b64ba40eba5
+ 35aca8766e42ad0f9ef458c4106917f1075cf230https://github.com/dotnet/msquic
@@ -16,111 +16,111 @@
https://github.com/dotnet/wcf7f504aabb1988e9a093c1e74d8040bd52feb2f01
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ 58a3ab6364cc934622ae0b09c3ef09768723a4e1
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ 58a3ab6364cc934622ae0b09c3ef09768723a4e1
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ 58a3ab6364cc934622ae0b09c3ef09768723a4e1
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ 58a3ab6364cc934622ae0b09c3ef09768723a4e1
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ 58a3ab6364cc934622ae0b09c3ef09768723a4e1
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ 58a3ab6364cc934622ae0b09c3ef09768723a4e1
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ 58a3ab6364cc934622ae0b09c3ef09768723a4e1
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ 58a3ab6364cc934622ae0b09c3ef09768723a4e1
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667https://github.com/microsoft/vstest
@@ -202,53 +202,57 @@
https://github.com/dotnet/llvm-project662aff66999c435aec09c58643e9fd703eadc3e0
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ c8f3b36d6d5da74333c6755ccd5687127bcd9905
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ c8f3b36d6d5da74333c6755ccd5687127bcd9905
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ c8f3b36d6d5da74333c6755ccd5687127bcd9905
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ c8f3b36d6d5da74333c6755ccd5687127bcd9905
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ c8f3b36d6d5da74333c6755ccd5687127bcd9905
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ c8f3b36d6d5da74333c6755ccd5687127bcd9905
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ c8f3b36d6d5da74333c6755ccd5687127bcd9905
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ c8f3b36d6d5da74333c6755ccd5687127bcd9905
-
+ https://github.com/dotnet/linker
- 41467d340a3345f08cb8ba67c20c1ea40c57682f
+ 1a6468ff722c8d362f37638989ec01ab9975ac28
-
+ https://github.com/dotnet/xharness
- 7ad8d01a879af9437a7c33d01409bd761700cdad
+ 7c293e5b676eb5b57418f775587badad65ec07f5
-
+ https://github.com/dotnet/xharness
- 7ad8d01a879af9437a7c33d01409bd761700cdad
+ 7c293e5b676eb5b57418f775587badad65ec07f5
-
+
+ https://github.com/dotnet/xharness
+ 7c293e5b676eb5b57418f775587badad65ec07f5
+
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ a0f6d2432ce3d1bb30ee747bb534f477c75fd667https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
@@ -266,9 +270,9 @@
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization91d6b3c1f51888d166701510189505f35714665c
-
+ https://github.com/dotnet/hotreload-utils
- f0d838421286fed81005fd4ddf6562555b641b3b
+ 49dd195f467aa45d467a38ca02ae95d1b59062cehttps://github.com/dotnet/runtime-assets
diff --git a/eng/Versions.props b/eng/Versions.props
index 47d31b37c8e334..92cfc5d2f3a554 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -42,50 +42,50 @@
3.11.0
- 4.0.0-4.final
- 4.0.0-4.final
+ 4.0.1
+ 4.0.13.3.2
- 4.0.0-4.final
- 4.0.0-4.final
+ 4.0.1
+ 4.0.17.0.0-preview1.21613.12.0.0-alpha.1.21525.11
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 2.5.1-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.2
+ 2.5.1-beta.22053.2
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.2
+ 7.0.0-beta.22053.26.0.0-preview.1.102
- 7.0.0-alpha.1.21620.1
- 7.0.0-alpha.1.21620.1
- 7.0.0-alpha.1.21620.1
+ 7.0.0-alpha.1.22052.8
+ 7.0.0-alpha.1.22052.8
+ 7.0.0-alpha.1.22052.83.1.0
- 7.0.0-alpha.1.21620.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
+ 7.0.0-alpha.1.22052.8
+ 1.0.0-alpha.1.22052.1
+ 1.0.0-alpha.1.22052.1
+ 1.0.0-alpha.1.22052.1
+ 1.0.0-alpha.1.22052.1
+ 1.0.0-alpha.1.22052.1
+ 1.0.0-alpha.1.22052.1
+ 1.0.0-alpha.1.22052.1
+ 1.0.0-alpha.1.22052.15.0.04.3.0
@@ -120,11 +120,11 @@
5.0.05.0.04.9.0-rc2.21473.1
- 7.0.0-alpha.1.21620.1
- 7.0.0-alpha.1.21620.1
+ 7.0.0-alpha.1.22052.8
+ 7.0.0-alpha.1.22052.84.5.44.5.0
- 7.0.0-alpha.1.21620.1
+ 7.0.0-alpha.1.22052.87.0.0-beta.21620.37.0.0-beta.21620.3
@@ -160,12 +160,13 @@
1.0.1-prerelease-0000616.9.0-preview-20201201-01
- 1.0.0-prerelease.21622.1
- 1.0.0-prerelease.21622.1
- 1.0.2-alpha.0.21620.2
+ 1.0.0-prerelease.22053.2
+ 1.0.0-prerelease.22053.2
+ 1.0.0-prerelease.22053.2
+ 1.0.2-alpha.0.22053.32.4.2-pre.92.4.2
- 1.3.0
+ 3.1.012.0.32.0.44.12.0
@@ -175,10 +176,10 @@
6.0.0-preview-20211019.1
- 7.0.100-1.21620.1
+ 7.0.100-1.22053.1$(MicrosoftNETILLinkTasksVersion)
- 7.0.0-alpha.1.21620.1
+ 7.0.0-alpha.1.22053.17.0.0-alpha.1.21529.3
diff --git a/eng/common/cross/arm/tizen-build-rootfs.sh b/eng/common/cross/arm/tizen-build-rootfs.sh
new file mode 100644
index 00000000000000..9fdb32e920e22c
--- /dev/null
+++ b/eng/common/cross/arm/tizen-build-rootfs.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+set -e
+
+__ARM_HARDFP_CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+__TIZEN_CROSSDIR="$__ARM_HARDFP_CrossDir/tizen"
+
+if [[ -z "$ROOTFS_DIR" ]]; then
+ echo "ROOTFS_DIR is not defined."
+ exit 1;
+fi
+
+TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp
+mkdir -p $TIZEN_TMP_DIR
+
+# Download files
+echo ">>Start downloading files"
+VERBOSE=1 $__ARM_HARDFP_CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR
+echo "<>Start constructing Tizen rootfs"
+TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm`
+cd $ROOTFS_DIR
+for f in $TIZEN_RPM_FILES; do
+ rpm2cpio $f | cpio -idm --quiet
+done
+echo "<>Start configuring Tizen rootfs"
+ln -sfn asm-arm ./usr/include/asm
+patch -p1 < $__TIZEN_CROSSDIR/tizen.patch
+echo "</dev/null; then
+ VERBOSE=0
+fi
+
+Log()
+{
+ if [ $VERBOSE -ge $1 ]; then
+ echo ${@:2}
+ fi
+}
+
+Inform()
+{
+ Log 1 -e "\x1B[0;34m$@\x1B[m"
+}
+
+Debug()
+{
+ Log 2 -e "\x1B[0;32m$@\x1B[m"
+}
+
+Error()
+{
+ >&2 Log 0 -e "\x1B[0;31m$@\x1B[m"
+}
+
+Fetch()
+{
+ URL=$1
+ FILE=$2
+ PROGRESS=$3
+ if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then
+ CURL_OPT="--progress-bar"
+ else
+ CURL_OPT="--silent"
+ fi
+ curl $CURL_OPT $URL > $FILE
+}
+
+hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; }
+hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; }
+hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; }
+
+TMPDIR=$1
+if [ ! -d $TMPDIR ]; then
+ TMPDIR=./tizen_tmp
+ Debug "Create temporary directory : $TMPDIR"
+ mkdir -p $TMPDIR
+fi
+
+TIZEN_URL=http://download.tizen.org/snapshots/tizen
+BUILD_XML=build.xml
+REPOMD_XML=repomd.xml
+PRIMARY_XML=primary.xml
+TARGET_URL="http://__not_initialized"
+
+Xpath_get()
+{
+ XPATH_RESULT=''
+ XPATH=$1
+ XML_FILE=$2
+ RESULT=$(xmllint --xpath $XPATH $XML_FILE)
+ if [[ -z ${RESULT// } ]]; then
+ Error "Can not find target from $XML_FILE"
+ Debug "Xpath = $XPATH"
+ exit 1
+ fi
+ XPATH_RESULT=$RESULT
+}
+
+fetch_tizen_pkgs_init()
+{
+ TARGET=$1
+ PROFILE=$2
+ Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE"
+
+ TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs
+ if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi
+ mkdir -p $TMP_PKG_DIR
+
+ PKG_URL=$TIZEN_URL/$PROFILE/latest
+
+ BUILD_XML_URL=$PKG_URL/$BUILD_XML
+ TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML
+ TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML
+ TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML
+ TMP_PRIMARYGZ=${TMP_PRIMARY}.gz
+
+ Fetch $BUILD_XML_URL $TMP_BUILD
+
+ Debug "fetch $BUILD_XML_URL to $TMP_BUILD"
+
+ TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()"
+ Xpath_get $TARGET_XPATH $TMP_BUILD
+ TARGET_PATH=$XPATH_RESULT
+ TARGET_URL=$PKG_URL/$TARGET_PATH
+
+ REPOMD_URL=$TARGET_URL/repodata/repomd.xml
+ PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)'
+
+ Fetch $REPOMD_URL $TMP_REPOMD
+
+ Debug "fetch $REPOMD_URL to $TMP_REPOMD"
+
+ Xpath_get $PRIMARY_XPATH $TMP_REPOMD
+ PRIMARY_XML_PATH=$XPATH_RESULT
+ PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH
+
+ Fetch $PRIMARY_URL $TMP_PRIMARYGZ
+
+ Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ"
+
+ gunzip $TMP_PRIMARYGZ
+
+ Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY"
+}
+
+fetch_tizen_pkgs()
+{
+ ARCH=$1
+ PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="location"]/@href)'
+
+ PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="checksum"]/text())'
+
+ for pkg in ${@:2}
+ do
+ Inform "Fetching... $pkg"
+ XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg}
+ XPATH=${XPATH/_ARCH_/$ARCH}
+ Xpath_get $XPATH $TMP_PRIMARY
+ PKG_PATH=$XPATH_RESULT
+
+ XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg}
+ XPATH=${XPATH/_ARCH_/$ARCH}
+ Xpath_get $XPATH $TMP_PRIMARY
+ CHECKSUM=$XPATH_RESULT
+
+ PKG_URL=$TARGET_URL/$PKG_PATH
+ PKG_FILE=$(basename $PKG_PATH)
+ PKG_PATH=$TMPDIR/$PKG_FILE
+
+ Debug "Download $PKG_URL to $PKG_PATH"
+ Fetch $PKG_URL $PKG_PATH true
+
+ echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null
+ if [ $? -ne 0 ]; then
+ Error "Fail to fetch $PKG_URL to $PKG_PATH"
+ Debug "Checksum = $CHECKSUM"
+ exit 1
+ fi
+ done
+}
+
+Inform "Initialize arm base"
+fetch_tizen_pkgs_init standard base
+Inform "fetch common packages"
+fetch_tizen_pkgs armv7hl gcc gcc-devel-static glibc glibc-devel libicu libicu-devel libatomic linux-glibc-devel keyutils keyutils-devel libkeyutils
+Inform "fetch coreclr packages"
+fetch_tizen_pkgs armv7hl lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
+Inform "fetch corefx packages"
+fetch_tizen_pkgs armv7hl libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel
+
+Inform "Initialize standard unified"
+fetch_tizen_pkgs_init standard unified
+Inform "fetch corefx packages"
+fetch_tizen_pkgs armv7hl gssdp gssdp-devel tizen-release
+
diff --git a/eng/common/cross/arm/tizen/tizen.patch b/eng/common/cross/arm/tizen/tizen.patch
new file mode 100644
index 00000000000000..fb12ade7250ae9
--- /dev/null
+++ b/eng/common/cross/arm/tizen/tizen.patch
@@ -0,0 +1,9 @@
+diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so
+--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900
++++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900
+@@ -2,4 +2,4 @@
+ Use the shared library, but some functions are only in
+ the static library, so try that secondarily. */
+ OUTPUT_FORMAT(elf32-littlearm)
+-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-armhf.so.3 ) )
++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-armhf.so.3 ) )
diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh
index 5102245b7b5e3f..e94d13d62ef64d 100755
--- a/eng/common/cross/build-rootfs.sh
+++ b/eng/common/cross/build-rootfs.sh
@@ -185,8 +185,8 @@ while :; do
__LLDB_Package="liblldb-6.0-dev"
;;
tizen)
- if [ "$__BuildArch" != "armel" ] && [ "$__BuildArch" != "arm64" ]; then
- echo "Tizen is available only for armel and arm64."
+ if [ "$__BuildArch" != "arm" ] && [ "$__BuildArch" != "armel" ] && [ "$__BuildArch" != "arm64" ]; then
+ echo "Tizen is available only for arm, armel and arm64."
usage;
exit 1;
fi
diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake
index 9d22fc92693031..f7878dddd39211 100644
--- a/eng/common/cross/toolchain.cmake
+++ b/eng/common/cross/toolchain.cmake
@@ -34,6 +34,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm")
else()
set(TOOLCHAIN "arm-linux-gnueabihf")
endif()
+ if(TIZEN)
+ set(TIZEN_TOOLCHAIN "armv7hl-tizen-linux-gnueabihf/9.2.0")
+ endif()
elseif(TARGET_ARCH_NAME STREQUAL "arm64")
set(CMAKE_SYSTEM_PROCESSOR aarch64)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl)
@@ -66,6 +69,10 @@ endif()
# Specify include paths
if(TIZEN)
+ if(TARGET_ARCH_NAME STREQUAL "arm")
+ include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
+ include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7hl-tizen-linux-gnueabihf)
+ endif()
if(TARGET_ARCH_NAME STREQUAL "armel")
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi)
@@ -160,7 +167,7 @@ if(LINUX)
add_toolchain_linker_flag("-Wl,--rpath-link=${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}")
endif()
-if(TARGET_ARCH_NAME STREQUAL "armel")
+if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$")
if(TIZEN)
add_toolchain_linker_flag("-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
add_toolchain_linker_flag("-L${CROSS_ROOTFS}/lib")
@@ -215,7 +222,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86")
endif()
if(TIZEN)
- if(TARGET_ARCH_NAME MATCHES "^(armel|arm64)$")
+ if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$")
add_compile_options(-Wno-deprecated-declarations) # compile-time option
add_compile_options(-D__extern_always_inline=inline) # compile-time option
endif()
diff --git a/eng/generators.targets b/eng/generators.targets
index 4c32554b5e2195..843842937ef3f7 100644
--- a/eng/generators.targets
+++ b/eng/generators.targets
@@ -84,10 +84,6 @@
true$(DefineConstants);DLLIMPORTGENERATOR_INTERNALUNSAFE
-
-
- $(DefineConstants);DLLIMPORTGENERATOR_ENABLED
-
diff --git a/eng/testing/WasmRunnerTemplate.cmd b/eng/testing/WasmRunnerTemplate.cmd
index 9382fa8368fc53..a668ce2c6a464c 100644
--- a/eng/testing/WasmRunnerTemplate.cmd
+++ b/eng/testing/WasmRunnerTemplate.cmd
@@ -48,7 +48,7 @@ if /I [%XHARNESS_COMMAND%] == [test] (
set "JS_ENGINE_ARGS=--engine-arg^=--stack-trace-limit^=1000"
)
) else (
- if [%BROWSER_PATH%] == [] (
+ if [%BROWSER_PATH%] == [] if not [%HELIX_CORRELATION_PAYLOAD%] == [] (
set "BROWSER_PATH=--browser-path^=%HELIX_CORRELATION_PAYLOAD%\chrome-win\chrome.exe"
)
)
diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets
index 8c7a6a44a5d22f..c41a0d28e03375 100644
--- a/eng/testing/tests.ioslike.targets
+++ b/eng/testing/tests.ioslike.targets
@@ -130,7 +130,6 @@
-
@@ -169,6 +168,7 @@
+
diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets
index 192363c4b170a1..da8da1d2f4bfa9 100644
--- a/eng/testing/tests.mobile.targets
+++ b/eng/testing/tests.mobile.targets
@@ -198,7 +198,8 @@
+ AfterTargets="ComputeResolvedFilesToPublishList"
+ Condition="'$(TestFramework)' == 'xunit'">
<_runnerFilesToPublish Include="$(AndroidTestRunnerDir)*" Condition="'$(TargetOS)' == 'Android'" />
<_runnerFilesToPublish Include="$(AppleTestRunnerDir)*" Condition="'$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator'" />
diff --git a/eng/testing/tests.props b/eng/testing/tests.props
index a6a9034a8099d2..86c661d4bb2813 100644
--- a/eng/testing/tests.props
+++ b/eng/testing/tests.props
@@ -38,6 +38,10 @@
+
+
+
+
$(RunTestsCommand) --runtime-path "$(NetCoreAppCurrentTestHostPath.TrimEnd('\/'))"$(RunTestsCommand) --rsp-file "$(TestRspFile)"
- "$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture) $(TargetOS.ToLowerInvariant()) $(TestProjectName) $(AdditionalXHarnessArguments)
+
+
+
+ "$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture) $(TargetOS.ToLowerInvariant()) $(TestProjectName)
+ $(RunTestsCommand) $(Configuration) $(AdditionalXHarnessArguments)
+ $(RunTestsCommand) $(AdditionalXHarnessArguments)"$(RunScriptOutputPath)" $(JSEngine) $(AssemblyName).dll $(Scenario)
diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets
index 273ab76ef90a3f..191d2c2295690f 100644
--- a/eng/testing/tests.wasm.targets
+++ b/eng/testing/tests.wasm.targets
@@ -47,7 +47,8 @@
<_XHarnessArgs Condition="'$(IsFunctionalTest)' == 'true'" >$(_XHarnessArgs) --expected-exit-code=$(ExpectedExitCode)
<_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgs)
- <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps'">--run WasmTestRunner.dll $(AssemblyName).dll
+ <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps' and '$(WasmMainAssemblyFileName)' == ''">--run WasmTestRunner.dll $(AssemblyName).dll
+ <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(WasmMainAssemblyFileName)' != ''">--run $(WasmMainAssemblyFileName)
<_AppArgs Condition="'$(IsFunctionalTest)' == 'true'">--run $(AssemblyName).dll
<_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs)
diff --git a/global.json b/global.json
index e2c9f881274f55..16691a4405b23b 100644
--- a/global.json
+++ b/global.json
@@ -12,12 +12,12 @@
"python3": "3.7.1"
},
"msbuild-sdks": {
- "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "7.0.0-beta.21621.3",
- "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21621.3",
- "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21621.3",
- "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.21621.3",
+ "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "7.0.0-beta.22053.2",
+ "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22053.2",
+ "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22053.2",
+ "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.22053.2",
"Microsoft.Build.NoTargets": "3.1.0",
"Microsoft.Build.Traversal": "3.0.23",
- "Microsoft.NET.Sdk.IL": "7.0.0-alpha.1.21620.1"
+ "Microsoft.NET.Sdk.IL": "7.0.0-alpha.1.22052.8"
}
}
diff --git a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
index f62c8b95b7c143..e1230d59401d86 100644
--- a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
+++ b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
@@ -78,6 +78,10 @@
AnyCPU$(DefineConstants);TARGET_ARM64
+
+ AnyCPU
+ $(DefineConstants);TARGET_LOONGARCH64
+
diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
index 240a78ecfdde75..977d73e5c3b990 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
@@ -15,7 +15,7 @@
namespace System
{
[NonVersionable]
- public unsafe partial struct RuntimeTypeHandle : ISerializable
+ public unsafe partial struct RuntimeTypeHandle : IEquatable, ISerializable
{
// Returns handle for interop with EE. The handle is guaranteed to be non-null.
internal RuntimeTypeHandle GetNativeHandle()
@@ -814,7 +814,7 @@ RuntimeMethodHandleInternal Value
}
[NonVersionable]
- public unsafe partial struct RuntimeMethodHandle : ISerializable
+ public unsafe partial struct RuntimeMethodHandle : IEquatable, ISerializable
{
// Returns handle for interop with EE. The handle is guaranteed to be non-null.
internal static IRuntimeMethodInfo EnsureNonNullMethodInfo(IRuntimeMethodInfo method)
@@ -1139,7 +1139,7 @@ internal sealed class RuntimeFieldInfoStub : IRuntimeFieldInfo
}
[NonVersionable]
- public unsafe struct RuntimeFieldHandle : ISerializable
+ public unsafe struct RuntimeFieldHandle : IEquatable, ISerializable
{
// Returns handle for interop with EE. The handle is guaranteed to be non-null.
internal RuntimeFieldHandle GetNativeHandle()
diff --git a/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs b/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs
index 8da9217b477bc0..28af4119833668 100644
--- a/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs
+++ b/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs
@@ -619,7 +619,7 @@ private String GetTypeString(IDiaSymbol s)
else if (tag == SymTagEnum.SymTagBaseType)
{
BasicType bt = (BasicType) s.baseType;
- str.AppendFormat("(base type={0}, len={1:d})", bt.ToString(), s.length);
+ str.Append($"(base type={bt}, len={s.length:d})");
}
else if (tag == SymTagEnum.SymTagArrayType)
{
@@ -677,7 +677,7 @@ private String GetTypeString(IDiaSymbol s)
try
{
succ = true;
- str.AppendFormat("[{0:d}]", s.length/s.type.length );
+ str.Append($"[{s.length/s.type.length:d}]");
}
catch (Exception)
{
diff --git a/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
index ad4830fa73b1ab..a79cbb3c0ff0c9 100644
--- a/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
+++ b/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
@@ -494,7 +494,7 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTypeInstantiationArgument(CORINFO_CLAS
// If fFullInst=TRUE (regardless of fNamespace and fAssembly), include namespace and assembly for any type parameters
// If fAssembly=TRUE, suffix with a comma and the full assembly qualification
// return size of representation
-int interceptor_ICJI::appendClassName(__deref_inout_ecount(*pnBufLen) char16_t** ppBuf,
+int interceptor_ICJI::appendClassName(_Outptr_result_buffer_(*pnBufLen) char16_t** ppBuf,
int* pnBufLen,
CORINFO_CLASS_HANDLE cls,
bool fNamespace,
@@ -1257,7 +1257,7 @@ HRESULT interceptor_ICJI::GetErrorHRESULT(struct _EXCEPTION_POINTERS* pException
// Fetches the message of the current exception
// Returns the size of the message (including terminating null). This can be
// greater than bufferLength if the buffer is insufficient.
-uint32_t interceptor_ICJI::GetErrorMessage(__inout_ecount(bufferLength) char16_t *buffer, uint32_t bufferLength)
+uint32_t interceptor_ICJI::GetErrorMessage(_Inout_updates_(bufferLength) char16_t *buffer, uint32_t bufferLength)
{
mc->cr->AddCall("GetErrorMessage");
return original_ICorJitInfo->GetErrorMessage(buffer, bufferLength);
@@ -1367,7 +1367,7 @@ unsigned interceptor_ICJI::getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */
// this function is for debugging only.
size_t interceptor_ICJI::findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */
mdToken metaTOK, /* IN */
- __out_ecount(FQNameCapacity) char* szFQName, /* OUT */
+ _Out_writes_(FQNameCapacity) char* szFQName, /* OUT */
size_t FQNameCapacity /* IN */
)
{
diff --git a/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp
index 3ff21d07fb59f0..17faf7a1442620 100644
--- a/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp
+++ b/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp
@@ -426,7 +426,7 @@ CORINFO_CLASS_HANDLE MyICJI::getTypeInstantiationArgument(CORINFO_CLASS_HANDLE c
// If fFullInst=TRUE (regardless of fNamespace and fAssembly), include namespace and assembly for any type parameters
// If fAssembly=TRUE, suffix with a comma and the full assembly qualification
// return size of representation
-int MyICJI::appendClassName(__deref_inout_ecount(*pnBufLen) char16_t** ppBuf,
+int MyICJI::appendClassName(_Outptr_result_buffer_(*pnBufLen) char16_t** ppBuf,
int* pnBufLen,
CORINFO_CLASS_HANDLE cls,
bool fNamespace,
@@ -1099,7 +1099,7 @@ HRESULT MyICJI::GetErrorHRESULT(struct _EXCEPTION_POINTERS* pExceptionPointers)
// Fetches the message of the current exception
// Returns the size of the message (including terminating null). This can be
// greater than bufferLength if the buffer is insufficient.
-uint32_t MyICJI::GetErrorMessage(__inout_ecount(bufferLength) char16_t* buffer, uint32_t bufferLength)
+uint32_t MyICJI::GetErrorMessage(_Inout_updates_(bufferLength) char16_t* buffer, uint32_t bufferLength)
{
jitInstance->mc->cr->AddCall("GetErrorMessage");
LogError("Hit unimplemented GetErrorMessage");
@@ -1214,7 +1214,7 @@ unsigned MyICJI::getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */
// this function is for debugging only.
size_t MyICJI::findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */
mdToken metaTOK, /* IN */
- __out_ecount(FQNameCapacity) char* szFQName, /* OUT */
+ _Out_writes_(FQNameCapacity) char* szFQName, /* OUT */
size_t FQNameCapacity /* IN */
)
{
diff --git a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp
index 169d0a268483b7..242771fe796c85 100644
--- a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp
+++ b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp
@@ -134,7 +134,7 @@ BOOL GetRegistryLongValue(HKEY hKeyParent, LPCWSTR szKey, LPCWSTR szName, long*
// Note:
//
//----------------------------------------------------------------------------
-HRESULT GetCurrentModuleFileName(__out_ecount(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer)
+HRESULT GetCurrentModuleFileName(_Out_writes_(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer)
{
LIMITED_METHOD_CONTRACT;
@@ -252,7 +252,7 @@ void GetDebuggerSettingInfo(LPWSTR wszDebuggerString, DWORD cchDebuggerString, B
// * wszDebuggerString can be NULL. When wszDebuggerString is NULL, pcchDebuggerString should
// * point to a DWORD of zero. pcchDebuggerString cannot be NULL, and the DWORD pointed by
// * pcchDebuggerString will store the used or required string buffer size in characters.
-HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString, *pcchDebuggerString)
+HRESULT GetDebuggerSettingInfoWorker(_Out_writes_to_opt_(*pcchDebuggerString, *pcchDebuggerString)
LPWSTR wszDebuggerString,
DWORD* pcchDebuggerString,
BOOL* pfAuto)
diff --git a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h
index f941151b2e5493..a7f1eec42765de 100644
--- a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h
+++ b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h
@@ -14,14 +14,14 @@ BOOL GetRegistryLongValue(HKEY hKeyParent, // Parent key.
long* pValue, // Put value here, if found.
BOOL fReadNonVirtualizedKey); // Whether to read 64-bit hive on WOW64
-HRESULT GetCurrentModuleFileName(__out_ecount(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer);
+HRESULT GetCurrentModuleFileName(_Out_writes_(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer);
#ifndef _WIN64
BOOL RunningInWow64();
#endif
BOOL IsCurrentModuleFileNameInAutoExclusionList();
-HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString, *pcchDebuggerString)
+HRESULT GetDebuggerSettingInfoWorker(_Out_writes_to_opt_(*pcchDebuggerString, *pcchDebuggerString)
LPWSTR wszDebuggerString,
DWORD* pcchDebuggerString,
BOOL* pfAuto);
diff --git a/src/coreclr/binder/textualidentityparser.cpp b/src/coreclr/binder/textualidentityparser.cpp
index 5d85a0a71cf377..f69e0bf66b202b 100644
--- a/src/coreclr/binder/textualidentityparser.cpp
+++ b/src/coreclr/binder/textualidentityparser.cpp
@@ -77,7 +77,7 @@ namespace BINDER_SPACE
}
}
- inline void BinToUnicodeHex(const BYTE *pSrc, UINT cSrc, __out_ecount(2*cSrc) LPWSTR pDst)
+ inline void BinToUnicodeHex(const BYTE *pSrc, UINT cSrc, _Out_writes_(2*cSrc) LPWSTR pDst)
{
UINT x;
UINT y;
diff --git a/src/coreclr/classlibnative/bcltype/arraynative.cpp b/src/coreclr/classlibnative/bcltype/arraynative.cpp
index 738fd98c7f9e76..ca60fa978a626c 100644
--- a/src/coreclr/classlibnative/bcltype/arraynative.cpp
+++ b/src/coreclr/classlibnative/bcltype/arraynative.cpp
@@ -1154,23 +1154,25 @@ FCIMPL2_IV(void, ArrayNative::InitializeArray, ArrayBase* pArrayRef, FCALLRuntim
}
FCIMPLEND
-FCIMPL3(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetType, INT32* count)
+FCIMPL3_VVI(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetTypeUnsafe, INT32* count)
{
FCALL_CONTRACT;
struct
{
REFLECTFIELDREF refField;
+ REFLECTCLASSBASEREF refClass;
} gc;
gc.refField = (REFLECTFIELDREF)ObjectToOBJECTREF(FCALL_RFH_TO_REFLECTFIELD(structField));
+ gc.refClass = (REFLECTCLASSBASEREF)ObjectToOBJECTREF(FCALL_RTH_TO_REFLECTCLASS(targetTypeUnsafe));
void* data;
- HELPER_METHOD_FRAME_BEGIN_RET_1(gc);
+ HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc);
FieldDesc* pField = (FieldDesc*)gc.refField->GetField();
if (!pField->IsRVA())
COMPlusThrow(kArgumentException);
- TypeHandle targetTypeHandle = FCALL_RTH_TO_REFLECTCLASS(targetType)->GetType();
+ TypeHandle targetTypeHandle = gc.refClass->GetType();
if (!CorTypeInfo::IsPrimitiveType(targetTypeHandle.GetSignatureCorElementType()) && !targetTypeHandle.IsEnum())
COMPlusThrow(kArgumentException);
@@ -1180,8 +1182,9 @@ FCIMPL3(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField
// Report the RVA field to the logger.
g_IBCLogger.LogRVADataAccess(pField);
- _ASSERTE(data != NULL && count != NULL);
data = pField->GetStaticAddressHandle(NULL);
+ _ASSERTE(data != NULL);
+ _ASSERTE(count != NULL);
if (AlignUp((UINT_PTR)data, targetTypeSize) != (UINT_PTR)data)
COMPlusThrow(kArgumentException);
diff --git a/src/coreclr/classlibnative/bcltype/arraynative.h b/src/coreclr/classlibnative/bcltype/arraynative.h
index 6a1c8979525cdb..bd74be3d3ea6ac 100644
--- a/src/coreclr/classlibnative/bcltype/arraynative.h
+++ b/src/coreclr/classlibnative/bcltype/arraynative.h
@@ -48,7 +48,7 @@ class ArrayNative
// This method will acquire data to create a span from a TypeHandle
// to a field.
- static FCDECL3(void*, GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetType, INT32* count);
+ static FCDECL3_VVI(void*, GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetTypeUnsafe, INT32* count);
private:
// Helper for CreateInstance
diff --git a/src/coreclr/debug/daccess/daccess.cpp b/src/coreclr/debug/daccess/daccess.cpp
index f9ec95c1f41838..5c2c55cfe439bf 100644
--- a/src/coreclr/debug/daccess/daccess.cpp
+++ b/src/coreclr/debug/daccess/daccess.cpp
@@ -92,10 +92,10 @@ BOOL WINAPI DllMain(HANDLE instance, DWORD reason, LPVOID reserved)
}
HRESULT
-ConvertUtf8(__in LPCUTF8 utf8,
+ConvertUtf8(_In_ LPCUTF8 utf8,
ULONG32 bufLen,
ULONG32* nameLen,
- __out_ecount_part_opt(bufLen, *nameLen) PWSTR buffer)
+ _Out_writes_to_opt_(bufLen, *nameLen) PWSTR buffer)
{
if (nameLen)
{
@@ -118,9 +118,9 @@ ConvertUtf8(__in LPCUTF8 utf8,
}
HRESULT
-AllocUtf8(__in_opt LPCWSTR wstr,
+AllocUtf8(_In_opt_ LPCWSTR wstr,
ULONG32 srcChars,
- __deref_out LPUTF8* utf8)
+ _Outptr_ LPUTF8* utf8)
{
ULONG32 chars = WszWideCharToMultiByte(CP_UTF8, 0, wstr, srcChars,
NULL, 0, NULL, NULL);
@@ -165,7 +165,7 @@ HRESULT
GetFullClassNameFromMetadata(IMDInternalImport* mdImport,
mdTypeDef classToken,
ULONG32 bufferChars,
- __inout_ecount(bufferChars) LPUTF8 buffer)
+ _Inout_updates_(bufferChars) LPUTF8 buffer)
{
HRESULT hr;
LPCUTF8 baseName, namespaceName;
@@ -179,7 +179,7 @@ HRESULT
GetFullMethodNameFromMetadata(IMDInternalImport* mdImport,
mdMethodDef methodToken,
ULONG32 bufferChars,
- __inout_ecount(bufferChars) LPUTF8 buffer)
+ _Inout_updates_(bufferChars) LPUTF8 buffer)
{
HRESULT status;
HRESULT hr;
@@ -228,13 +228,13 @@ GetFullMethodNameFromMetadata(IMDInternalImport* mdImport,
}
HRESULT
-SplitFullName(__in_z __in PCWSTR fullName,
+SplitFullName(_In_z_ PCWSTR fullName,
SplitSyntax syntax,
ULONG32 memberDots,
- __deref_out_opt LPUTF8* namespaceName,
- __deref_out_opt LPUTF8* typeName,
- __deref_out_opt LPUTF8* memberName,
- __deref_out_opt LPUTF8* params)
+ _Outptr_opt_ LPUTF8* namespaceName,
+ _Outptr_opt_ LPUTF8* typeName,
+ _Outptr_opt_ LPUTF8* memberName,
+ _Outptr_opt_ LPUTF8* params)
{
HRESULT status;
PCWSTR paramsStart, memberStart, memberEnd, typeStart;
@@ -401,7 +401,7 @@ SplitFullName(__in_z __in PCWSTR fullName,
}
int
-CompareUtf8(__in LPCUTF8 str1, __in LPCUTF8 str2, __in ULONG32 nameFlags)
+CompareUtf8(_In_ LPCUTF8 str1, _In_ LPCUTF8 str2, _In_ ULONG32 nameFlags)
{
if (nameFlags & CLRDATA_BYNAME_CASE_INSENSITIVE)
{
@@ -469,8 +469,8 @@ MetaEnum::End(void)
HRESULT
MetaEnum::NextToken(mdToken* token,
- __deref_opt_out_opt LPCUTF8* namespaceName,
- __deref_opt_out_opt LPCUTF8* name)
+ _Outptr_opt_result_maybenull_ LPCUTF8* namespaceName,
+ _Outptr_opt_result_maybenull_ LPCUTF8* name)
{
HRESULT hr;
if (!m_mdImport)
@@ -584,8 +584,8 @@ MetaEnum::NextDomainToken(AppDomain** appDomain,
}
HRESULT
-MetaEnum::NextTokenByName(__in_opt LPCUTF8 namespaceName,
- __in_opt LPCUTF8 name,
+MetaEnum::NextTokenByName(_In_opt_ LPCUTF8 namespaceName,
+ _In_opt_ LPCUTF8 name,
ULONG32 nameFlags,
mdToken* token)
{
@@ -617,8 +617,8 @@ MetaEnum::NextTokenByName(__in_opt LPCUTF8 namespaceName,
}
HRESULT
-MetaEnum::NextDomainTokenByName(__in_opt LPCUTF8 namespaceName,
- __in_opt LPCUTF8 name,
+MetaEnum::NextDomainTokenByName(_In_opt_ LPCUTF8 namespaceName,
+ _In_opt_ LPCUTF8 name,
ULONG32 nameFlags,
AppDomain** appDomain, mdToken* token)
{
@@ -755,7 +755,7 @@ SplitName::Clear(void)
}
HRESULT
-SplitName::SplitString(__in_opt PCWSTR fullName)
+SplitName::SplitString(_In_opt_ PCWSTR fullName)
{
if (m_syntax == SPLIT_NO_NAME)
{
@@ -800,7 +800,7 @@ WCHAR* wcrscan(LPCWSTR beg, LPCWSTR end, WCHAR ch)
// sepName to point to the second '+' character in the string. When sepName
// points to the first '+' character this function will return "Outer" in
// pResult and sepName will point one WCHAR before fullName.
-HRESULT NextEnclosingClasName(LPCWSTR fullName, __deref_inout LPWSTR& sepName, __deref_out LPUTF8 *pResult)
+HRESULT NextEnclosingClasName(LPCWSTR fullName, _Outref_ LPWSTR& sepName, _Outptr_ LPUTF8 *pResult)
{
if (sepName < fullName)
{
@@ -994,7 +994,7 @@ SplitName::FindField(IMDInternalImport* mdInternal)
}
HRESULT
-SplitName::AllocAndSplitString(__in_opt PCWSTR fullName,
+SplitName::AllocAndSplitString(_In_opt_ PCWSTR fullName,
SplitSyntax syntax,
ULONG32 nameFlags,
ULONG32 memberDots,
@@ -1024,7 +1024,7 @@ SplitName::AllocAndSplitString(__in_opt PCWSTR fullName,
}
HRESULT
-SplitName::CdStartMethod(__in_opt PCWSTR fullName,
+SplitName::CdStartMethod(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
Module* mod,
mdTypeDef typeToken,
@@ -1138,7 +1138,7 @@ SplitName::CdNextDomainMethod(CLRDATA_ENUM* handle,
}
HRESULT
-SplitName::CdStartField(__in_opt PCWSTR fullName,
+SplitName::CdStartField(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
ULONG32 fieldFlags,
IXCLRDataTypeInstance* fromTypeInst,
@@ -1241,7 +1241,7 @@ SplitName::CdNextField(ClrDataAccess* dac,
IXCLRDataValue** value,
ULONG32 nameBufRetLen,
ULONG32* nameLenRet,
- __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
+ _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
IXCLRDataModule** tokenScopeRet,
mdFieldDef* tokenRet)
{
@@ -1419,7 +1419,7 @@ SplitName::CdNextDomainField(ClrDataAccess* dac,
}
HRESULT
-SplitName::CdStartType(__in_opt PCWSTR fullName,
+SplitName::CdStartType(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
Module* mod,
AppDomain* appDomain,
@@ -3698,7 +3698,7 @@ ClrDataAccess::GetRuntimeNameByAddress(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *symbolLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ],
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ],
/* [out] */ CLRDATA_ADDRESS* displacement)
{
HRESULT status;
@@ -4317,7 +4317,7 @@ ClrDataAccess::GetDataByAddress(
/* [in] */ IXCLRDataTask* tlsTask,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataValue **value,
/* [out] */ CLRDATA_ADDRESS *displacement)
{
@@ -5642,7 +5642,7 @@ ClrDataAccess::GetFullMethodName(
IN MethodDesc* methodDesc,
IN ULONG32 symbolChars,
OUT ULONG32* symbolLen,
- __out_ecount_part_opt(symbolChars, *symbolLen) LPWSTR symbol
+ _Out_writes_to_opt_(symbolChars, *symbolLen) LPWSTR symbol
)
{
StackSString s;
@@ -5737,7 +5737,7 @@ ClrDataAccess::RawGetMethodName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *symbolLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ],
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ],
/* [out] */ CLRDATA_ADDRESS* displacement)
{
#ifdef TARGET_ARM
@@ -6460,7 +6460,7 @@ ClrDataAccess::GetMetaDataFileInfoFromPEFile(PEAssembly *pPEAssembly,
DWORD &dwDataSize,
DWORD &dwRvaHint,
bool &isNGEN,
- __out_ecount(cchFilePath) LPWSTR wszFilePath,
+ _Out_writes_(cchFilePath) LPWSTR wszFilePath,
const DWORD cchFilePath)
{
SUPPORTS_DAC_HOST_ONLY;
@@ -6524,7 +6524,7 @@ ClrDataAccess::GetMetaDataFileInfoFromPEFile(PEAssembly *pPEAssembly,
bool ClrDataAccess::GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly,
DWORD &dwTimeStamp,
DWORD &dwSize,
- __out_ecount(cchFilePath) LPWSTR wszFilePath,
+ _Out_writes_(cchFilePath) LPWSTR wszFilePath,
const DWORD cchFilePath)
{
SUPPORTS_DAC_HOST_ONLY;
@@ -6548,7 +6548,7 @@ bool ClrDataAccess::GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly,
// In the end we add given ilExtension.
// This dependecy is based on Apollo installer behavior.
bool ClrDataAccess::GetILImageNameFromNgenImage( LPCWSTR ilExtension,
- __out_ecount(cchFilePath) LPWSTR wszFilePath,
+ _Out_writes_(cchFilePath) LPWSTR wszFilePath,
const DWORD cchFilePath)
{
if (wszFilePath == NULL || cchFilePath == 0)
@@ -7565,9 +7565,9 @@ typedef struct _WER_RUNTIME_EXCEPTION_INFORMATION
// else detailed error code.
//
//----------------------------------------------------------------------------
-STDAPI OutOfProcessExceptionEventGetWatsonBucket(__in PDWORD pContext,
- __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
- __out GenericModeBlock * pGMB)
+STDAPI OutOfProcessExceptionEventGetWatsonBucket(_In_ PDWORD pContext,
+ _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
+ _Out_ GenericModeBlock * pGMB)
{
HANDLE hProcess = pExceptionInformation->hProcess;
HANDLE hThread = pExceptionInformation->hThread;
@@ -7656,12 +7656,12 @@ STDAPI OutOfProcessExceptionEventGetWatsonBucket(__in PDWORD pContext,
// Since this is called by external modules it's important that we don't let any exceptions leak out (see Win8 95224).
//
//----------------------------------------------------------------------------
-STDAPI OutOfProcessExceptionEventCallback(__in PDWORD pContext,
- __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
- __out BOOL * pbOwnershipClaimed,
- __out_ecount(*pchSize) PWSTR pwszEventName,
+STDAPI OutOfProcessExceptionEventCallback(_In_ PDWORD pContext,
+ _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
+ _Out_ BOOL * pbOwnershipClaimed,
+ _Out_writes_(*pchSize) PWSTR pwszEventName,
__inout PDWORD pchSize,
- __out PDWORD pdwSignatureCount)
+ _Out_ PDWORD pdwSignatureCount)
{
SUPPORTS_DAC_HOST_ONLY;
@@ -7748,12 +7748,12 @@ STDAPI OutOfProcessExceptionEventCallback(__in PDWORD pContext,
// Since this is called by external modules it's important that we don't let any exceptions leak out (see Win8 95224).
//
//----------------------------------------------------------------------------
-STDAPI OutOfProcessExceptionEventSignatureCallback(__in PDWORD pContext,
- __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
- __in DWORD dwIndex,
- __out_ecount(*pchName) PWSTR pwszName,
+STDAPI OutOfProcessExceptionEventSignatureCallback(_In_ PDWORD pContext,
+ _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
+ _In_ DWORD dwIndex,
+ _Out_writes_(*pchName) PWSTR pwszName,
__inout PDWORD pchName,
- __out_ecount(*pchValue) PWSTR pwszValue,
+ _Out_writes_(*pchValue) PWSTR pwszValue,
__inout PDWORD pchValue)
{
SUPPORTS_DAC_HOST_ONLY;
@@ -7873,12 +7873,12 @@ STDAPI OutOfProcessExceptionEventSignatureCallback(__in PDWORD pContext,
// this function are of the pwszName and pwszValue buffers.
//
//----------------------------------------------------------------------------
-STDAPI OutOfProcessExceptionEventDebuggerLaunchCallback(__in PDWORD pContext,
- __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
- __out BOOL * pbCustomDebuggerNeeded,
- __out_ecount_opt(*pchSize) PWSTR pwszDebuggerLaunch,
+STDAPI OutOfProcessExceptionEventDebuggerLaunchCallback(_In_ PDWORD pContext,
+ _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
+ _Out_ BOOL * pbCustomDebuggerNeeded,
+ _Out_writes_opt_(*pchSize) PWSTR pwszDebuggerLaunch,
__inout PDWORD pchSize,
- __out BOOL * pbAutoLaunchDebugger)
+ _Out_ BOOL * pbAutoLaunchDebugger)
{
SUPPORTS_DAC_HOST_ONLY;
diff --git a/src/coreclr/debug/daccess/dacfn.cpp b/src/coreclr/debug/daccess/dacfn.cpp
index e1b83aba17e20c..11f798ed04c199 100644
--- a/src/coreclr/debug/daccess/dacfn.cpp
+++ b/src/coreclr/debug/daccess/dacfn.cpp
@@ -89,7 +89,7 @@ DacExceptionFilter(Exception* ex, ClrDataAccess* access,
}
void __cdecl
-DacWarning(__in char* format, ...)
+DacWarning(_In_ char* format, ...)
{
char text[256];
va_list args;
diff --git a/src/coreclr/debug/daccess/dacimpl.h b/src/coreclr/debug/daccess/dacimpl.h
index 948bef16e498da..57a4dc1bbab8fc 100644
--- a/src/coreclr/debug/daccess/dacimpl.h
+++ b/src/coreclr/debug/daccess/dacimpl.h
@@ -222,22 +222,22 @@ struct METH_EXTENTS
CLRDATA_ADDRESS_RANGE extents[1];
};
-HRESULT ConvertUtf8(__in LPCUTF8 utf8,
+HRESULT ConvertUtf8(_In_ LPCUTF8 utf8,
ULONG32 bufLen,
ULONG32* nameLen,
- __out_ecount_part_opt(bufLen, *nameLen) PWSTR buffer);
-HRESULT AllocUtf8(__in_opt LPCWSTR wstr,
+ _Out_writes_to_opt_(bufLen, *nameLen) PWSTR buffer);
+HRESULT AllocUtf8(_In_opt_ LPCWSTR wstr,
ULONG32 srcChars,
- __deref_out LPUTF8* utf8);
+ _Outptr_ LPUTF8* utf8);
HRESULT GetFullClassNameFromMetadata(IMDInternalImport* mdImport,
mdTypeDef classToken,
ULONG32 bufferChars,
- __inout_ecount(bufferChars) LPUTF8 buffer);
+ _Inout_updates_(bufferChars) LPUTF8 buffer);
HRESULT GetFullMethodNameFromMetadata(IMDInternalImport* mdImport,
mdMethodDef methodToken,
ULONG32 bufferChars,
- __inout_ecount(bufferChars) LPUTF8 buffer);
+ _Inout_updates_(bufferChars) LPUTF8 buffer);
enum SplitSyntax
{
@@ -247,15 +247,15 @@ enum SplitSyntax
SPLIT_NO_NAME,
};
-HRESULT SplitFullName(__in_z __in PCWSTR fullName,
+HRESULT SplitFullName(_In_z_ PCWSTR fullName,
SplitSyntax syntax,
ULONG32 memberDots,
- __deref_out_opt LPUTF8* namespaceName,
- __deref_out_opt LPUTF8* typeName,
- __deref_out_opt LPUTF8* memberName,
- __deref_out_opt LPUTF8* params);
+ _Outptr_opt_ LPUTF8* namespaceName,
+ _Outptr_opt_ LPUTF8* typeName,
+ _Outptr_opt_ LPUTF8* memberName,
+ _Outptr_opt_ LPUTF8* params);
-int CompareUtf8(__in LPCUTF8 str1, __in LPCUTF8 str2, __in ULONG32 nameFlags);
+int CompareUtf8(_In_ LPCUTF8 str1, _In_ LPCUTF8 str2, _In_ ULONG32 nameFlags);
#define INH_STATIC \
(CLRDATA_VALUE_ALL_KINDS | \
@@ -304,16 +304,16 @@ class MetaEnum
void End(void);
HRESULT NextToken(mdToken* token,
- __deref_opt_out_opt LPCUTF8* namespaceName,
- __deref_opt_out_opt LPCUTF8* name);
+ _Outptr_opt_result_maybenull_ LPCUTF8* namespaceName,
+ _Outptr_opt_result_maybenull_ LPCUTF8* name);
HRESULT NextDomainToken(AppDomain** appDomain,
mdToken* token);
- HRESULT NextTokenByName(__in_opt LPCUTF8 namespaceName,
- __in_opt LPCUTF8 name,
+ HRESULT NextTokenByName(_In_opt_ LPCUTF8 namespaceName,
+ _In_opt_ LPCUTF8 name,
ULONG32 nameFlags,
mdToken* token);
- HRESULT NextDomainTokenByName(__in_opt LPCUTF8 namespaceName,
- __in_opt LPCUTF8 name,
+ HRESULT NextDomainTokenByName(_In_opt_ LPCUTF8 namespaceName,
+ _In_opt_ LPCUTF8 name,
ULONG32 nameFlags,
AppDomain** appDomain, mdToken* token);
@@ -410,7 +410,7 @@ class SplitName
void Delete(void);
void Clear(void);
- HRESULT SplitString(__in_opt PCWSTR fullName);
+ HRESULT SplitString(_In_opt_ PCWSTR fullName);
bool FindType(IMDInternalImport* mdInternal);
bool FindMethod(IMDInternalImport* mdInternal);
@@ -421,13 +421,13 @@ class SplitName
return CompareUtf8(str1, str2, m_nameFlags);
}
- static HRESULT AllocAndSplitString(__in_opt PCWSTR fullName,
+ static HRESULT AllocAndSplitString(_In_opt_ PCWSTR fullName,
SplitSyntax syntax,
ULONG32 nameFlags,
ULONG32 memberDots,
SplitName** split);
- static HRESULT CdStartMethod(__in_opt PCWSTR fullName,
+ static HRESULT CdStartMethod(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
Module* mod,
mdTypeDef typeToken,
@@ -441,7 +441,7 @@ class SplitName
AppDomain** appDomain,
mdMethodDef* token);
- static HRESULT CdStartField(__in_opt PCWSTR fullName,
+ static HRESULT CdStartField(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
ULONG32 fieldFlags,
IXCLRDataTypeInstance* fromTypeInst,
@@ -462,14 +462,14 @@ class SplitName
IXCLRDataValue** value,
ULONG32 nameBufRetLen,
ULONG32* nameLenRet,
- __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
+ _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
IXCLRDataModule** tokenScopeRet,
mdFieldDef* tokenRet);
static HRESULT CdNextDomainField(ClrDataAccess* dac,
CLRDATA_ENUM* handle,
IXCLRDataValue** value);
- static HRESULT CdStartType(__in_opt PCWSTR fullName,
+ static HRESULT CdStartType(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
Module* mod,
AppDomain* appDomain,
@@ -901,7 +901,7 @@ class ClrDataAccess
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ],
/* [out] */ CLRDATA_ADDRESS* displacement);
virtual HRESULT STDMETHODCALLTYPE StartEnumAppDomains(
@@ -972,7 +972,7 @@ class ClrDataAccess
/* [in] */ IXCLRDataTask* tlsTask,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataValue **value,
/* [out] */ CLRDATA_ADDRESS *displacement);
@@ -1080,10 +1080,10 @@ class ClrDataAccess
virtual HRESULT STDMETHODCALLTYPE GetAppDomainStoreData(struct DacpAppDomainStoreData *data);
virtual HRESULT STDMETHODCALLTYPE GetAppDomainList(unsigned int count, CLRDATA_ADDRESS values[], unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetAppDomainData(CLRDATA_ADDRESS addr, struct DacpAppDomainData *data);
- virtual HRESULT STDMETHODCALLTYPE GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetAssemblyList(CLRDATA_ADDRESS appDomain, int count, CLRDATA_ADDRESS values[], int *fetched);
virtual HRESULT STDMETHODCALLTYPE GetAssemblyData(CLRDATA_ADDRESS baseDomainPtr, CLRDATA_ADDRESS assembly, struct DacpAssemblyData *data);
- virtual HRESULT STDMETHODCALLTYPE GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetThreadData(CLRDATA_ADDRESS thread, struct DacpThreadData *data);
virtual HRESULT STDMETHODCALLTYPE GetThreadFromThinlockID(UINT thinLockId, CLRDATA_ADDRESS *pThread);
virtual HRESULT STDMETHODCALLTYPE GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower, CLRDATA_ADDRESS *upper, CLRDATA_ADDRESS *fp);
@@ -1091,27 +1091,27 @@ class ClrDataAccess
virtual HRESULT STDMETHODCALLTYPE GetMethodDescData(CLRDATA_ADDRESS methodDesc, CLRDATA_ADDRESS ip, struct DacpMethodDescData *data, ULONG cRevertedRejitVersions, DacpReJitData * rgRevertedRejitData, ULONG * pcNeededRevertedRejitData);
virtual HRESULT STDMETHODCALLTYPE GetMethodDescPtrFromIP(CLRDATA_ADDRESS ip, CLRDATA_ADDRESS * ppMD);
- virtual HRESULT STDMETHODCALLTYPE GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetMethodDescPtrFromFrame(CLRDATA_ADDRESS frameAddr, CLRDATA_ADDRESS * ppMD);
virtual HRESULT STDMETHODCALLTYPE GetCodeHeaderData(CLRDATA_ADDRESS ip, struct DacpCodeHeaderData *data);
virtual HRESULT STDMETHODCALLTYPE GetThreadpoolData(struct DacpThreadpoolData *data);
virtual HRESULT STDMETHODCALLTYPE GetWorkRequestData(CLRDATA_ADDRESS addrWorkRequest, struct DacpWorkRequestData *data);
virtual HRESULT STDMETHODCALLTYPE GetObjectData(CLRDATA_ADDRESS objAddr, struct DacpObjectData *data);
- virtual HRESULT STDMETHODCALLTYPE GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *stringData, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *className, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, __out_z __inout_ecount(count) WCHAR *mtName, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *stringData, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *className, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, _Inout_updates_z_(count) WCHAR *mtName, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetMethodTableData(CLRDATA_ADDRESS mt, struct DacpMethodTableData *data);
virtual HRESULT STDMETHODCALLTYPE GetMethodTableFieldData(CLRDATA_ADDRESS mt, struct DacpMethodTableFieldData *data);
virtual HRESULT STDMETHODCALLTYPE GetMethodTableTransparencyData(CLRDATA_ADDRESS mt, struct DacpMethodTableTransparencyData *data);
virtual HRESULT STDMETHODCALLTYPE GetMethodTableForEEClass(CLRDATA_ADDRESS eeClass, CLRDATA_ADDRESS *value);
virtual HRESULT STDMETHODCALLTYPE GetFieldDescData(CLRDATA_ADDRESS fieldDesc, struct DacpFieldDescData *data);
- virtual HRESULT STDMETHODCALLTYPE GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z __inout_ecount(count) WCHAR *frameName, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, _Inout_updates_z_(count) WCHAR *frameName, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetModule(CLRDATA_ADDRESS addr, IXCLRDataModule **mod);
virtual HRESULT STDMETHODCALLTYPE GetModuleData(CLRDATA_ADDRESS moduleAddr, struct DacpModuleData *data);
virtual HRESULT STDMETHODCALLTYPE TraverseModuleMap(ModuleMapType mmt, CLRDATA_ADDRESS moduleAddr, MODULEMAPTRAVERSE pCallback, LPVOID token);
virtual HRESULT STDMETHODCALLTYPE GetMethodDescFromToken(CLRDATA_ADDRESS moduleAddr, mdToken token, CLRDATA_ADDRESS *methodDesc);
virtual HRESULT STDMETHODCALLTYPE GetPEFileBase(CLRDATA_ADDRESS addr, CLRDATA_ADDRESS *base);
- virtual HRESULT STDMETHODCALLTYPE GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *fileName, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *fileName, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetAssemblyModuleList(CLRDATA_ADDRESS assembly, unsigned int count, CLRDATA_ADDRESS modules[], unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetGCHeapData(struct DacpGcHeapData *data);
virtual HRESULT STDMETHODCALLTYPE GetGCHeapList(unsigned int count, CLRDATA_ADDRESS heaps[], unsigned int *pNeeded);
@@ -1127,7 +1127,7 @@ class ClrDataAccess
virtual HRESULT STDMETHODCALLTYPE TraverseEHInfo(CLRDATA_ADDRESS ip, DUMPEHINFO pCallback, LPVOID token);
virtual HRESULT STDMETHODCALLTYPE GetStressLogAddress(CLRDATA_ADDRESS *stressLog);
virtual HRESULT STDMETHODCALLTYPE GetJitManagerList(unsigned int count, struct DacpJitManagerInfo managers[], unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, __out_z __inout_ecount(count) char *name, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, _Inout_updates_z_(count) char *name, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetJumpThunkTarget(T_CONTEXT *ctx, CLRDATA_ADDRESS *targetIP, CLRDATA_ADDRESS *targetMD);
virtual HRESULT STDMETHODCALLTYPE TraverseLoaderHeap(CLRDATA_ADDRESS loaderHeapAddr, VISITHEAP pCallback);
virtual HRESULT STDMETHODCALLTYPE GetCodeHeapList(CLRDATA_ADDRESS jitManager, unsigned int count, struct DacpJitCodeHeapInfo codeHeaps[], unsigned int *pNeeded);
@@ -1152,17 +1152,17 @@ class ClrDataAccess
virtual HRESULT STDMETHODCALLTYPE GetDacModuleHandle(HMODULE *phModule);
virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyList(CLRDATA_ADDRESS appDomain, int count, CLRDATA_ADDRESS values[], unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *paths, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *configFile, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *base, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *paths, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *configFile, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *base, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyData(CLRDATA_ADDRESS assembly, unsigned int *pContext, HRESULT *pResult);
- virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetStackReferences(DWORD osThreadID, ISOSStackRefEnum **ppEnum);
- virtual HRESULT STDMETHODCALLTYPE GetRegisterName(int regNum, unsigned int count, __out_z __inout_ecount(count) WCHAR *buffer, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetRegisterName(int regNum, unsigned int count, _Inout_updates_z_(count) WCHAR *buffer, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetHandleEnum(ISOSHandleEnum **ppHandleEnum);
virtual HRESULT STDMETHODCALLTYPE GetHandleEnumForTypes(unsigned int types[], unsigned int count, ISOSHandleEnum **ppHandleEnum);
@@ -1244,12 +1244,12 @@ class ClrDataAccess
HRESULT GetFullMethodName(IN MethodDesc* methodDesc,
IN ULONG32 symbolChars,
IN ULONG32* symbolLen,
- __out_ecount_part_opt(symbolChars, *symbolLen) LPWSTR symbol);
+ _Out_writes_to_opt_(symbolChars, *symbolLen) LPWSTR symbol);
HRESULT RawGetMethodName(/* [in] */ CLRDATA_ADDRESS address,
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ],
/* [out] */ CLRDATA_ADDRESS* displacement);
HRESULT FollowStubStep(
@@ -1512,17 +1512,17 @@ class ClrDataAccess
DWORD &dwDataSize,
DWORD &dwRvaHint,
bool &isNGEN,
- __out_ecount(cchFilePath) LPWSTR wszFilePath,
+ _Out_writes_(cchFilePath) LPWSTR wszFilePath,
DWORD cchFilePath);
static bool GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly,
DWORD &dwTimeStamp,
DWORD &dwSize,
- __out_ecount(cchPath) LPWSTR wszPath,
+ _Out_writes_(cchPath) LPWSTR wszPath,
const DWORD cchPath);
#if defined(FEATURE_CORESYSTEM)
static bool GetILImageNameFromNgenImage(LPCWSTR ilExtension,
- __out_ecount(cchFilePath) LPWSTR wszFilePath,
+ _Out_writes_(cchFilePath) LPWSTR wszFilePath,
const DWORD cchFilePath);
#endif // FEATURE_CORESYSTEM
};
@@ -2348,7 +2348,7 @@ class ClrDataAppDomain : public IXCLRDataAppDomain
virtual HRESULT STDMETHODCALLTYPE GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetUniqueID(
/* [out] */ ULONG64 *id);
@@ -2429,17 +2429,17 @@ class ClrDataAssembly : public IXCLRDataAssembly
virtual HRESULT STDMETHODCALLTYPE GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetFileName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetDisplayName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetFlags(
/* [out] */ ULONG32 *flags);
@@ -2601,12 +2601,12 @@ class ClrDataModule : public IXCLRDataModule, IXCLRDataModule2
virtual HRESULT STDMETHODCALLTYPE GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetFileName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetVersionId(
/* [out] */ GUID* vid);
@@ -2747,7 +2747,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition
/* [out][in] */ CLRDATA_ENUM *handle,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags,
/* [out] */ mdFieldDef *token);
@@ -2756,7 +2756,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition
/* [out][in] */ CLRDATA_ENUM *handle,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags,
/* [out] */ IXCLRDataModule** tokenScope,
@@ -2791,7 +2791,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition
/* [in] */ mdFieldDef token,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32* flags);
@@ -2800,7 +2800,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition
/* [in] */ mdFieldDef token,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32* flags);
@@ -2808,7 +2808,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetTokenAndScope(
/* [out] */ mdTypeDef *token,
@@ -2918,7 +2918,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token);
virtual HRESULT STDMETHODCALLTYPE StartEnumStaticFieldsByName(
@@ -2952,7 +2952,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance
/* [out] */ IXCLRDataValue **value,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataModule** tokenScope,
/* [out] */ mdFieldDef *token);
@@ -2985,7 +2985,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetStaticFieldByToken2(
/* [in] */ IXCLRDataModule* tokenScope,
@@ -2994,13 +2994,13 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetModule(
/* [out] */ IXCLRDataModule **mod);
@@ -3095,7 +3095,7 @@ class ClrDataMethodDefinition : public IXCLRDataMethodDefinition
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetTokenAndScope(
/* [out] */ mdMethodDef *token,
@@ -3200,7 +3200,7 @@ class ClrDataMethodInstance : public IXCLRDataMethodInstance
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetFlags(
/* [out] */ ULONG32 *flags);
@@ -3304,7 +3304,7 @@ class ClrDataTask : public IXCLRDataTask
virtual HRESULT STDMETHODCALLTYPE GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetUniqueID(
/* [out] */ ULONG64 *id);
@@ -3500,7 +3500,7 @@ class ClrDataFrame : public IXCLRDataFrame,
/* [out] */ IXCLRDataValue **arg,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetNumLocalVariables(
/* [out] */ ULONG32 *numLocals);
@@ -3510,7 +3510,7 @@ class ClrDataFrame : public IXCLRDataFrame,
/* [out] */ IXCLRDataValue **localVariable,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetNumTypeArguments(
/* [out] */ ULONG32 *numTypeArgs);
@@ -3523,7 +3523,7 @@ class ClrDataFrame : public IXCLRDataFrame,
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetMethodInstance(
/* [out] */ IXCLRDataMethodInstance **method);
@@ -3620,7 +3620,7 @@ class ClrDataExceptionState : public IXCLRDataExceptionState
virtual HRESULT STDMETHODCALLTYPE GetString(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *strLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]);
virtual HRESULT STDMETHODCALLTYPE IsSameState(
/* [in] */ EXCEPTION_RECORD64 *exRecord,
@@ -3724,7 +3724,7 @@ class ClrDataValue : public IXCLRDataValue
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token);
virtual HRESULT STDMETHODCALLTYPE GetNumFields2(
@@ -3742,7 +3742,7 @@ class ClrDataValue : public IXCLRDataValue
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token);
virtual HRESULT STDMETHODCALLTYPE EnumField2(
@@ -3750,7 +3750,7 @@ class ClrDataValue : public IXCLRDataValue
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataModule** tokenScope,
/* [out] */ mdFieldDef *token);
@@ -3783,7 +3783,7 @@ class ClrDataValue : public IXCLRDataValue
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetFieldByToken2(
/* [in] */ IXCLRDataModule* tokenScope,
@@ -3791,7 +3791,7 @@ class ClrDataValue : public IXCLRDataValue
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetAssociatedValue(
/* [out] */ IXCLRDataValue **assocValue);
@@ -3802,7 +3802,7 @@ class ClrDataValue : public IXCLRDataValue
virtual HRESULT STDMETHODCALLTYPE GetString(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *strLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]);
virtual HRESULT STDMETHODCALLTYPE GetArrayProperties(
/* [out] */ ULONG32 *rank,
@@ -3844,7 +3844,7 @@ class ClrDataValue : public IXCLRDataValue
IXCLRDataValue** pubValue,
ULONG32 nameBufRetLen,
ULONG32* nameLenRet,
- __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
+ _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
IXCLRDataModule** tokenScopeRet,
mdFieldDef* tokenRet);
@@ -3854,7 +3854,7 @@ class ClrDataValue : public IXCLRDataValue
IXCLRDataValue** pubValue,
ULONG32 nameBufRetLen,
ULONG32* nameLenRet,
- __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
+ _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
IXCLRDataModule** tokenScopeRet,
mdFieldDef* tokenRet)
{
diff --git a/src/coreclr/debug/daccess/inspect.cpp b/src/coreclr/debug/daccess/inspect.cpp
index 21afb220103cb6..0a3138c5b77dbd 100644
--- a/src/coreclr/debug/daccess/inspect.cpp
+++ b/src/coreclr/debug/daccess/inspect.cpp
@@ -574,7 +574,7 @@ ClrDataValue::GetFieldByIndex(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token)
{
// XXX Microsoft - Obsolete method, never implemented.
@@ -661,7 +661,7 @@ ClrDataValue::EnumField(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token)
{
return EnumField2(handle, field, nameBufLen, nameLen, nameBuf,
@@ -674,7 +674,7 @@ ClrDataValue::EnumField2(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataModule** tokenScope,
/* [out] */ mdFieldDef *token)
{
@@ -839,7 +839,7 @@ ClrDataValue::GetFieldByToken(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
return GetFieldByToken2(NULL, token, field, bufLen, nameLen, nameBuf);
}
@@ -851,7 +851,7 @@ ClrDataValue::GetFieldByToken2(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
HRESULT status;
@@ -1029,7 +1029,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataValue::GetString(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *strLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ])
{
HRESULT status;
@@ -1381,7 +1381,7 @@ ClrDataValue::NewFromFieldDesc(ClrDataAccess* dac,
IXCLRDataValue** pubValue,
ULONG32 nameBufRetLen,
ULONG32 *nameLenRet,
- __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
+ _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
IXCLRDataModule** tokenScopeRet,
mdFieldDef *tokenRet)
{
@@ -1991,7 +1991,7 @@ ClrDataTypeDefinition::EnumField(
/* [out][in] */ CLRDATA_ENUM *handle,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags,
/* [out] */ mdFieldDef *token)
@@ -2005,7 +2005,7 @@ ClrDataTypeDefinition::EnumField2(
/* [out][in] */ CLRDATA_ENUM *handle,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags,
/* [out] */ IXCLRDataModule** tokenScope,
@@ -2180,7 +2180,7 @@ ClrDataTypeDefinition::GetFieldByToken(
/* [in] */ mdFieldDef token,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags)
{
@@ -2194,7 +2194,7 @@ ClrDataTypeDefinition::GetFieldByToken2(
/* [in] */ mdFieldDef token,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags)
{
@@ -2276,7 +2276,7 @@ ClrDataTypeDefinition::GetName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
HRESULT status = S_OK;
@@ -3014,7 +3014,7 @@ ClrDataTypeInstance::GetStaticFieldByIndex(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token)
{
HRESULT status;
@@ -3186,7 +3186,7 @@ ClrDataTypeInstance::EnumStaticField2(
/* [out] */ IXCLRDataValue **value,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataModule** tokenScope,
/* [out] */ mdFieldDef *token)
{
@@ -3351,7 +3351,7 @@ ClrDataTypeInstance::GetStaticFieldByToken(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
return GetStaticFieldByToken2(NULL, token, tlsTask, field,
bufLen, nameLen, nameBuf);
@@ -3365,7 +3365,7 @@ ClrDataTypeInstance::GetStaticFieldByToken2(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
HRESULT status;
@@ -3430,7 +3430,7 @@ ClrDataTypeInstance::GetName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
HRESULT status = S_OK;
diff --git a/src/coreclr/debug/daccess/request.cpp b/src/coreclr/debug/daccess/request.cpp
index fe66a8b30b4212..1e327721f4a92d 100644
--- a/src/coreclr/debug/daccess/request.cpp
+++ b/src/coreclr/debug/daccess/request.cpp
@@ -580,7 +580,7 @@ ClrDataAccess::GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower,
}
HRESULT
-ClrDataAccess::GetRegisterName(int regNum, unsigned int count, __out_z __inout_ecount(count) WCHAR *buffer, unsigned int *pNeeded)
+ClrDataAccess::GetRegisterName(int regNum, unsigned int count, _Inout_updates_z_(count) WCHAR *buffer, unsigned int *pNeeded)
{
if (!buffer && !pNeeded)
return E_POINTER;
@@ -1322,7 +1322,7 @@ ClrDataAccess::GetMethodDescPtrFromIP(CLRDATA_ADDRESS ip, CLRDATA_ADDRESS * ppMD
}
HRESULT
-ClrDataAccess::GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded)
+ClrDataAccess::GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded)
{
if (methodDesc == 0)
return E_INVALIDARG;
@@ -1426,7 +1426,7 @@ ClrDataAccess::GetDomainFromContext(CLRDATA_ADDRESS contextAddr, CLRDATA_ADDRESS
HRESULT
-ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *stringData, unsigned int *pNeeded)
+ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *stringData, unsigned int *pNeeded)
{
if (obj == 0)
return E_INVALIDARG;
@@ -1478,7 +1478,7 @@ ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __ou
}
HRESULT
-ClrDataAccess::GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *className, unsigned int *pNeeded)
+ClrDataAccess::GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *className, unsigned int *pNeeded)
{
if (obj == 0)
return E_INVALIDARG;
@@ -1740,7 +1740,7 @@ ClrDataAccess::GetMethodTableData(CLRDATA_ADDRESS mt, struct DacpMethodTableData
}
HRESULT
-ClrDataAccess::GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, __out_z __inout_ecount(count) WCHAR *mtName, unsigned int *pNeeded)
+ClrDataAccess::GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, _Inout_updates_z_(count) WCHAR *mtName, unsigned int *pNeeded)
{
if (mt == 0)
return E_INVALIDARG;
@@ -2003,7 +2003,7 @@ ClrDataAccess::GetMethodTableForEEClass(CLRDATA_ADDRESS eeClass, CLRDATA_ADDRESS
}
HRESULT
-ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z __inout_ecount(count) WCHAR *frameName, unsigned int *pNeeded)
+ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, _Inout_updates_z_(count) WCHAR *frameName, unsigned int *pNeeded)
{
if (vtable == 0)
return E_INVALIDARG;
@@ -2043,7 +2043,7 @@ ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z
}
HRESULT
-ClrDataAccess::GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *fileName, unsigned int *pNeeded)
+ClrDataAccess::GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *fileName, unsigned int *pNeeded)
{
if (addr == 0 || (fileName == NULL && pNeeded == NULL) || (fileName != NULL && count == 0))
return E_INVALIDARG;
@@ -2369,7 +2369,7 @@ ClrDataAccess::GetFailedAssemblyData(CLRDATA_ADDRESS assembly, unsigned int *pCo
HRESULT
ClrDataAccess::GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count,
- __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded)
+ _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded)
{
if (assembly == NULL || (location == NULL && pNeeded == NULL) || (location != NULL && count == 0))
return E_INVALIDARG;
@@ -2399,7 +2399,7 @@ ClrDataAccess::GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int
}
HRESULT
-ClrDataAccess::GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded)
+ClrDataAccess::GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded)
{
if (assembly == NULL || (name == NULL && pNeeded == NULL) || (name != NULL && count == 0))
return E_INVALIDARG;
@@ -2509,7 +2509,7 @@ ClrDataAccess::GetFailedAssemblyList(CLRDATA_ADDRESS appDomain, int count,
}
HRESULT
-ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded)
+ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded)
{
SOSDacEnter();
@@ -2550,7 +2550,7 @@ ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_
HRESULT
ClrDataAccess::GetApplicationBase(CLRDATA_ADDRESS appDomain, int count,
- __out_z __inout_ecount(count) WCHAR *base, unsigned int *pNeeded)
+ _Inout_updates_z_(count) WCHAR *base, unsigned int *pNeeded)
{
// Method is not supported on CoreCLR
@@ -2559,7 +2559,7 @@ ClrDataAccess::GetApplicationBase(CLRDATA_ADDRESS appDomain, int count,
HRESULT
ClrDataAccess::GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count,
- __out_z __inout_ecount(count) WCHAR *paths, unsigned int *pNeeded)
+ _Inout_updates_z_(count) WCHAR *paths, unsigned int *pNeeded)
{
// Method is not supported on CoreCLR
@@ -2568,7 +2568,7 @@ ClrDataAccess::GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count,
HRESULT
ClrDataAccess::GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count,
- __out_z __inout_ecount(count) WCHAR *configFile, unsigned int *pNeeded)
+ _Inout_updates_z_(count) WCHAR *configFile, unsigned int *pNeeded)
{
// Method is not supported on CoreCLR
@@ -2620,7 +2620,7 @@ ClrDataAccess::GetAssemblyData(CLRDATA_ADDRESS cdBaseDomainPtr, CLRDATA_ADDRESS
}
HRESULT
-ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded)
+ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded)
{
SOSDacEnter();
Assembly* pAssembly = PTR_Assembly(TO_TADDR(assembly));
@@ -2661,7 +2661,7 @@ ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __o
}
HRESULT
-ClrDataAccess::GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded)
+ClrDataAccess::GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded)
{
if ((assembly == NULL) || (location == NULL && pNeeded == NULL) || (location != NULL && count == 0))
{
@@ -3636,7 +3636,7 @@ ClrDataAccess::GetSyncBlockCleanupData(CLRDATA_ADDRESS syncBlock, struct DacpSyn
}
HRESULT
-ClrDataAccess::GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, __out_z __inout_ecount(count) char *name, unsigned int *pNeeded)
+ClrDataAccess::GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, _Inout_updates_z_(count) char *name, unsigned int *pNeeded)
{
SOSDacEnter();
diff --git a/src/coreclr/debug/daccess/stack.cpp b/src/coreclr/debug/daccess/stack.cpp
index 6ced6d60b35391..dfcb16c31523f3 100644
--- a/src/coreclr/debug/daccess/stack.cpp
+++ b/src/coreclr/debug/daccess/stack.cpp
@@ -787,7 +787,7 @@ ClrDataFrame::GetArgumentByIndex(
/* [out] */ IXCLRDataValue **arg,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -942,7 +942,7 @@ ClrDataFrame::GetLocalVariableByIndex(
/* [out] */ IXCLRDataValue **localVariable,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -1111,7 +1111,7 @@ ClrDataFrame::GetCodeName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *symbolLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ])
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ])
{
HRESULT status = E_FAIL;
diff --git a/src/coreclr/debug/daccess/task.cpp b/src/coreclr/debug/daccess/task.cpp
index 42c4e0becce1c1..30abc5e090cc9e 100644
--- a/src/coreclr/debug/daccess/task.cpp
+++ b/src/coreclr/debug/daccess/task.cpp
@@ -149,7 +149,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataTask::GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -713,7 +713,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataAppDomain::GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status = S_OK;
@@ -1132,7 +1132,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataAssembly::GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -1160,7 +1160,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataAssembly::GetFileName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -1201,7 +1201,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataAssembly::GetDisplayName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -2376,7 +2376,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataModule::GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -2404,7 +2404,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataModule::GetFileName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -3115,7 +3115,7 @@ ClrDataMethodDefinition::GetName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -3858,7 +3858,7 @@ ClrDataMethodInstance::GetName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -4735,7 +4735,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataExceptionState::GetString(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *strLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ])
{
HRESULT status = E_FAIL;
diff --git a/src/coreclr/debug/dbgutil/machoreader.cpp b/src/coreclr/debug/dbgutil/machoreader.cpp
index d2801547cb9ba9..7fef34e1afb16d 100644
--- a/src/coreclr/debug/dbgutil/machoreader.cpp
+++ b/src/coreclr/debug/dbgutil/machoreader.cpp
@@ -229,9 +229,8 @@ MachOModule::ReadLoadCommands()
m_segments.push_back(segment);
// Calculate the load bias for the module. This is the value to add to the vmaddr of a
- // segment to get the actual address. For shared modules, this is 0 since those segments
- // are absolute address.
- if (segment->fileoff == 0 && segment->filesize > 0)
+ // segment to get the actual address.
+ if (strcmp(segment->segname, SEG_TEXT) == 0)
{
m_loadBias = m_baseAddress - segment->vmaddr;
}
diff --git a/src/coreclr/debug/di/cordb.cpp b/src/coreclr/debug/di/cordb.cpp
index 2c11397fcd3bc7..e195f3731a9e6f 100644
--- a/src/coreclr/debug/di/cordb.cpp
+++ b/src/coreclr/debug/di/cordb.cpp
@@ -443,10 +443,10 @@ STDAPI GetRequestedRuntimeInfo(LPCWSTR pExe,
LPCWSTR pConfigurationFile,
DWORD startupFlags,
DWORD runtimeInfoFlags,
- __out_ecount_opt(dwDirectory) LPWSTR pDirectory,
+ _Out_writes_bytes_opt_(dwDirectory) LPWSTR pDirectory,
DWORD dwDirectory,
DWORD *dwDirectoryLength,
- __out_ecount_opt(cchBuffer) LPWSTR pVersion,
+ _Out_writes_bytes_opt_(cchBuffer) LPWSTR pVersion,
DWORD cchBuffer,
DWORD* dwlength)
{
diff --git a/src/coreclr/debug/di/divalue.cpp b/src/coreclr/debug/di/divalue.cpp
index 2e70a306180c59..b8c9e745260db2 100644
--- a/src/coreclr/debug/di/divalue.cpp
+++ b/src/coreclr/debug/di/divalue.cpp
@@ -2320,7 +2320,7 @@ HRESULT CordbObjectValue::GetLength(ULONG32 *pcchString)
// Return Value: S_OK or CORDBG_E_INVALID_OBJECT, CORDBG_E_OBJECT_NEUTERED, or E_INVALIDARG on failure
HRESULT CordbObjectValue::GetString(ULONG32 cchString,
ULONG32 *pcchString,
- __out_ecount_opt(cchString) WCHAR szString[])
+ _Out_writes_bytes_opt_(cchString) WCHAR szString[])
{
PUBLIC_REENTRANT_API_ENTRY(this);
FAIL_IF_NEUTERED(this);
diff --git a/src/coreclr/debug/di/module.cpp b/src/coreclr/debug/di/module.cpp
index 9951d4a6af305f..6d6a7a55befa2e 100644
--- a/src/coreclr/debug/di/module.cpp
+++ b/src/coreclr/debug/di/module.cpp
@@ -1256,7 +1256,7 @@ HRESULT CordbModule::GetAssembly(ICorDebugAssembly **ppAssembly)
// Public implementation of ICorDebugModule::GetName,
// wrapper around code:GetNameWorker (which throws).
-HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
HRESULT hr = S_OK;
PUBLIC_API_BEGIN(this)
@@ -1324,7 +1324,7 @@ HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_pa
// Note:
// Filename isn't necessarily the same as the module name in the metadata.
//
-HRESULT CordbModule::GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CordbModule::GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
CONTRACTL
{
diff --git a/src/coreclr/debug/di/process.cpp b/src/coreclr/debug/di/process.cpp
index 9b21fa47e67285..59af4cc8d9c649 100644
--- a/src/coreclr/debug/di/process.cpp
+++ b/src/coreclr/debug/di/process.cpp
@@ -1111,7 +1111,7 @@ HRESULT ShimProcess::CreateProcess(
Cordb * pCordb,
ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR szProgramName,
- __in_z LPWSTR szProgramArgs,
+ _In_z_ LPWSTR szProgramArgs,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL fInheritHandles,
@@ -8624,7 +8624,7 @@ HRESULT CordbProcess::EnableLogMessages(BOOL fOnOff)
/*
* ModifyLogSwitch modifies the specified switch's severity level.
*/
-COM_METHOD CordbProcess::ModifyLogSwitch(__in_z WCHAR *pLogSwitchName, LONG lLevel)
+COM_METHOD CordbProcess::ModifyLogSwitch(_In_z_ WCHAR *pLogSwitchName, LONG lLevel)
{
PUBLIC_API_ENTRY(this);
FAIL_IF_NEUTERED(this);
@@ -13674,7 +13674,7 @@ void CordbWin32EventThread::ForceDbgContinue(CordbProcess *pProcess, CordbUnmana
HRESULT CordbWin32EventThread::SendCreateProcessEvent(
MachineInfo machineInfo,
LPCWSTR programName,
- __in_z LPWSTR programArgs,
+ _In_z_ LPWSTR programArgs,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
diff --git a/src/coreclr/debug/di/publish.cpp b/src/coreclr/debug/di/publish.cpp
index 23003b980ad9f1..1d7741fb9ea75b 100644
--- a/src/coreclr/debug/di/publish.cpp
+++ b/src/coreclr/debug/di/publish.cpp
@@ -658,7 +658,7 @@ HRESULT AllocateAndReadRemoteString(
HANDLE hProcess,
void * pRemotePtr,
SIZE_T cbSize, // size of buffer to allocate + copy.
- __deref_out_bcount(cbSize) WCHAR * * ppNewLocalBuffer
+ _Outptr_result_bytebuffer_(cbSize) WCHAR * * ppNewLocalBuffer
)
{
// Make sure buffer has right geometry.
@@ -902,7 +902,7 @@ HRESULT CorpubProcess::GetProcessID(unsigned *pid)
*/
HRESULT CorpubProcess::GetDisplayName(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
VALIDATE_POINTER_TO_OBJECT_ARRAY_OR_NULL(szName, WCHAR, cchName, true, true);
VALIDATE_POINTER_TO_OBJECT_OR_NULL(pcchName, ULONG32 *);
@@ -928,7 +928,7 @@ HRESULT CorpubProcess::GetDisplayName(ULONG32 cchName,
// CorpubAppDomain
// ******************************************
-CorpubAppDomain::CorpubAppDomain (__in LPWSTR szAppDomainName, ULONG Id)
+CorpubAppDomain::CorpubAppDomain (_In_ LPWSTR szAppDomainName, ULONG Id)
: CordbCommonBase (0, enumCorpubAppDomain),
m_pNext (NULL),
m_szAppDomainName (szAppDomainName),
@@ -976,7 +976,7 @@ HRESULT CorpubAppDomain::GetID (ULONG32 *pId)
*/
HRESULT CorpubAppDomain::GetName(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
VALIDATE_POINTER_TO_OBJECT_ARRAY_OR_NULL(szName, WCHAR, cchName, true, true);
VALIDATE_POINTER_TO_OBJECT_OR_NULL(pcchName, ULONG32 *);
diff --git a/src/coreclr/debug/di/rsappdomain.cpp b/src/coreclr/debug/di/rsappdomain.cpp
index 6b4da4ee206027..081baa95216d5b 100644
--- a/src/coreclr/debug/di/rsappdomain.cpp
+++ b/src/coreclr/debug/di/rsappdomain.cpp
@@ -700,7 +700,7 @@ HRESULT CordbAppDomain::Attach()
*/
HRESULT CordbAppDomain::GetName(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
HRESULT hr = S_OK;
PUBLIC_API_BEGIN(this)
diff --git a/src/coreclr/debug/di/rsassembly.cpp b/src/coreclr/debug/di/rsassembly.cpp
index b7b7d6756391d7..73c864f6e2159a 100644
--- a/src/coreclr/debug/di/rsassembly.cpp
+++ b/src/coreclr/debug/di/rsassembly.cpp
@@ -202,7 +202,7 @@ HRESULT CordbAssembly::EnumerateModules(ICorDebugModuleEnum **ppModules)
*/
HRESULT CordbAssembly::GetCodeBase(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
PUBLIC_API_ENTRY(this);
FAIL_IF_NEUTERED(this);
@@ -232,7 +232,7 @@ HRESULT CordbAssembly::GetCodeBase(ULONG32 cchName,
//
HRESULT CordbAssembly::GetName(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
PUBLIC_API_ENTRY(this);
FAIL_IF_NEUTERED(this);
diff --git a/src/coreclr/debug/di/rsmain.cpp b/src/coreclr/debug/di/rsmain.cpp
index ff49f2186a40ca..5594b299e2d125 100644
--- a/src/coreclr/debug/di/rsmain.cpp
+++ b/src/coreclr/debug/di/rsmain.cpp
@@ -595,7 +595,7 @@ namespace
COM_METHOD CreateConnection(ICorDebugProcess *pProcess,
CONNID dwConnectionId,
- __in_z WCHAR* pConnectionName);
+ _In_z_ WCHAR* pConnectionName);
COM_METHOD ChangeConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId);
COM_METHOD DestroyConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId);
@@ -725,7 +725,7 @@ namespace
HRESULT
DefaultManagedCallback2::CreateConnection(ICorDebugProcess *pProcess,
CONNID dwConnectionId,
- __in_z WCHAR* pConnectionName)
+ _In_z_ WCHAR* pConnectionName)
{
_ASSERTE(!"DefaultManagedCallback2::CreateConnection not implemented");
return E_NOTIMPL;
@@ -1572,7 +1572,7 @@ bool Cordb::IsInteropDebuggingSupported()
//
//---------------------------------------------------------------------------------------
HRESULT Cordb::CreateProcess(LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -1601,7 +1601,7 @@ HRESULT Cordb::CreateProcess(LPCWSTR lpApplicationName,
HRESULT Cordb::CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -1735,7 +1735,7 @@ HRESULT Cordb::CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget,
HRESULT Cordb::CreateProcessEx(ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
diff --git a/src/coreclr/debug/di/rsmda.cpp b/src/coreclr/debug/di/rsmda.cpp
index 517e6dcfdeb015..822e9824a1d417 100644
--- a/src/coreclr/debug/di/rsmda.cpp
+++ b/src/coreclr/debug/di/rsmda.cpp
@@ -102,7 +102,7 @@ HRESULT CordbMDA::QueryInterface(REFIID riid, void **ppInterface)
//
// Returns: S_OK on success.
//-----------------------------------------------------------------------------
-HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
_ASSERTE(pInputString != NULL);
ULONG32 len = (ULONG32) wcslen(pInputString) + 1;
@@ -144,7 +144,7 @@ HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName,
// the type from that based off the schema.
// See CopyOutString for parameter details.
//-----------------------------------------------------------------------------
-HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
HRESULT hr = S_OK;
PUBLIC_API_BEGIN(this)
@@ -159,7 +159,7 @@ HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part
// Get a string description of the MDA. This may be empty (0-length).
// See CopyOutString for parameter details.
//-----------------------------------------------------------------------------
-HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
HRESULT hr = S_OK;
PUBLIC_API_BEGIN(this)
@@ -176,7 +176,7 @@ HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecou
// See the MDA documentation for the schema for this XML stream.
// See CopyOutString for parameter details.
//-----------------------------------------------------------------------------
-HRESULT CordbMDA::GetXML(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CordbMDA::GetXML(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
HRESULT hr = S_OK;
PUBLIC_API_BEGIN(this)
diff --git a/src/coreclr/debug/di/rspriv.h b/src/coreclr/debug/di/rspriv.h
index a34dd0e6a07288..690917c2795a91 100644
--- a/src/coreclr/debug/di/rspriv.h
+++ b/src/coreclr/debug/di/rspriv.h
@@ -2211,7 +2211,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote
COM_METHOD SetManagedHandler(ICorDebugManagedCallback *pCallback);
COM_METHOD SetUnmanagedHandler(ICorDebugUnmanagedCallback *pCallback);
COM_METHOD CreateProcess(LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -2243,7 +2243,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote
COM_METHOD CreateProcessEx(ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -2267,7 +2267,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote
HRESULT CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -2463,7 +2463,7 @@ class CordbAppDomain : public CordbBase,
// Returns the friendly name of the AppDomain
COM_METHOD GetName(ULONG32 cchName,
ULONG32 * pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
/*
* GetObject returns the runtime app domain object.
@@ -2646,12 +2646,12 @@ class CordbAssembly : public CordbBase, public ICorDebugAssembly, ICorDebugAssem
*/
COM_METHOD GetCodeBase(ULONG32 cchName,
ULONG32 * pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
// returns the filename of the assembly, or "" for in-memory assemblies
COM_METHOD GetName(ULONG32 cchName,
ULONG32 * pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
//-----------------------------------------------------------
@@ -3079,7 +3079,7 @@ class CordbProcess :
/*
* ModifyLogSwitch modifies the specified switch's severity level.
*/
- COM_METHOD ModifyLogSwitch(__in_z WCHAR *pLogSwitchName, LONG lLevel);
+ COM_METHOD ModifyLogSwitch(_In_z_ WCHAR *pLogSwitchName, LONG lLevel);
COM_METHOD EnumerateAppDomains(ICorDebugAppDomainEnum **ppAppDomains);
COM_METHOD GetObject(ICorDebugValue **ppObject);
@@ -4180,7 +4180,7 @@ class CordbModule : public CordbBase,
COM_METHOD GetProcess(ICorDebugProcess **ppProcess);
COM_METHOD GetBaseAddress(CORDB_ADDRESS *pAddress);
COM_METHOD GetAssembly(ICorDebugAssembly **ppAssembly);
- COM_METHOD GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ COM_METHOD GetName(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
COM_METHOD EnableJITDebugging(BOOL bTrackJITInfo, BOOL bAllowJitOpts);
COM_METHOD EnableClassLoadCallbacks(BOOL bClassLoadCallbacks);
@@ -4252,7 +4252,7 @@ class CordbModule : public CordbBase,
#endif // _DEBUG
// Internal help to get the "name" (filename or pretty name) of the module.
- HRESULT GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ HRESULT GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
// Marks that the module's metadata has become invalid and needs to be refetched.
void RefreshMetaData();
@@ -4484,15 +4484,15 @@ class CordbMDA : public CordbBase, public ICorDebugMDA
// Get the string for the type of the MDA. Never empty.
// This is a convenient performant alternative to getting the XML stream and extracting
// the type from that based off the schema.
- COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
// Get a string description of the MDA. This may be empty (0-length).
- COM_METHOD GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ COM_METHOD GetDescription(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
// Get the full associated XML for the MDA. This may be empty.
// This could be a potentially expensive operation if the xml stream is large.
// See the MDA documentation for the schema for this XML stream.
- COM_METHOD GetXML(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ COM_METHOD GetXML(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
COM_METHOD GetFlags(CorDebugMDAFlags * pFlags);
@@ -9292,7 +9292,7 @@ class CordbObjectValue : public CordbValue,
COM_METHOD GetLength(ULONG32 * pcchString);
COM_METHOD GetString(ULONG32 cchString,
ULONG32 * ppcchStrin,
- __out_ecount_opt(cchString) WCHAR szString[]);
+ _Out_writes_bytes_opt_(cchString) WCHAR szString[]);
//-----------------------------------------------------------
// ICorDebugExceptionObjectValue
@@ -10120,7 +10120,7 @@ class CordbWin32EventThread
HRESULT SendCreateProcessEvent(MachineInfo machineInfo,
LPCWSTR programName,
- __in_z LPWSTR programArgs,
+ _In_z_ LPWSTR programArgs,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -10811,7 +10811,7 @@ class CorpubProcess : public CordbCommonBase, public ICorPublishProcess
*/
COM_METHOD GetDisplayName(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
CorpubProcess *GetNextProcess () { return m_pNext;}
void SetNext (CorpubProcess *pNext) { m_pNext = pNext;}
@@ -10838,7 +10838,7 @@ class CorpubProcess : public CordbCommonBase, public ICorPublishProcess
class CorpubAppDomain : public CordbCommonBase, public ICorPublishAppDomain
{
public:
- CorpubAppDomain (__in LPWSTR szAppDomainName, ULONG Id);
+ CorpubAppDomain (_In_ LPWSTR szAppDomainName, ULONG Id);
virtual ~CorpubAppDomain();
#ifdef _DEBUG
@@ -10873,7 +10873,7 @@ class CorpubAppDomain : public CordbCommonBase, public ICorPublishAppDomain
*/
COM_METHOD GetName (ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
CorpubAppDomain *GetNextAppDomain () { return m_pNext;}
void SetNext (CorpubAppDomain *pNext) { m_pNext = pNext;}
@@ -11142,7 +11142,7 @@ class CordbEnumFilter : public CordbBase,
void CheckAgainstDAC(CordbFunction * pFunc, void * pIP, mdMethodDef mdExpected);
#endif
-HRESULT CopyOutString(const WCHAR * pInputString, ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+HRESULT CopyOutString(const WCHAR * pInputString, ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
diff --git a/src/coreclr/debug/di/shimcallback.cpp b/src/coreclr/debug/di/shimcallback.cpp
index ba5f0771fca49a..4e8f029209def7 100644
--- a/src/coreclr/debug/di/shimcallback.cpp
+++ b/src/coreclr/debug/di/shimcallback.cpp
@@ -659,7 +659,7 @@ HRESULT ShimProxyCallback::DebuggerError(ICorDebugProcess * pProcess, HRESULT er
// Implementation of ICorDebugManagedCallback::LogMessage
-HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, __in LPWSTR pLogSwitchName, __in LPWSTR pMessage)
+HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, _In_ LPWSTR pLogSwitchName, _In_ LPWSTR pMessage)
{
m_pShim->PreDispatchEvent();
class LogMessageEvent : public ManagedEvent
@@ -695,7 +695,7 @@ HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebug
// Implementation of ICorDebugManagedCallback::LogSwitch
-HRESULT ShimProxyCallback::LogSwitch(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, ULONG ulReason, __in LPWSTR pLogSwitchName, __in LPWSTR pParentName)
+HRESULT ShimProxyCallback::LogSwitch(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, ULONG ulReason, _In_ LPWSTR pLogSwitchName, _In_ LPWSTR pParentName)
{
m_pShim->PreDispatchEvent();
class LogSwitchEvent : public ManagedEvent
@@ -1060,7 +1060,7 @@ HRESULT ShimProxyCallback::FunctionRemapOpportunity(ICorDebugAppDomain * pAppDom
// Implementation of ICorDebugManagedCallback2::CreateConnection
-HRESULT ShimProxyCallback::CreateConnection(ICorDebugProcess * pProcess, CONNID dwConnectionId, __in LPWSTR pConnectionName)
+HRESULT ShimProxyCallback::CreateConnection(ICorDebugProcess * pProcess, CONNID dwConnectionId, _In_ LPWSTR pConnectionName)
{
m_pShim->PreDispatchEvent();
class CreateConnectionEvent : public ManagedEvent
diff --git a/src/coreclr/debug/di/shimpriv.h b/src/coreclr/debug/di/shimpriv.h
index 89a0c0d0c79374..26a939ee8a3a8e 100644
--- a/src/coreclr/debug/di/shimpriv.h
+++ b/src/coreclr/debug/di/shimpriv.h
@@ -128,15 +128,15 @@ class ShimProxyCallback :
COM_METHOD LogMessage( ICorDebugAppDomain *pAppDomain,
ICorDebugThread *pThread,
LONG lLevel,
- __in LPWSTR pLogSwitchName,
- __in LPWSTR pMessage);
+ _In_ LPWSTR pLogSwitchName,
+ _In_ LPWSTR pMessage);
COM_METHOD LogSwitch( ICorDebugAppDomain *pAppDomain,
ICorDebugThread *pThread,
LONG lLevel,
ULONG ulReason,
- __in LPWSTR pLogSwitchName,
- __in LPWSTR pParentName);
+ _In_ LPWSTR pLogSwitchName,
+ _In_ LPWSTR pParentName);
COM_METHOD CreateAppDomain(ICorDebugProcess *pProcess,
ICorDebugAppDomain *pAppDomain);
@@ -178,7 +178,7 @@ class ShimProxyCallback :
ICorDebugFunction *pNewFunction,
ULONG32 oldILOffset);
- COM_METHOD CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, __in LPWSTR pConnName);
+ COM_METHOD CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, _In_ LPWSTR pConnName);
COM_METHOD ChangeConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId );
@@ -368,7 +368,7 @@ class ShimProcess
Cordb * pCordb,
ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR programName,
- __in_z LPWSTR programArgs,
+ _In_z_ LPWSTR programArgs,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
diff --git a/src/coreclr/debug/di/symbolinfo.cpp b/src/coreclr/debug/di/symbolinfo.cpp
index 452adbe71f3a7e..37cff967d02fea 100644
--- a/src/coreclr/debug/di/symbolinfo.cpp
+++ b/src/coreclr/debug/di/symbolinfo.cpp
@@ -231,7 +231,7 @@ STDMETHODIMP_(ULONG) SymbolInfo::Release ()
STDMETHODIMP SymbolInfo::GetTypeDefProps ( // S_OK or error.
mdTypeDef td, // [IN] TypeDef token for inquiry.
- __out_ecount_part_opt(cchTypeDef, pchTypeDef)
+ _Out_writes_to_opt_(cchTypeDef, pchTypeDef)
LPWSTR szTypeDef, // [OUT] Put name here.
ULONG cchTypeDef, // [IN] size of name buffer in wide chars.
ULONG *pchTypeDef, // [OUT] put size of name (wide chars) here.
@@ -278,7 +278,7 @@ STDMETHODIMP SymbolInfo::GetTypeDefProps ( // S_OK or error.
STDMETHODIMP SymbolInfo::GetMethodProps (
mdMethodDef mb, // The method for which to get props.
mdTypeDef *pClass, // Put method's class here.
- __out_ecount_part_opt(cchMethod, *pchMethod)
+ _Out_writes_to_opt_(cchMethod, *pchMethod)
LPWSTR szMethod, // Put method's name here.
ULONG cchMethod, // Size of szMethod buffer in wide chars.
ULONG *pchMethod, // Put actual size here
@@ -419,7 +419,7 @@ STDMETHODIMP SymbolInfo::FindTypeDefByName ( // S_OK or error.
}
STDMETHODIMP SymbolInfo::GetScopeProps ( // S_OK or error.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Put the name here.
ULONG cchName, // [IN] Size of name buffer in wide chars.
ULONG *pchName, // [OUT] Put size of name (wide chars) here.
@@ -449,7 +449,7 @@ STDMETHODIMP SymbolInfo::GetInterfaceImplProps ( // S_OK or error.
STDMETHODIMP SymbolInfo::GetTypeRefProps ( // S_OK or error.
mdTypeRef tr, // [IN] TypeRef token.
mdToken *ptkResolutionScope, // [OUT] Resolution scope, ModuleRef or AssemblyRef.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Name of the TypeRef.
ULONG cchName, // [IN] Size of buffer.
ULONG *pchName) // [OUT] Size of Name.
@@ -629,7 +629,7 @@ STDMETHODIMP SymbolInfo::FindMemberRef (
STDMETHODIMP SymbolInfo::GetMemberRefProps ( // S_OK or error.
mdMemberRef mr, // [IN] given memberref
mdToken *ptk, // [OUT] Put classref or classdef here.
- __out_ecount_part_opt(cchMember, *pchMember)
+ _Out_writes_to_opt_(cchMember, *pchMember)
LPWSTR szMember, // [OUT] buffer to fill for member's name
ULONG cchMember, // [IN] the count of char of szMember
ULONG *pchMember, // [OUT] actual count of char in member name
@@ -752,7 +752,7 @@ STDMETHODIMP SymbolInfo::GetSigFromToken ( // S_OK or error.
STDMETHODIMP SymbolInfo::GetModuleRefProps ( // S_OK or error.
mdModuleRef mur, // [IN] moduleref token.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] buffer to fill with the moduleref name.
ULONG cchName, // [IN] size of szName in wide characters.
ULONG *pchName) // [OUT] actual count of characters in the name.
@@ -800,7 +800,7 @@ STDMETHODIMP SymbolInfo::EnumUnresolvedMethods ( // S_OK, S_FALSE, or erro
STDMETHODIMP SymbolInfo::GetUserString ( // S_OK or error.
mdString stk, // [IN] String token.
- __out_ecount_part_opt(cchString, *pchString)
+ _Out_writes_to_opt_(cchString, *pchString)
LPWSTR szString, // [OUT] Copy of string.
ULONG cchString, // [IN] Max chars of room in szString.
ULONG *pchString) // [OUT] How many chars in actual string.
@@ -812,7 +812,7 @@ STDMETHODIMP SymbolInfo::GetUserString ( // S_OK or error.
STDMETHODIMP SymbolInfo::GetPinvokeMap ( // S_OK or error.
mdToken tk, // [IN] FieldDef or MethodDef.
DWORD *pdwMappingFlags, // [OUT] Flags used for mapping.
- __out_ecount_part_opt(cchImportName, *pchImportName)
+ _Out_writes_to_opt_(cchImportName, *pchImportName)
LPWSTR szImportName, // [OUT] Import name.
ULONG cchImportName, // [IN] Size of the name buffer.
ULONG *pchImportName, // [OUT] Actual number of characters stored.
@@ -896,7 +896,7 @@ STDMETHODIMP SymbolInfo::FindTypeRef (
STDMETHODIMP SymbolInfo::GetMemberProps (
mdToken mb, // The member for which to get props.
mdTypeDef *pClass, // Put member's class here.
- __out_ecount_part_opt(cchMember, *pchMember)
+ _Out_writes_to_opt_(cchMember, *pchMember)
LPWSTR szMember, // Put member's name here.
ULONG cchMember, // Size of szMember buffer in wide chars.
ULONG *pchMember, // Put actual size here
@@ -916,7 +916,7 @@ STDMETHODIMP SymbolInfo::GetMemberProps (
STDMETHODIMP SymbolInfo::GetFieldProps (
mdFieldDef mb, // The field for which to get props.
mdTypeDef *pClass, // Put field's class here.
- __out_ecount_part_opt(cchField, *pchField)
+ _Out_writes_to_opt_(cchField, *pchField)
LPWSTR szField, // Put field's name here.
ULONG cchField, // Size of szField buffer in wide chars.
ULONG *pchField, // Put actual size here
@@ -957,7 +957,7 @@ STDMETHODIMP SymbolInfo::GetParamProps ( // S_OK or error.
mdParamDef tk, // [IN]The Parameter.
mdMethodDef *pmd, // [OUT] Parent Method token.
ULONG *pulSequence, // [OUT] Parameter sequence.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Put name here.
ULONG cchName, // [OUT] Size of name buffer.
ULONG *pchName, // [OUT] Put actual size of name here.
diff --git a/src/coreclr/debug/di/symbolinfo.h b/src/coreclr/debug/di/symbolinfo.h
index 22deafaaf5d516..5b1291f4cfe598 100644
--- a/src/coreclr/debug/di/symbolinfo.h
+++ b/src/coreclr/debug/di/symbolinfo.h
@@ -104,7 +104,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
mdTypeDef *ptd); // [OUT] Put the TypeDef token here.
STDMETHOD(GetScopeProps)( // S_OK or error.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Put the name here.
ULONG cchName, // [IN] Size of name buffer in wide chars.
ULONG *pchName, // [OUT] Put size of name (wide chars) here.
@@ -115,7 +115,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetTypeDefProps)( // S_OK or error.
mdTypeDef td, // [IN] TypeDef token for inquiry.
- __out_ecount_part_opt(cchTypeDef, *pchTypeDef)
+ _Out_writes_to_opt_(cchTypeDef, *pchTypeDef)
LPWSTR szTypeDef, // [OUT] Put name here.
ULONG cchTypeDef, // [IN] size of name buffer in wide chars.
ULONG *pchTypeDef, // [OUT] put size of name (wide chars) here.
@@ -130,7 +130,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetTypeRefProps)( // S_OK or error.
mdTypeRef tr, // [IN] TypeRef token.
mdToken *ptkResolutionScope, // [OUT] Resolution scope, ModuleRef or AssemblyRef.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Name of the TypeRef.
ULONG cchName, // [IN] Size of buffer.
ULONG *pchName); // [OUT] Size of Name.
@@ -244,7 +244,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD (GetMethodProps)(
mdMethodDef mb, // The method for which to get props.
mdTypeDef *pClass, // Put method's class here.
- __out_ecount_part_opt(cchMethod, *pchMethod)
+ _Out_writes_to_opt_(cchMethod, *pchMethod)
LPWSTR szMethod, // Put method's name here.
ULONG cchMethod, // Size of szMethod buffer in wide chars.
ULONG *pchMethod, // Put actual size here
@@ -257,7 +257,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetMemberRefProps)( // S_OK or error.
mdMemberRef mr, // [IN] given memberref
mdToken *ptk, // [OUT] Put classref or classdef here.
- __out_ecount_part_opt(cchMember, *pchMember)
+ _Out_writes_to_opt_(cchMember, *pchMember)
LPWSTR szMember, // [OUT] buffer to fill for member's name
ULONG cchMember, // [IN] the count of char of szMember
ULONG *pchMember, // [OUT] actual count of char in member name
@@ -336,7 +336,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetModuleRefProps)( // S_OK or error.
mdModuleRef mur, // [IN] moduleref token.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] buffer to fill with the moduleref name.
ULONG cchName, // [IN] size of szName in wide characters.
ULONG *pchName); // [OUT] actual count of characters in the name.
@@ -364,7 +364,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetUserString)( // S_OK or error.
mdString stk, // [IN] String token.
- __out_ecount_part_opt(cchString, *pchString)
+ _Out_writes_to_opt_(cchString, *pchString)
LPWSTR szString, // [OUT] Copy of string.
ULONG cchString, // [IN] Max chars of room in szString.
ULONG *pchString); // [OUT] How many chars in actual string.
@@ -372,7 +372,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetPinvokeMap)( // S_OK or error.
mdToken tk, // [IN] FieldDef or MethodDef.
DWORD *pdwMappingFlags, // [OUT] Flags used for mapping.
- __out_ecount_part_opt(cchImportName, *pchImportName)
+ _Out_writes_to_opt_(cchImportName, *pchImportName)
LPWSTR szImportName, // [OUT] Import name.
ULONG cchImportName, // [IN] Size of the name buffer.
ULONG *pchImportName, // [OUT] Actual number of characters stored.
@@ -424,7 +424,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetMemberProps)(
mdToken mb, // The member for which to get props.
mdTypeDef *pClass, // Put member's class here.
- __out_ecount_part_opt(cchMember, *pchMember)
+ _Out_writes_to_opt_(cchMember, *pchMember)
LPWSTR szMember, // Put member's name here.
ULONG cchMember, // Size of szMember buffer in wide chars.
ULONG *pchMember, // Put actual size here
@@ -440,7 +440,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetFieldProps)(
mdFieldDef mb, // The field for which to get props.
mdTypeDef *pClass, // Put field's class here.
- __out_ecount_part_opt(cchField, *pchField)
+ _Out_writes_to_opt_(cchField, *pchField)
LPWSTR szField, // Put field's name here.
ULONG cchField, // Size of szField buffer in wide chars.
ULONG *pchField, // Put actual size here
@@ -473,7 +473,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
mdParamDef tk, // [IN]The Parameter.
mdMethodDef *pmd, // [OUT] Parent Method token.
ULONG *pulSequence, // [OUT] Parameter sequence.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Put name here.
ULONG cchName, // [OUT] Size of name buffer.
ULONG *pchName, // [OUT] Put actual size of name here.
diff --git a/src/coreclr/debug/ee/debugger.cpp b/src/coreclr/debug/ee/debugger.cpp
index 8e5200d37d5097..1e326e724250b6 100644
--- a/src/coreclr/debug/ee/debugger.cpp
+++ b/src/coreclr/debug/ee/debugger.cpp
@@ -14341,8 +14341,8 @@ void Debugger::SendRawLogMessage(
// the creation/modification of a LogSwitch
void Debugger::SendLogSwitchSetting(int iLevel,
int iReason,
- __in_z LPCWSTR pLogSwitchName,
- __in_z LPCWSTR pParentSwitchName)
+ _In_z_ LPCWSTR pLogSwitchName,
+ _In_z_ LPCWSTR pParentSwitchName)
{
CONTRACTL
{
@@ -15854,7 +15854,7 @@ BOOL Debugger::IsThreadContextInvalid(Thread *pThread, CONTEXT *pCtx)
// notification when a SQL connection begins
-void Debugger::CreateConnection(CONNID dwConnectionId, __in_z WCHAR *wzName)
+void Debugger::CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName)
{
CONTRACTL
{
diff --git a/src/coreclr/debug/ee/debugger.h b/src/coreclr/debug/ee/debugger.h
index 3fd9edf68f5d86..084f1da6a5c93f 100644
--- a/src/coreclr/debug/ee/debugger.h
+++ b/src/coreclr/debug/ee/debugger.h
@@ -2201,7 +2201,7 @@ class Debugger : public DebugInterface
void SendInterceptExceptionComplete(Thread *thread);
HRESULT AttachDebuggerForBreakpoint(Thread *thread,
- __in_opt WCHAR *wszLaunchReason);
+ _In_opt_ WCHAR *wszLaunchReason);
void ThreadIsSafe(Thread *thread);
@@ -2424,8 +2424,8 @@ class Debugger : public DebugInterface
void SendLogSwitchSetting (int iLevel,
int iReason,
- __in_z LPCWSTR pLogSwitchName,
- __in_z LPCWSTR pParentSwitchName);
+ _In_z_ LPCWSTR pLogSwitchName,
+ _In_z_ LPCWSTR pParentSwitchName);
bool IsLoggingEnabled (void)
{
@@ -2507,7 +2507,7 @@ class Debugger : public DebugInterface
BOOL IsThreadContextInvalid(Thread *pThread, T_CONTEXT *pCtx);
// notification for SQL fiber debugging support
- void CreateConnection(CONNID dwConnectionId, __in_z WCHAR *wzName);
+ void CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName);
void DestroyConnection(CONNID dwConnectionId);
void ChangeConnection(CONNID dwConnectionId);
@@ -3704,7 +3704,7 @@ void DbgLogHelper(DebuggerIPCEventType event);
// Helpers for cleanup
// These are various utility functions, mainly where we factor out code.
//-----------------------------------------------------------------------------
-void GetPidDecoratedName(__out_ecount(cBufSizeInChars) WCHAR * pBuf,
+void GetPidDecoratedName(_Out_writes_(cBufSizeInChars) WCHAR * pBuf,
int cBufSizeInChars,
const WCHAR * pPrefix);
diff --git a/src/coreclr/debug/ee/rcthread.cpp b/src/coreclr/debug/ee/rcthread.cpp
index 18c840edbb6984..0f48eb2c95e188 100644
--- a/src/coreclr/debug/ee/rcthread.cpp
+++ b/src/coreclr/debug/ee/rcthread.cpp
@@ -116,7 +116,7 @@ void DebuggerRCThread::CloseIPCHandles()
// cBufSizeInChars - the size of the buffer in characters, including the null.
// pPrefx - The undecorated name of the event.
//-----------------------------------------------------------------------------
-void GetPidDecoratedName(__out_ecount(cBufSizeInChars) WCHAR * pBuf,
+void GetPidDecoratedName(_Out_writes_(cBufSizeInChars) WCHAR * pBuf,
int cBufSizeInChars,
const WCHAR * pPrefix)
{
diff --git a/src/coreclr/debug/inc/common.h b/src/coreclr/debug/inc/common.h
index 2baec963e14f2f..cb8474c7373856 100644
--- a/src/coreclr/debug/inc/common.h
+++ b/src/coreclr/debug/inc/common.h
@@ -45,7 +45,7 @@ void InitEventForDebuggerNotification(DEBUG_EVENT * pDebugEvent,
#endif // (FEATURE_DBGIPC_TRANSPORT_DI || FEATURE_DBGIPC_TRANSPORT_VM)
-void GetPidDecoratedName(__out_z __out_ecount(cBufSizeInChars) WCHAR * pBuf,
+void GetPidDecoratedName(_Out_writes_z_(cBufSizeInChars) WCHAR * pBuf,
int cBufSizeInChars,
const WCHAR * pPrefix,
DWORD pid);
diff --git a/src/coreclr/debug/inc/dbgipcevents.h b/src/coreclr/debug/inc/dbgipcevents.h
index db4a00fca1c865..ddef09554cf80d 100644
--- a/src/coreclr/debug/inc/dbgipcevents.h
+++ b/src/coreclr/debug/inc/dbgipcevents.h
@@ -990,7 +990,7 @@ extern const size_t nameCount;
struct MSLAYOUT IPCENames // We use a class/struct so that the function can remain in a shared header file
{
- static DebuggerIPCEventType GetEventType(__in_z char * strEventType)
+ static DebuggerIPCEventType GetEventType(_In_z_ char * strEventType)
{
// pass in the string of event name and find the matching enum value
// This is a linear search which is pretty slow. However, this is only used
diff --git a/src/coreclr/debug/shared/dbgtransportsession.cpp b/src/coreclr/debug/shared/dbgtransportsession.cpp
index 85fb7901b01c1a..6d3ed5b345cf7c 100644
--- a/src/coreclr/debug/shared/dbgtransportsession.cpp
+++ b/src/coreclr/debug/shared/dbgtransportsession.cpp
@@ -1143,7 +1143,7 @@ DbgTransportSession::Message * DbgTransportSession::RemoveMessageFromSendQueue(D
// Check read and optionally write memory access to the specified range of bytes. Used to check
// ReadProcessMemory and WriteProcessMemory requests.
-HRESULT DbgTransportSession::CheckBufferAccess(__in_ecount(cbBuffer) PBYTE pbBuffer, DWORD cbBuffer, bool fWriteAccess)
+HRESULT DbgTransportSession::CheckBufferAccess(_In_reads_(cbBuffer) PBYTE pbBuffer, DWORD cbBuffer, bool fWriteAccess)
{
// check for integer overflow
if ((pbBuffer + cbBuffer) < pbBuffer)
diff --git a/src/coreclr/debug/shared/utils.cpp b/src/coreclr/debug/shared/utils.cpp
index 85f17b50c44e78..be967b1d1b7fa2 100644
--- a/src/coreclr/debug/shared/utils.cpp
+++ b/src/coreclr/debug/shared/utils.cpp
@@ -126,7 +126,7 @@ void InitEventForDebuggerNotification(DEBUG_EVENT * pDebugEvent,
// cBufSizeInChars - the size of the buffer in characters, including the null.
// pPrefx - The undecorated name of the event.
//-----------------------------------------------------------------------------
-void GetPidDecoratedName(__out_z __out_ecount(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix, DWORD pid)
+void GetPidDecoratedName(_Out_writes_z_(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix, DWORD pid)
{
const WCHAR szGlobal[] = W("Global\\");
int szGlobalLen;
diff --git a/src/coreclr/debug/shim/debugshim.cpp b/src/coreclr/debug/shim/debugshim.cpp
index b86c8eb0cfcc3a..3dcfbcc2510785 100644
--- a/src/coreclr/debug/shim/debugshim.cpp
+++ b/src/coreclr/debug/shim/debugshim.cpp
@@ -427,11 +427,11 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget* pDataTarget,
CLR_DEBUGGING_VERSION* pVersion,
DWORD* pdwDbiTimeStamp,
DWORD* pdwDbiSizeOfImage,
- __out_z __inout_ecount(dwDbiNameCharCount) WCHAR* pDbiName,
+ _Inout_updates_z_(dwDbiNameCharCount) WCHAR* pDbiName,
DWORD dwDbiNameCharCount,
DWORD* pdwDacTimeStamp,
DWORD* pdwDacSizeOfImage,
- __out_z __inout_ecount(dwDacNameCharCount) WCHAR* pDacName,
+ _Inout_updates_z_(dwDacNameCharCount) WCHAR* pDacName,
DWORD dwDacNameCharCount)
{
#ifdef HOST_WINDOWS
@@ -629,7 +629,7 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget* pDataTarget,
}
// Formats the long name for DAC
-HRESULT CLRDebuggingImpl::FormatLongDacModuleName(__out_z __inout_ecount(cchBuffer) WCHAR * pBuffer,
+HRESULT CLRDebuggingImpl::FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) WCHAR * pBuffer,
DWORD cchBuffer,
DWORD targetImageFileMachine,
VS_FIXEDFILEINFO * pVersion)
diff --git a/src/coreclr/debug/shim/debugshim.h b/src/coreclr/debug/shim/debugshim.h
index 5055d5a11b47d1..93df463867feb5 100644
--- a/src/coreclr/debug/shim/debugshim.h
+++ b/src/coreclr/debug/shim/debugshim.h
@@ -69,14 +69,14 @@ class CLRDebuggingImpl : public ICLRDebugging
CLR_DEBUGGING_VERSION * pVersion,
DWORD * pdwDbiTimeStamp,
DWORD * pdwDbiSizeOfImage,
- __out_z __inout_ecount(dwDbiNameCharCount) WCHAR * pDbiName,
+ _Inout_updates_z_(dwDbiNameCharCount) WCHAR * pDbiName,
DWORD dwDbiNameCharCount,
DWORD * pdwDacTimeStamp,
DWORD * pdwDacSizeOfImage,
- __out_z __inout_ecount(dwDacNameCharCount) WCHAR * pDacName,
+ _Inout_updates_z_(dwDacNameCharCount) WCHAR * pDacName,
DWORD dwDacNameCharCount);
- HRESULT FormatLongDacModuleName(__out_z __inout_ecount(cchBuffer) WCHAR * pBuffer,
+ HRESULT FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) WCHAR * pBuffer,
DWORD cchBuffer,
DWORD targetImageFileMachine,
VS_FIXEDFILEINFO * pVersion);
diff --git a/src/coreclr/dlls/dbgshim/dbgshim.cpp b/src/coreclr/dlls/dbgshim/dbgshim.cpp
index ac1e2d7fe189ac..40e4d7dea4bf26 100644
--- a/src/coreclr/dlls/dbgshim/dbgshim.cpp
+++ b/src/coreclr/dlls/dbgshim/dbgshim.cpp
@@ -79,12 +79,12 @@ if it exists, it will:
DLLEXPORT
HRESULT
CreateProcessForLaunch(
- __in LPWSTR lpCommandLine,
- __in BOOL bSuspendProcess,
- __in LPVOID lpEnvironment,
- __in LPCWSTR lpCurrentDirectory,
- __out PDWORD pProcessId,
- __out HANDLE *pResumeHandle)
+ _In_ LPWSTR lpCommandLine,
+ _In_ BOOL bSuspendProcess,
+ _In_ LPVOID lpEnvironment,
+ _In_ LPCWSTR lpCurrentDirectory,
+ _Out_ PDWORD pProcessId,
+ _Out_ HANDLE *pResumeHandle)
{
PUBLIC_CONTRACT;
@@ -140,7 +140,7 @@ CreateProcessForLaunch(
DLLEXPORT
HRESULT
ResumeProcess(
- __in HANDLE hResumeHandle)
+ _In_ HANDLE hResumeHandle)
{
PUBLIC_CONTRACT;
if (ResumeThread(hResumeHandle) == (DWORD)-1)
@@ -159,7 +159,7 @@ ResumeProcess(
DLLEXPORT
HRESULT
CloseResumeHandle(
- __in HANDLE hResumeHandle)
+ _In_ HANDLE hResumeHandle)
{
PUBLIC_CONTRACT;
if (!CloseHandle(hResumeHandle))
@@ -190,7 +190,7 @@ HRESULT
GetContinueStartupEvent(
DWORD debuggeePID,
LPCWSTR szTelestoFullPath,
- __out HANDLE *phContinueStartupEvent);
+ _Out_ HANDLE *phContinueStartupEvent);
#endif // TARGET_UNIX
@@ -697,10 +697,10 @@ StartupHelperThread(LPVOID p)
DLLEXPORT
HRESULT
RegisterForRuntimeStartup(
- __in DWORD dwProcessId,
- __in PSTARTUP_CALLBACK pfnCallback,
- __in PVOID parameter,
- __out PVOID *ppUnregisterToken)
+ _In_ DWORD dwProcessId,
+ _In_ PSTARTUP_CALLBACK pfnCallback,
+ _In_ PVOID parameter,
+ _Out_ PVOID *ppUnregisterToken)
{
return RegisterForRuntimeStartupEx(dwProcessId, NULL, pfnCallback, parameter, ppUnregisterToken);
}
@@ -738,11 +738,11 @@ RegisterForRuntimeStartup(
DLLEXPORT
HRESULT
RegisterForRuntimeStartupEx(
- __in DWORD dwProcessId,
- __in LPCWSTR lpApplicationGroupId,
- __in PSTARTUP_CALLBACK pfnCallback,
- __in PVOID parameter,
- __out PVOID *ppUnregisterToken)
+ _In_ DWORD dwProcessId,
+ _In_ LPCWSTR lpApplicationGroupId,
+ _In_ PSTARTUP_CALLBACK pfnCallback,
+ _In_ PVOID parameter,
+ _Out_ PVOID *ppUnregisterToken)
{
PUBLIC_CONTRACT;
@@ -787,7 +787,7 @@ RegisterForRuntimeStartupEx(
DLLEXPORT
HRESULT
UnregisterForRuntimeStartup(
- __in PVOID pUnregisterToken)
+ _In_ PVOID pUnregisterToken)
{
PUBLIC_CONTRACT;
@@ -824,8 +824,8 @@ const int cchEventNameBufferSize = (sizeof(StartupNotifyEventNamePrefix) + sizeo
DLLEXPORT
HRESULT
GetStartupNotificationEvent(
- __in DWORD debuggeePID,
- __out HANDLE* phStartupEvent)
+ _In_ DWORD debuggeePID,
+ _Out_ HANDLE* phStartupEvent)
{
PUBLIC_CONTRACT;
@@ -1220,9 +1220,9 @@ DLLEXPORT
HRESULT
EnumerateCLRs(
DWORD debuggeePID,
- __out HANDLE** ppHandleArrayOut,
- __out LPWSTR** ppStringArrayOut,
- __out DWORD* pdwArrayLengthOut)
+ _Out_ HANDLE** ppHandleArrayOut,
+ _Out_ LPWSTR** ppStringArrayOut,
+ _Out_ DWORD* pdwArrayLengthOut)
{
PUBLIC_CONTRACT;
@@ -1357,9 +1357,9 @@ EnumerateCLRs(
DLLEXPORT
HRESULT
CloseCLREnumeration(
- __in HANDLE* pHandleArray,
- __in LPWSTR* pStringArray,
- __in DWORD dwArrayLength)
+ _In_ HANDLE* pHandleArray,
+ _In_ LPWSTR* pStringArray,
+ _In_ DWORD dwArrayLength)
{
PUBLIC_CONTRACT;
@@ -1484,11 +1484,11 @@ const WCHAR *c_versionStrFormat = W("%08x;%08x;%p");
DLLEXPORT
HRESULT
CreateVersionStringFromModule(
- __in DWORD pidDebuggee,
- __in LPCWSTR szModuleName,
- __out_ecount_part(cchBuffer, *pdwLength) LPWSTR pBuffer,
- __in DWORD cchBuffer,
- __out DWORD* pdwLength)
+ _In_ DWORD pidDebuggee,
+ _In_ LPCWSTR szModuleName,
+ _Out_writes_to_opt_(cchBuffer, *pdwLength) LPWSTR pBuffer,
+ _In_ DWORD cchBuffer,
+ _Out_ DWORD* pdwLength)
{
PUBLIC_CONTRACT;
@@ -1719,9 +1719,9 @@ CheckDbiAndRuntimeVersion(
DLLEXPORT
HRESULT
CreateDebuggingInterfaceFromVersionEx(
- __in int iDebuggerVersion,
- __in LPCWSTR szDebuggeeVersion,
- __out IUnknown ** ppCordb)
+ _In_ int iDebuggerVersion,
+ _In_ LPCWSTR szDebuggeeVersion,
+ _Out_ IUnknown ** ppCordb)
{
return CreateDebuggingInterfaceFromVersion2(iDebuggerVersion, szDebuggeeVersion, NULL, ppCordb);
}
@@ -1748,10 +1748,10 @@ CreateDebuggingInterfaceFromVersionEx(
DLLEXPORT
HRESULT
CreateDebuggingInterfaceFromVersion2(
- __in int iDebuggerVersion,
- __in LPCWSTR szDebuggeeVersion,
- __in LPCWSTR szApplicationGroupId,
- __out IUnknown ** ppCordb)
+ _In_ int iDebuggerVersion,
+ _In_ LPCWSTR szDebuggeeVersion,
+ _In_ LPCWSTR szApplicationGroupId,
+ _Out_ IUnknown ** ppCordb)
{
PUBLIC_CONTRACT;
@@ -1880,8 +1880,8 @@ CreateDebuggingInterfaceFromVersion2(
DLLEXPORT
HRESULT
CreateDebuggingInterfaceFromVersion(
- __in LPCWSTR szDebuggeeVersion,
- __out IUnknown ** ppCordb
+ _In_ LPCWSTR szDebuggeeVersion,
+ _Out_ IUnknown ** ppCordb
)
{
PUBLIC_CONTRACT;
@@ -1907,7 +1907,7 @@ HRESULT
GetContinueStartupEvent(
DWORD debuggeePID,
LPCWSTR szTelestoFullPath,
- __out HANDLE* phContinueStartupEvent)
+ _Out_ HANDLE* phContinueStartupEvent)
{
if ((phContinueStartupEvent == NULL) || (szTelestoFullPath == NULL))
return E_INVALIDARG;
diff --git a/src/coreclr/dlls/dbgshim/dbgshim.h b/src/coreclr/dlls/dbgshim/dbgshim.h
index 392cd7b9286a85..004fd2a38128f2 100644
--- a/src/coreclr/dlls/dbgshim/dbgshim.h
+++ b/src/coreclr/dlls/dbgshim/dbgshim.h
@@ -11,81 +11,81 @@ typedef VOID (*PSTARTUP_CALLBACK)(IUnknown *pCordb, PVOID parameter, HRESULT hr)
EXTERN_C HRESULT
CreateProcessForLaunch(
- __in LPWSTR lpCommandLine,
- __in BOOL bSuspendProcess,
- __in LPVOID lpEnvironment,
- __in LPCWSTR lpCurrentDirectory,
- __out PDWORD pProcessId,
- __out HANDLE *pResumeHandle);
+ _In_ LPWSTR lpCommandLine,
+ _In_ BOOL bSuspendProcess,
+ _In_ LPVOID lpEnvironment,
+ _In_ LPCWSTR lpCurrentDirectory,
+ _Out_ PDWORD pProcessId,
+ _Out_ HANDLE *pResumeHandle);
EXTERN_C HRESULT
ResumeProcess(
- __in HANDLE hResumeHandle);
+ _In_ HANDLE hResumeHandle);
EXTERN_C HRESULT
CloseResumeHandle(
- __in HANDLE hResumeHandle);
+ _In_ HANDLE hResumeHandle);
EXTERN_C HRESULT
RegisterForRuntimeStartup(
- __in DWORD dwProcessId,
- __in PSTARTUP_CALLBACK pfnCallback,
- __in PVOID parameter,
- __out PVOID *ppUnregisterToken);
+ _In_ DWORD dwProcessId,
+ _In_ PSTARTUP_CALLBACK pfnCallback,
+ _In_ PVOID parameter,
+ _Out_ PVOID *ppUnregisterToken);
EXTERN_C HRESULT
RegisterForRuntimeStartupEx(
- __in DWORD dwProcessId,
- __in LPCWSTR szApplicationGroupId,
- __in PSTARTUP_CALLBACK pfnCallback,
- __in PVOID parameter,
- __out PVOID *ppUnregisterToken);
+ _In_ DWORD dwProcessId,
+ _In_ LPCWSTR szApplicationGroupId,
+ _In_ PSTARTUP_CALLBACK pfnCallback,
+ _In_ PVOID parameter,
+ _Out_ PVOID *ppUnregisterToken);
EXTERN_C HRESULT
UnregisterForRuntimeStartup(
- __in PVOID pUnregisterToken);
+ _In_ PVOID pUnregisterToken);
EXTERN_C HRESULT
GetStartupNotificationEvent(
- __in DWORD debuggeePID,
- __out HANDLE* phStartupEvent);
+ _In_ DWORD debuggeePID,
+ _Out_ HANDLE* phStartupEvent);
EXTERN_C HRESULT
EnumerateCLRs(DWORD debuggeePID,
- __out HANDLE** ppHandleArrayOut,
- __out LPWSTR** ppStringArrayOut,
- __out DWORD* pdwArrayLengthOut);
+ _Out_ HANDLE** ppHandleArrayOut,
+ _Out_ LPWSTR** ppStringArrayOut,
+ _Out_ DWORD* pdwArrayLengthOut);
EXTERN_C HRESULT
CloseCLREnumeration(
- __in HANDLE* pHandleArray,
- __in LPWSTR* pStringArray,
- __in DWORD dwArrayLength);
+ _In_ HANDLE* pHandleArray,
+ _In_ LPWSTR* pStringArray,
+ _In_ DWORD dwArrayLength);
EXTERN_C HRESULT
CreateVersionStringFromModule(
- __in DWORD pidDebuggee,
- __in LPCWSTR szModuleName,
- __out_ecount_part(cchBuffer, *pdwLength) LPWSTR pBuffer,
- __in DWORD cchBuffer,
- __out DWORD* pdwLength);
+ _In_ DWORD pidDebuggee,
+ _In_ LPCWSTR szModuleName,
+ _Out_writes_to_opt_(cchBuffer, *pdwLength) LPWSTR pBuffer,
+ _In_ DWORD cchBuffer,
+ _Out_ DWORD* pdwLength);
EXTERN_C HRESULT
CreateDebuggingInterfaceFromVersionEx(
- __in int iDebuggerVersion,
- __in LPCWSTR szDebuggeeVersion,
- __out IUnknown ** ppCordb);
+ _In_ int iDebuggerVersion,
+ _In_ LPCWSTR szDebuggeeVersion,
+ _Out_ IUnknown ** ppCordb);
EXTERN_C
DLLEXPORT
HRESULT
CreateDebuggingInterfaceFromVersion2(
- __in int iDebuggerVersion,
- __in LPCWSTR szDebuggeeVersion,
- __in LPCWSTR szApplicationGroupId,
- __out IUnknown ** ppCordb);
+ _In_ int iDebuggerVersion,
+ _In_ LPCWSTR szDebuggeeVersion,
+ _In_ LPCWSTR szApplicationGroupId,
+ _Out_ IUnknown ** ppCordb);
EXTERN_C HRESULT
CreateDebuggingInterfaceFromVersion(
- __in LPCWSTR szDebuggeeVersion,
- __out IUnknown ** ppCordb);
+ _In_ LPCWSTR szDebuggeeVersion,
+ _Out_ IUnknown ** ppCordb);
diff --git a/src/coreclr/dlls/mscoree/mscoree.cpp b/src/coreclr/dlls/mscoree/mscoree.cpp
index 4e2d87906ad309..c985b88ab30c2e 100644
--- a/src/coreclr/dlls/mscoree/mscoree.cpp
+++ b/src/coreclr/dlls/mscoree/mscoree.cpp
@@ -218,7 +218,7 @@ STDAPI ReOpenMetaDataWithMemoryEx(
static DWORD g_dwSystemDirectory = 0;
static WCHAR * g_pSystemDirectory = NULL;
-HRESULT GetInternalSystemDirectory(__out_ecount_part_opt(*pdwLength,*pdwLength) LPWSTR buffer, __inout DWORD* pdwLength)
+HRESULT GetInternalSystemDirectory(_Out_writes_to_opt_(*pdwLength,*pdwLength) LPWSTR buffer, __inout DWORD* pdwLength)
{
CONTRACTL {
NOTHROW;
@@ -252,7 +252,7 @@ HRESULT GetInternalSystemDirectory(__out_ecount_part_opt(*pdwLength,*pdwLength)
}
-LPCWSTR GetInternalSystemDirectory(__out DWORD* pdwLength)
+LPCWSTR GetInternalSystemDirectory(_Out_ DWORD* pdwLength)
{
LIMITED_METHOD_CONTRACT;
diff --git a/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp b/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp
index 6a0ba5a2499475..623f0087d400c0 100644
--- a/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp
+++ b/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp
@@ -487,7 +487,7 @@ HRESULT CeeFileGenWriter::generateImage(void **ppImage)
return hr;
} // HRESULT CeeFileGenWriter::generateImage()
-HRESULT CeeFileGenWriter::setOutputFileName(__in LPWSTR fileName)
+HRESULT CeeFileGenWriter::setOutputFileName(_In_ LPWSTR fileName)
{
if (m_outputFileName)
delete[] m_outputFileName;
@@ -498,7 +498,7 @@ HRESULT CeeFileGenWriter::setOutputFileName(__in LPWSTR fileName)
return S_OK;
} // HRESULT CeeFileGenWriter::setOutputFileName()
-HRESULT CeeFileGenWriter::setResourceFileName(__in LPWSTR fileName)
+HRESULT CeeFileGenWriter::setResourceFileName(_In_ LPWSTR fileName)
{
if (m_resourceFileName)
delete[] m_resourceFileName;
@@ -1294,7 +1294,7 @@ HRESULT CeeFileGenWriter::setVTableEntry(ULONG size, ULONG offset)
return setVTableEntry64(size,(void*)(ULONG_PTR)offset);
} // HRESULT CeeFileGenWriter::setVTableEntry()
-HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, __in char *ptr,
+HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, _In_ char *ptr,
unsigned *offset)
{
*offset = section.computeOffset(ptr);
@@ -1302,7 +1302,7 @@ HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, __in char *p
return S_OK;
} // HRESULT CeeFileGenWriter::computeSectionOffset()
-HRESULT CeeFileGenWriter::computeOffset(__in char *ptr,
+HRESULT CeeFileGenWriter::computeOffset(_In_ char *ptr,
CeeSection **pSection, unsigned *offset)
{
TESTANDRETURNPOINTER(pSection);
diff --git a/src/coreclr/dlls/mscorpe/iceefilegen.cpp b/src/coreclr/dlls/mscorpe/iceefilegen.cpp
index 6714d355d0bfc3..6c40d9699fce91 100644
--- a/src/coreclr/dlls/mscorpe/iceefilegen.cpp
+++ b/src/coreclr/dlls/mscorpe/iceefilegen.cpp
@@ -183,7 +183,7 @@ HRESULT ICeeFileGen::AddSectionReloc (HCEESECTION section, ULONG offset, HCEESEC
}
}
-HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, __in LPWSTR outputFileName)
+HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, _In_ LPWSTR outputFileName)
{
TESTANDRETURNPOINTER(ceeFile);
TESTANDRETURNPOINTER(outputFileName);
@@ -192,7 +192,7 @@ HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, __in LPWSTR outputFile
return(gen->setOutputFileName(outputFileName));
}
-__success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFile, __out LPWSTR *outputFileName)
+__success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFile, _Out_ LPWSTR *outputFileName)
{
TESTANDRETURNPOINTER(ceeFile);
TESTANDRETURNPOINTER(outputFileName);
@@ -204,7 +204,7 @@ __success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFi
}
-HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, __in LPWSTR resourceFileName)
+HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, _In_ LPWSTR resourceFileName)
{
TESTANDRETURNPOINTER(ceeFile);
TESTANDRETURNPOINTER(resourceFileName);
@@ -214,7 +214,7 @@ HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, __in LPWSTR resource
}
__success(return == S_OK)
-HRESULT ICeeFileGen::GetResourceFileName (HCEEFILE ceeFile, __out LPWSTR *resourceFileName)
+HRESULT ICeeFileGen::GetResourceFileName (HCEEFILE ceeFile, _Out_ LPWSTR *resourceFileName)
{
TESTANDRETURNPOINTER(ceeFile);
TESTANDRETURNPOINTER(resourceFileName);
@@ -277,7 +277,7 @@ HRESULT ICeeFileGen::GetMethodRVA(HCEEFILE ceeFile, ULONG codeOffset, ULONG *cod
return S_OK;
}
-HRESULT ICeeFileGen::EmitString(HCEEFILE ceeFile, __in LPWSTR strValue, ULONG *strRef)
+HRESULT ICeeFileGen::EmitString(HCEEFILE ceeFile, _In_ LPWSTR strValue, ULONG *strRef)
{
TESTANDRETURNPOINTER(ceeFile);
@@ -429,7 +429,7 @@ HRESULT ICeeFileGen::SetStrongNameEntry(HCEEFILE ceeFile, ULONG size, ULONG offs
return gen->setStrongNameEntry(size, offset);
}
-HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, __in char *ptr,
+HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, _In_ char *ptr,
unsigned *offset)
{
TESTANDRETURNPOINTER(section);
@@ -443,7 +443,7 @@ HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, __in char *ptr,
__success(return == S_OK)
HRESULT ICeeFileGen::ComputeSectionPointer(HCEESECTION section, ULONG offset,
- __out char **ptr)
+ _Out_ char **ptr)
{
TESTANDRETURNPOINTER(section);
@@ -454,7 +454,7 @@ HRESULT ICeeFileGen::ComputeSectionPointer(HCEESECTION section, ULONG offset,
return S_OK;
}
-HRESULT ICeeFileGen::ComputeOffset(HCEEFILE ceeFile, __in char *ptr,
+HRESULT ICeeFileGen::ComputeOffset(HCEEFILE ceeFile, _In_ char *ptr,
HCEESECTION *pSection, unsigned *offset)
{
TESTANDRETURNPOINTER(pSection);
diff --git a/src/coreclr/dlls/mscorpe/pewriter.cpp b/src/coreclr/dlls/mscorpe/pewriter.cpp
index 9add4b56d13b80..b78b00c2853ffb 100644
--- a/src/coreclr/dlls/mscorpe/pewriter.cpp
+++ b/src/coreclr/dlls/mscorpe/pewriter.cpp
@@ -1829,7 +1829,7 @@ HRESULT PEWriter::fixup(CeeGenTokenMapper *pMapper)
return(S_OK); // SUCCESS
}
-HRESULT PEWriter::Open(__in LPCWSTR fileName)
+HRESULT PEWriter::Open(_In_ LPCWSTR fileName)
{
_ASSERTE(m_file == INVALID_HANDLE_VALUE);
HRESULT hr = NOERROR;
@@ -1913,7 +1913,7 @@ HRESULT PEWriter::Close()
}
/******************************************************************/
-HRESULT PEWriter::write(__in LPCWSTR fileName) {
+HRESULT PEWriter::write(_In_ LPCWSTR fileName) {
HRESULT hr;
diff --git a/src/coreclr/dlls/mscorpe/pewriter.h b/src/coreclr/dlls/mscorpe/pewriter.h
index 21817b1d5efc45..84ec61f9275eca 100644
--- a/src/coreclr/dlls/mscorpe/pewriter.h
+++ b/src/coreclr/dlls/mscorpe/pewriter.h
@@ -41,7 +41,7 @@ class PEWriter : public PESectionMan
HRESULT link();
HRESULT fixup(CeeGenTokenMapper *pMapper);
- HRESULT write(__in LPCWSTR fileName);
+ HRESULT write(_In_ LPCWSTR fileName);
HRESULT write(void **ppImage);
// calling these functions is optional
@@ -174,7 +174,7 @@ class PEWriter : public PESectionMan
HRESULT linkPlaceSections(entry * entries, unsigned iEntries);
void setSectionIndex(IMAGE_SECTION_HEADER * h, unsigned sectionIndex);
- HRESULT Open(__in LPCWSTR fileName);
+ HRESULT Open(_In_ LPCWSTR fileName);
HRESULT Write(const void *data, int size);
HRESULT Seek(int offset);
HRESULT Pad(int align);
@@ -257,8 +257,8 @@ class PESeedSection : public PEWriterSection {
int getDirEntry() { _ASSERTE(!"PESeedSection"); return 0; }
HRESULT directoryEntry(unsigned num) { _ASSERTE(!"PESeedSection"); return E_FAIL; }
char * computePointer(unsigned offset) const { _ASSERTE(!"PESeedSection"); return NULL; }
- BOOL containsPointer(__in char *ptr) const { _ASSERTE(!"PESeedSection"); return FALSE; }
- unsigned computeOffset(__in char *ptr) const { _ASSERTE(!"PESeedSection"); return 0; }
+ BOOL containsPointer(_In_ char *ptr) const { _ASSERTE(!"PESeedSection"); return FALSE; }
+ unsigned computeOffset(_In_ char *ptr) const { _ASSERTE(!"PESeedSection"); return 0; }
HRESULT cloneInstance(PESection *destination) { _ASSERTE(!"PESeedSection"); return E_FAIL; }
// PEWriterSection
diff --git a/src/coreclr/ilasm/asmman.cpp b/src/coreclr/ilasm/asmman.cpp
index 7b5fd474b65157..447267d0b4d252 100644
--- a/src/coreclr/ilasm/asmman.cpp
+++ b/src/coreclr/ilasm/asmman.cpp
@@ -49,7 +49,7 @@ BinStr* BinStrToUnicode(BinStr* pSource, bool Swap)
return NULL;
}
-AsmManFile* AsmMan::GetFileByName(__in __nullterminated char* szFileName)
+AsmManFile* AsmMan::GetFileByName(_In_ __nullterminated char* szFileName)
{
AsmManFile* ret = NULL;
if(szFileName)
@@ -63,14 +63,14 @@ AsmManFile* AsmMan::GetFileByName(__in __nullterminated char* szFileName
return ret;
}
-mdToken AsmMan::GetFileTokByName(__in __nullterminated char* szFileName)
+mdToken AsmMan::GetFileTokByName(_In_ __nullterminated char* szFileName)
{
AsmManFile* tmp = GetFileByName(szFileName);
return(tmp ? tmp->tkTok : mdFileNil);
}
-AsmManComType* AsmMan::GetComTypeByName(__in_opt __nullterminated char* szComTypeName,
- __in_opt __nullterminated char* szComEnclosingTypeName)
+AsmManComType* AsmMan::GetComTypeByName(_In_opt_z_ char* szComTypeName,
+ _In_opt_z_ char* szComEnclosingTypeName)
{
AsmManComType* ret = NULL;
if(szComTypeName)
@@ -102,14 +102,14 @@ AsmManComType* AsmMan::GetComTypeByName(__in_opt __nullterminated char*
}
mdToken AsmMan::GetComTypeTokByName(
- __in_opt __nullterminated char* szComTypeName,
- __in_opt __nullterminated char* szComEnclosingTypeName)
+ _In_opt_z_ char* szComTypeName,
+ _In_opt_z_ char* szComEnclosingTypeName)
{
AsmManComType* tmp = GetComTypeByName(szComTypeName, szComEnclosingTypeName);
return(tmp ? tmp->tkTok : mdExportedTypeNil);
}
-AsmManAssembly* AsmMan::GetAsmRefByName(__in __nullterminated const char* szAsmRefName)
+AsmManAssembly* AsmMan::GetAsmRefByName(_In_ __nullterminated const char* szAsmRefName)
{
AsmManAssembly* ret = NULL;
if(szAsmRefName)
@@ -124,12 +124,12 @@ AsmManAssembly* AsmMan::GetAsmRefByName(__in __nullterminated const char* sz
}
return ret;
}
-mdToken AsmMan::GetAsmRefTokByName(__in __nullterminated const char* szAsmRefName)
+mdToken AsmMan::GetAsmRefTokByName(_In_ __nullterminated const char* szAsmRefName)
{
AsmManAssembly* tmp = GetAsmRefByName(szAsmRefName);
return(tmp ? tmp->tkTok : mdAssemblyRefNil);
}
-AsmManAssembly* AsmMan::GetAsmRefByAsmName(__in __nullterminated const char* szAsmName)
+AsmManAssembly* AsmMan::GetAsmRefByAsmName(_In_ __nullterminated const char* szAsmName)
{
AsmManAssembly* ret = NULL;
if(szAsmName)
@@ -160,7 +160,7 @@ void AsmMan::SetModuleName(__inout_opt __nullterminated char* szName)
}
//==============================================================================================================
-void AsmMan::AddFile(__in __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob)
+void AsmMan::AddFile(_In_ __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob)
{
AsmManFile* tmp = GetFileByName(szName);
Assembler* pAsm = (Assembler*)m_pAssembler;
@@ -244,7 +244,7 @@ void AsmMan::EmitFiles()
} //end for(i = 0; tmp=m_FileLst.PEEK(i); i++)
}
-void AsmMan::StartAssembly(__in __nullterminated char* szName, __in_opt __nullterminated char* szAlias, DWORD dwAttr, BOOL isRef)
+void AsmMan::StartAssembly(_In_ __nullterminated char* szName, _In_opt_z_ char* szAlias, DWORD dwAttr, BOOL isRef)
{
if(!isRef && (0==strcmp(szName, "mscorlib"))) ((Assembler*)m_pAssembler)->m_fIsMscorlib = TRUE;
if(!isRef && (m_pAssembly != NULL))
@@ -674,7 +674,7 @@ void AsmMan::SetAssemblyAutodetect()
}
}
-void AsmMan::StartComType(__in __nullterminated char* szName, DWORD dwAttr)
+void AsmMan::StartComType(_In_ __nullterminated char* szName, DWORD dwAttr)
{
if((m_pCurComType = new AsmManComType))
{
@@ -732,7 +732,7 @@ void AsmMan::EndComType()
}
}
-void AsmMan::SetComTypeFile(__in __nullterminated char* szFileName)
+void AsmMan::SetComTypeFile(_In_ __nullterminated char* szFileName)
{
if(m_pCurComType)
{
@@ -740,7 +740,7 @@ void AsmMan::SetComTypeFile(__in __nullterminated char* szFileName)
}
}
-void AsmMan::SetComTypeAsmRef(__in __nullterminated char* szAsmRefName)
+void AsmMan::SetComTypeAsmRef(_In_ __nullterminated char* szAsmRefName)
{
if(m_pCurComType)
{
@@ -748,7 +748,7 @@ void AsmMan::SetComTypeAsmRef(__in __nullterminated char* szAsmRefName)
}
}
-void AsmMan::SetComTypeComType(__in __nullterminated char* szComTypeName)
+void AsmMan::SetComTypeComType(_In_ __nullterminated char* szComTypeName)
{
if(m_pCurComType)
{
@@ -780,7 +780,7 @@ BOOL AsmMan::SetComTypeClassTok(mdToken tkClass)
return FALSE;
}
-void AsmMan::StartManifestRes(__in __nullterminated char* szName, __in __nullterminated char* szAlias, DWORD dwAttr)
+void AsmMan::StartManifestRes(_In_ __nullterminated char* szName, _In_ __nullterminated char* szAlias, DWORD dwAttr)
{
if((m_pCurManRes = new AsmManRes))
{
@@ -808,7 +808,7 @@ void AsmMan::EndManifestRes()
}
-void AsmMan::SetManifestResFile(__in __nullterminated char* szFileName, ULONG ulOffset)
+void AsmMan::SetManifestResFile(_In_ __nullterminated char* szFileName, ULONG ulOffset)
{
if(m_pCurManRes)
{
@@ -817,7 +817,7 @@ void AsmMan::SetManifestResFile(__in __nullterminated char* szFileName, ULONG
}
}
-void AsmMan::SetManifestResAsmRef(__in __nullterminated char* szAsmRefName)
+void AsmMan::SetManifestResAsmRef(_In_ __nullterminated char* szAsmRefName)
{
if(m_pCurManRes)
{
diff --git a/src/coreclr/ilasm/asmman.hpp b/src/coreclr/ilasm/asmman.hpp
index 1290c9b2707c8a..972c8382434f8e 100644
--- a/src/coreclr/ilasm/asmman.hpp
+++ b/src/coreclr/ilasm/asmman.hpp
@@ -193,12 +193,12 @@ class AsmMan
ErrorReporter* report;
void* m_pAssembler;
- AsmManFile* GetFileByName(__in __nullterminated char* szFileName);
- AsmManAssembly* GetAsmRefByName(__in __nullterminated const char* szAsmRefName);
- AsmManComType* GetComTypeByName(__in_opt __nullterminated char* szComTypeName,
- __in_opt __nullterminated char* szComEnclosingTypeName = NULL);
- mdToken GetComTypeTokByName(__in_opt __nullterminated char* szComTypeName,
- __in_opt __nullterminated char* szComEnclosingTypeName = NULL);
+ AsmManFile* GetFileByName(_In_ __nullterminated char* szFileName);
+ AsmManAssembly* GetAsmRefByName(_In_ __nullterminated const char* szAsmRefName);
+ AsmManComType* GetComTypeByName(_In_opt_z_ char* szComTypeName,
+ _In_opt_z_ char* szComEnclosingTypeName = NULL);
+ mdToken GetComTypeTokByName(_In_opt_z_ char* szComTypeName,
+ _In_opt_z_ char* szComEnclosingTypeName = NULL);
IMetaDataEmit* m_pEmitter;
@@ -241,11 +241,11 @@ class AsmMan
void SetModuleName(__inout_opt __nullterminated char* szName);
- void AddFile(__in __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob);
+ void AddFile(_In_ __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob);
void EmitFiles();
void EmitDebuggableAttribute(mdToken tkOwner);
- void StartAssembly(__in __nullterminated char* szName, __in_opt __nullterminated char* szAlias, DWORD dwAttr, BOOL isRef);
+ void StartAssembly(_In_ __nullterminated char* szName, _In_opt_z_ char* szAlias, DWORD dwAttr, BOOL isRef);
void EndAssembly();
void EmitAssemblyRefs();
void EmitAssembly();
@@ -257,27 +257,27 @@ class AsmMan
void SetAssemblyHashBlob(BinStr* pHashBlob);
void SetAssemblyAutodetect();
- void StartComType(__in __nullterminated char* szName, DWORD dwAttr);
+ void StartComType(_In_ __nullterminated char* szName, DWORD dwAttr);
void EndComType();
- void SetComTypeFile(__in __nullterminated char* szFileName);
- void SetComTypeAsmRef(__in __nullterminated char* szAsmRefName);
- void SetComTypeComType(__in __nullterminated char* szComTypeName);
+ void SetComTypeFile(_In_ __nullterminated char* szFileName);
+ void SetComTypeAsmRef(_In_ __nullterminated char* szAsmRefName);
+ void SetComTypeComType(_In_ __nullterminated char* szComTypeName);
BOOL SetComTypeImplementationTok(mdToken tk);
BOOL SetComTypeClassTok(mdToken tkClass);
- void StartManifestRes(__in __nullterminated char* szName, __in __nullterminated char* szAlias, DWORD dwAttr);
+ void StartManifestRes(_In_ __nullterminated char* szName, _In_ __nullterminated char* szAlias, DWORD dwAttr);
void EndManifestRes();
- void SetManifestResFile(__in __nullterminated char* szFileName, ULONG ulOffset);
- void SetManifestResAsmRef(__in __nullterminated char* szAsmRefName);
+ void SetManifestResFile(_In_ __nullterminated char* szFileName, ULONG ulOffset);
+ void SetManifestResAsmRef(_In_ __nullterminated char* szAsmRefName);
- AsmManAssembly* GetAsmRefByAsmName(__in __nullterminated const char* szAsmName);
+ AsmManAssembly* GetAsmRefByAsmName(_In_ __nullterminated const char* szAsmName);
- mdToken GetFileTokByName(__in __nullterminated char* szFileName);
- mdToken GetAsmRefTokByName(__in __nullterminated const char* szAsmRefName);
- mdToken GetAsmTokByName(__in __nullterminated const char* szAsmName)
+ mdToken GetFileTokByName(_In_ __nullterminated char* szFileName);
+ mdToken GetAsmRefTokByName(_In_ __nullterminated const char* szAsmRefName);
+ mdToken GetAsmTokByName(_In_ __nullterminated const char* szAsmName)
{ return (m_pAssembly && (strcmp(m_pAssembly->szName,szAsmName)==0)) ? m_pAssembly->tkTok : 0; };
- mdToken GetModuleRefTokByName(__in __nullterminated char* szName)
+ mdToken GetModuleRefTokByName(_In_ __nullterminated char* szName)
{
if(szName && *szName)
{
diff --git a/src/coreclr/ilasm/asmparse.h b/src/coreclr/ilasm/asmparse.h
index ef377b5e430d7c..e5479202730033 100644
--- a/src/coreclr/ilasm/asmparse.h
+++ b/src/coreclr/ilasm/asmparse.h
@@ -20,11 +20,11 @@ class ReadStream {
virtual ~ReadStream() = default;
- virtual unsigned getAll(__out char** ppch) = 0;
+ virtual unsigned getAll(_Out_ char** ppch) = 0;
// read at most 'buffLen' bytes into 'buff', Return the
// number of characters read. On EOF return 0
- virtual unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen) = 0;
+ virtual unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen) = 0;
// Return the name of the stream, (for error reporting).
//virtual const char* name() = 0;
@@ -49,12 +49,12 @@ class BinStrStream : public ReadStream {
//if(m_pBS)
// delete m_pBS;
};
- unsigned getAll(__out char **ppbuff)
+ unsigned getAll(_Out_ char **ppbuff)
{
*ppbuff = m_pStart;
return m_pBS->length();
};
- unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen)
+ unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen)
{
_ASSERTE(m_pStart != NULL);
unsigned Remainder = (unsigned)(m_pEnd - m_pCurr);
@@ -95,7 +95,7 @@ class BinStrStream : public ReadStream {
/**************************************************************************/
class MappedFileStream : public ReadStream {
public:
- MappedFileStream(__in __nullterminated WCHAR* wFileName)
+ MappedFileStream(_In_ __nullterminated WCHAR* wFileName)
{
fileNameW = wFileName;
m_hFile = INVALID_HANDLE_VALUE;
@@ -124,12 +124,12 @@ class MappedFileStream : public ReadStream {
fileNameW = NULL;
}
}
- unsigned getAll(__out char** pbuff)
+ unsigned getAll(_Out_ char** pbuff)
{
*pbuff = m_pStart;
return m_FileSize;
}
- unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen)
+ unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen)
{
_ASSERTE(m_pStart != NULL);
unsigned Remainder = (unsigned)(m_pEnd - m_pCurr);
@@ -214,29 +214,29 @@ typedef LIFO ARG_NAME_LIST_STACK;
/*--------------------------------------------------------------------------*/
typedef char*(*PFN_NEXTCHAR)(char*);
-char* nextcharU(__in __nullterminated char* pos);
-char* nextcharW(__in __nullterminated char* pos);
+char* nextcharU(_In_ __nullterminated char* pos);
+char* nextcharW(_In_ __nullterminated char* pos);
/*--------------------------------------------------------------------------*/
typedef unsigned(*PFN_SYM)(char*);
-unsigned SymAU(__in __nullterminated char* curPos);
-unsigned SymW(__in __nullterminated char* curPos);
+unsigned SymAU(_In_ __nullterminated char* curPos);
+unsigned SymW(_In_ __nullterminated char* curPos);
/*--------------------------------------------------------------------------*/
typedef char*(*PFN_NEWSTRFROMTOKEN)(char*,size_t);
-char* NewStrFromTokenAU(__in_ecount(tokLen) char* curTok, size_t tokLen);
-char* NewStrFromTokenW(__in_ecount(tokLen) char* curTok, size_t tokLen);
+char* NewStrFromTokenAU(_In_reads_(tokLen) char* curTok, size_t tokLen);
+char* NewStrFromTokenW(_In_reads_(tokLen) char* curTok, size_t tokLen);
/*--------------------------------------------------------------------------*/
typedef char*(*PFN_NEWSTATICSTRFROMTOKEN)(char*,size_t,char*,size_t);
-char* NewStaticStrFromTokenAU(__in_ecount(tokLen) char* curTok, size_t tokLen, __out_ecount(bufSize) char* staticBuf, size_t bufSize);
-char* NewStaticStrFromTokenW(__in_ecount(tokLen) char* curTok, size_t tokLen, __out_ecount(bufSize) char* staticBuf, size_t bufSize);
+char* NewStaticStrFromTokenAU(_In_reads_(tokLen) char* curTok, size_t tokLen, _Out_writes_(bufSize) char* staticBuf, size_t bufSize);
+char* NewStaticStrFromTokenW(_In_reads_(tokLen) char* curTok, size_t tokLen, _Out_writes_(bufSize) char* staticBuf, size_t bufSize);
/*--------------------------------------------------------------------------*/
typedef unsigned(*PFN_GETDOUBLE)(char*,unsigned,double**);
-unsigned GetDoubleAU(__in __nullterminated char* begNum, unsigned L, double** ppRes);
-unsigned GetDoubleW(__in __nullterminated char* begNum, unsigned L, double** ppRes);
+unsigned GetDoubleAU(_In_ __nullterminated char* begNum, unsigned L, double** ppRes);
+unsigned GetDoubleW(_In_ __nullterminated char* begNum, unsigned L, double** ppRes);
/*--------------------------------------------------------------------------*/
struct PARSING_ENVIRONMENT
{
@@ -284,9 +284,9 @@ class AsmParse : public ErrorReporter
virtual void warn(const char* fmt, ...);
virtual void msg(const char* fmt, ...);
char *getLine(int lineNum) { return penv->in->getLine(lineNum); };
- unsigned getAll(__out char** pbuff) { return penv->in->getAll(pbuff); };
+ unsigned getAll(_Out_ char** pbuff) { return penv->in->getAll(pbuff); };
bool Success() {return success; };
- void SetIncludePath(__in WCHAR* wz) { wzIncludePath = wz; };
+ void SetIncludePath(_In_ WCHAR* wz) { wzIncludePath = wz; };
ARG_NAME_LIST_STACK m_ANSFirst;
ARG_NAME_LIST_STACK m_ANSLast;
@@ -298,20 +298,20 @@ class AsmParse : public ErrorReporter
BinStr* MakeTypeClass(CorElementType kind, mdToken tk);
BinStr* MakeTypeArray(CorElementType kind, BinStr* elemType, BinStr* bounds);
- char* fillBuff(__in_opt __nullterminated char* curPos); // refill the input buffer
+ char* fillBuff(_In_opt_z_ char* curPos); // refill the input buffer
HANDLE hstdout;
HANDLE hstderr;
private:
- friend void yyerror(__in __nullterminated const char* str);
+ friend void yyerror(_In_ __nullterminated const char* str);
friend int parse_literal(unsigned curSym, __inout __nullterminated char* &curPos, BOOL translate_escapes);
friend int yyparse();
friend int yylex();
friend Instr* SetupInstr(unsigned short opcode);
friend int findKeyword(const char* name, size_t nameLen, unsigned short* opcode);
- friend TypeDefDescr* findTypedef(__in_ecount(nameLen) char* name, size_t nameLen);
- friend char* skipBlanks(__in __nullterminated char*,unsigned*);
- friend char* nextBlank(__in __nullterminated char*);
+ friend TypeDefDescr* findTypedef(_In_reads_(nameLen) char* name, size_t nameLen);
+ friend char* skipBlanks(_In_ __nullterminated char*,unsigned*);
+ friend char* nextBlank(_In_ __nullterminated char*);
friend int ProcessEOF();
friend unsigned __int8* skipType(unsigned __int8* ptr, BOOL fFixupType);
friend void FixupConstraints();
diff --git a/src/coreclr/ilasm/assem.cpp b/src/coreclr/ilasm/assem.cpp
index e8044d16ab2b7f..e58b8e569d8d34 100644
--- a/src/coreclr/ilasm/assem.cpp
+++ b/src/coreclr/ilasm/assem.cpp
@@ -1039,7 +1039,7 @@ BOOL Assembler::EmitProp(PropDescriptor* pPD)
return TRUE;
}
-Class *Assembler::FindCreateClass(__in __nullterminated const char *pszFQN)
+Class *Assembler::FindCreateClass(_In_ __nullterminated const char *pszFQN)
{
Class *pSearch = NULL;
@@ -1186,7 +1186,7 @@ BOOL Assembler::DoGlobalFixups()
return TRUE;
}
-state_t Assembler::AddGlobalLabel(__in __nullterminated char *pszName, HCEESECTION section)
+state_t Assembler::AddGlobalLabel(_In_ __nullterminated char *pszName, HCEESECTION section)
{
if (FindGlobalLabel(pszName) != NULL)
{
@@ -1213,7 +1213,7 @@ state_t Assembler::AddGlobalLabel(__in __nullterminated char *pszName, HCEESECTI
return m_State;
}
-void Assembler::AddLabel(DWORD CurPC, __in __nullterminated char *pszName)
+void Assembler::AddLabel(DWORD CurPC, _In_ __nullterminated char *pszName)
{
if (m_pCurMethod->FindLabel(pszName) != NULL)
{
@@ -1478,7 +1478,7 @@ acceptable. Do NOT use for cryptographic purposes.
*/
unsigned hash(
- __in_ecount(length) const BYTE *k, /* the key */
+ _In_reads_(length) const BYTE *k, /* the key */
unsigned length, /* the length of the key */
unsigned initval) /* the previous hash, or an arbitrary value */
{
diff --git a/src/coreclr/ilasm/assembler.cpp b/src/coreclr/ilasm/assembler.cpp
index 48f9487656f7cf..85183bfae7542b 100644
--- a/src/coreclr/ilasm/assembler.cpp
+++ b/src/coreclr/ilasm/assembler.cpp
@@ -15,7 +15,7 @@
#define FAIL_UNLESS(x, y) if (!(x)) { report->error y; return; }
/**************************************************************************/
-void Assembler::StartNameSpace(__in __nullterminated char* name)
+void Assembler::StartNameSpace(_In_ __nullterminated char* name)
{
m_NSstack.PUSH(m_szNamespace);
m_szNamespace = name;
@@ -91,7 +91,7 @@ void Assembler::ClearBoundList(void)
m_TyParList = NULL;
}
/**************************************************************************/
-mdToken Assembler::ResolveClassRef(mdToken tkResScope, __in __nullterminated const char *pszFullClassName, Class** ppClass)
+mdToken Assembler::ResolveClassRef(mdToken tkResScope, _In_ __nullterminated const char *pszFullClassName, Class** ppClass)
{
Class *pClass = NULL;
mdToken tkRet = mdTokenNil;
@@ -239,7 +239,7 @@ mdToken Assembler::ResolveTypeSpec(BinStr* typeSpec)
}
/**************************************************************************/
-mdToken Assembler::GetAsmRef(__in __nullterminated const char* szName)
+mdToken Assembler::GetAsmRef(_In_ __nullterminated const char* szName)
{
mdToken tkResScope = 0;
if(strcmp(szName,"*")==0) tkResScope = mdTokenNil;
@@ -330,7 +330,7 @@ mdToken Assembler::GetInterfaceImpl(mdToken tsClass, mdToken tsInterface)
}
/**************************************************************************/
-mdToken Assembler::GetModRef(__in __nullterminated char* szName)
+mdToken Assembler::GetModRef(_In_ __nullterminated char* szName)
{
mdToken tkResScope = 0;
if(!strcmp(szName,m_szScopeName))
@@ -417,7 +417,7 @@ DWORD Assembler::CheckClassFlagsIfNested(Class* pEncloser, DWORD attr)
/**************************************************************************/
-void Assembler::StartClass(__in __nullterminated char* name, DWORD attr, TyParList *typars)
+void Assembler::StartClass(_In_ __nullterminated char* name, DWORD attr, TyParList *typars)
{
Class *pEnclosingClass = m_pCurClass;
char *szFQN;
@@ -607,7 +607,7 @@ void Assembler::SetPinvoke(BinStr* DllName, int Ordinal, BinStr* Alias, int Attr
}
/**************************************************************************/
-void Assembler::StartMethod(__in __nullterminated char* name, BinStr* sig, CorMethodAttr flags, BinStr* retMarshal, DWORD retAttr, TyParList *typars)
+void Assembler::StartMethod(_In_ __nullterminated char* name, BinStr* sig, CorMethodAttr flags, BinStr* retMarshal, DWORD retAttr, TyParList *typars)
{
if (m_pCurMethod != NULL)
{
@@ -801,7 +801,7 @@ void Assembler::EndMethod()
}
/**************************************************************************/
/* rvaLabel is the optional label that indicates this field points at a particular RVA */
-void Assembler::AddField(__inout_z __inout char* name, BinStr* sig, CorFieldAttr flags, __in __nullterminated char* rvaLabel, BinStr* pVal, ULONG ulOffset)
+void Assembler::AddField(__inout_z __inout char* name, BinStr* sig, CorFieldAttr flags, _In_ __nullterminated char* rvaLabel, BinStr* pVal, ULONG ulOffset)
{
FieldDescriptor* pFD;
ULONG i,n;
@@ -1030,7 +1030,7 @@ void Assembler::NewSEHDescriptor(void) //sets m_SEHD
if(m_SEHD == NULL) report->error("Failed to allocate SEH descriptor\n");
}
/**************************************************************************/
-void Assembler::SetTryLabels(__in __nullterminated char * szFrom, __in __nullterminated char *szTo)
+void Assembler::SetTryLabels(_In_ __nullterminated char * szFrom, _In_ __nullterminated char *szTo)
{
if(!m_SEHD) return;
Label *pLbl = m_pCurMethod->FindLabel(szFrom);
@@ -1043,7 +1043,7 @@ void Assembler::SetTryLabels(__in __nullterminated char * szFrom, __in __nullter
else report->error("Undefined 1st label in 'try
diff --git a/src/coreclr/tools/ILVerification/TypeVerifier.cs b/src/coreclr/tools/ILVerification/TypeVerifier.cs
index 9c760c8dd733fb..94672533bdd21f 100644
--- a/src/coreclr/tools/ILVerification/TypeVerifier.cs
+++ b/src/coreclr/tools/ILVerification/TypeVerifier.cs
@@ -99,7 +99,11 @@ public void VerifyInterfaces()
continue;
}
- MethodDesc resolvedMethod = type.ResolveInterfaceMethodTarget(method);
+ if (type.ResolveInterfaceMethodTarget(method) is not MethodDesc resolvedMethod)
+ {
+ type.ResolveInterfaceMethodToDefaultImplementationOnType(method, out resolvedMethod);
+ }
+
if (resolvedMethod is null)
{
VerificationError(VerifierError.InterfaceMethodNotImplemented, Format(type), Format(implementedInterface.InterfaceType, _module, implementedInterface.InterfaceImplementation), Format(method));
diff --git a/src/coreclr/tools/InjectResource/InjectResource.cpp b/src/coreclr/tools/InjectResource/InjectResource.cpp
index 61f49f5d3c7301..cf5c3917df9d2c 100644
--- a/src/coreclr/tools/InjectResource/InjectResource.cpp
+++ b/src/coreclr/tools/InjectResource/InjectResource.cpp
@@ -12,8 +12,8 @@ char* g_appName;
#define MAX(x,y) ((x) > (y) ? (x) : (y))
void
-AddBinaryResourceToDll(__in_z char* dllName,
- __in_z const char* resName,
+AddBinaryResourceToDll(_In_z_ char* dllName,
+ _In_z_ const char* resName,
PVOID resData,
ULONG resDataSize)
{
@@ -59,7 +59,7 @@ AddBinaryResourceToDll(__in_z char* dllName,
}
void
-GetBinFileData(__in_z char* binFileName, PVOID* binData, PULONG binDataSize)
+GetBinFileData(_In_z_ char* binFileName, PVOID* binData, PULONG binDataSize)
{
HANDLE binFileHandle;
PVOID data;
@@ -108,7 +108,7 @@ Usage(void)
}
void __cdecl
-main(int argc, __in_z char** argv)
+main(int argc, _In_z_ char** argv)
{
char* binFile = NULL;
char* dllFile = NULL;
diff --git a/src/coreclr/tools/StressLogAnalyzer/StressLogDump.cpp b/src/coreclr/tools/StressLogAnalyzer/StressLogDump.cpp
index a0e8c877be52f2..f7f22d310c1b33 100644
--- a/src/coreclr/tools/StressLogAnalyzer/StressLogDump.cpp
+++ b/src/coreclr/tools/StressLogAnalyzer/StressLogDump.cpp
@@ -39,7 +39,7 @@ void GcHistAddLog(LPCSTR msg, StressMsg* stressMsg);
/*********************************************************************************/
-static const WCHAR* getTime(const FILETIME* time, __out_ecount (buffLen) WCHAR* buff, int buffLen)
+static const WCHAR* getTime(const FILETIME* time, _Out_writes_ (buffLen) WCHAR* buff, int buffLen)
{
SYSTEMTIME systemTime;
static const WCHAR badTime[] = W("BAD TIME");
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilationBuilder.Aot.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilationBuilder.Aot.cs
index 25cd0bc9b85a6b..fb4ad5ce51b7f6 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilationBuilder.Aot.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilationBuilder.Aot.cs
@@ -22,7 +22,6 @@ partial class CompilationBuilder
protected MethodImportationErrorProvider _methodImportationErrorProvider = new MethodImportationErrorProvider();
protected IInliningPolicy _inliningPolicy;
protected bool _methodBodyFolding;
- protected bool _singleThreaded;
protected InstructionSetSupport _instructionSetSupport;
protected SecurityMitigationOptions _mitigationOptions;
@@ -92,12 +91,6 @@ public CompilationBuilder UseMethodBodyFolding(bool enable)
return this;
}
- public CompilationBuilder UseSingleThread(bool enable)
- {
- _singleThreaded = enable;
- return this;
- }
-
public CompilationBuilder UsePreinitializationManager(PreinitializationManager manager)
{
_preinitializationManager = manager;
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.Aot.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.Aot.cs
index 33305d2011c876..66e6044d418a1f 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.Aot.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.Aot.cs
@@ -14,12 +14,21 @@ namespace ILCompiler
{
partial class CompilerTypeSystemContext
{
+ // Chosen rather arbitrarily. For the app that I was looking at, cutoff point of 7 compiled
+ // more than 10 minutes on a release build of the compiler, and I lost patience.
+ // Cutoff point of 5 produced an 1.7 GB object file.
+ // Cutoff point of 4 produced an 830 MB object file.
+ // Cutoff point of 3 produced an 470 MB object file.
+ // We want this to be high enough so that it doesn't cut off too early. But also not too
+ // high because things that are recursive often end up expanding laterally as well
+ // through various other generic code the deep code calls into.
+ public const int DefaultGenericCycleCutoffPoint = 4;
+
public SharedGenericsConfiguration GenericsConfig
{
get;
}
- private readonly DelegateFeature _delegateFeatures;
private readonly MetadataFieldLayoutAlgorithm _metadataFieldLayoutAlgorithm = new CompilerMetadataFieldLayoutAlgorithm();
private readonly RuntimeDeterminedFieldLayoutAlgorithm _runtimeDeterminedFieldLayoutAlgorithm = new RuntimeDeterminedFieldLayoutAlgorithm();
private readonly VectorOfTFieldLayoutAlgorithm _vectorOfTFieldLayoutAlgorithm;
@@ -29,7 +38,7 @@ public SharedGenericsConfiguration GenericsConfig
private ArrayOfTRuntimeInterfacesAlgorithm _arrayOfTRuntimeInterfacesAlgorithm;
private MetadataType _arrayOfTType;
- public CompilerTypeSystemContext(TargetDetails details, SharedGenericsMode genericsMode, DelegateFeature delegateFeatures)
+ public CompilerTypeSystemContext(TargetDetails details, SharedGenericsMode genericsMode, DelegateFeature delegateFeatures, int genericCycleCutoffPoint = DefaultGenericCycleCutoffPoint)
: base(details)
{
_genericsMode = genericsMode;
@@ -37,7 +46,9 @@ public CompilerTypeSystemContext(TargetDetails details, SharedGenericsMode gener
_vectorOfTFieldLayoutAlgorithm = new VectorOfTFieldLayoutAlgorithm(_metadataFieldLayoutAlgorithm);
_vectorFieldLayoutAlgorithm = new VectorFieldLayoutAlgorithm(_metadataFieldLayoutAlgorithm);
- _delegateFeatures = delegateFeatures;
+ _delegateInfoHashtable = new DelegateInfoHashtable(delegateFeatures);
+
+ _genericCycleDetector = new LazyGenericsSupport.GenericCycleDetector(genericCycleCutoffPoint);
GenericsConfig = new SharedGenericsConfiguration();
}
@@ -165,11 +176,6 @@ protected virtual IEnumerable GetAllMethodsForDelegate(TypeDesc type
yield return m;
}
- protected override DelegateInfo CreateDelegateInfo(TypeDesc delegateType)
- {
- return new DelegateInfo(delegateType, _delegateFeatures);
- }
-
internal DefType GetClosestDefType(TypeDesc type)
{
if (type.IsArray)
@@ -187,7 +193,7 @@ internal DefType GetClosestDefType(TypeDesc type)
return (DefType)type;
}
- private readonly LazyGenericsSupport.GenericCycleDetector _genericCycleDetector = new LazyGenericsSupport.GenericCycleDetector();
+ private readonly LazyGenericsSupport.GenericCycleDetector _genericCycleDetector;
public void DetectGenericCycles(TypeSystemEntity owner, TypeSystemEntity referent)
{
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs
index 8be62c3d9950db..39a6bf3490beb0 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs
@@ -259,7 +259,8 @@ private partial class BoxedValueType : MetadataType, INonEmittableType
public override string Name => "Boxed_" + ValueTypeRepresented.Name;
public override string Namespace => ValueTypeRepresented.Namespace;
-
+ public override string DiagnosticName => "Boxed_" + ValueTypeRepresented.DiagnosticName;
+ public override string DiagnosticNamespace => ValueTypeRepresented.DiagnosticNamespace;
public override Instantiation Instantiation => ValueTypeRepresented.Instantiation;
public override PInvokeStringFormat PInvokeStringFormat => PInvokeStringFormat.AutoClass;
public override bool IsExplicitLayout => false;
@@ -411,6 +412,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return _targetMethod.DiagnosticName + "_Unbox";
+ }
+ }
+
public override MethodIL EmitIL()
{
if (_owningType.ValueTypeRepresented.IsByRefLike)
@@ -487,6 +496,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return _targetMethod.DiagnosticName + "_Unbox";
+ }
+ }
+
public override MethodIL EmitIL()
{
if (_owningType.ValueTypeRepresented.IsByRefLike)
@@ -574,6 +591,7 @@ public ValueTypeInstanceMethodWithHiddenParameter(MethodDesc methodRepresented)
public override TypeDesc OwningType => _methodRepresented.OwningType;
public override string Name => _methodRepresented.Name;
+ public override string DiagnosticName => _methodRepresented.DiagnosticName;
public override MethodSignature Signature
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DelegateInfo.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DelegateInfo.cs
similarity index 67%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DelegateInfo.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DelegateInfo.cs
index b9a3a3e1fdbbb2..a021e39691d226 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DelegateInfo.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DelegateInfo.cs
@@ -4,13 +4,19 @@
using System;
using Internal.IL;
+using Internal.TypeSystem;
-namespace Internal.TypeSystem
+namespace ILCompiler
{
- public abstract partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
private class DelegateInfoHashtable : LockFreeReaderHashtable
{
+ private readonly DelegateFeature _delegateFeatures;
+
+ public DelegateInfoHashtable(DelegateFeature features)
+ => _delegateFeatures = features;
+
protected override int GetKeyHashCode(TypeDesc key)
{
return key.GetHashCode();
@@ -29,24 +35,15 @@ protected override bool CompareValueToValue(DelegateInfo value1, DelegateInfo va
}
protected override DelegateInfo CreateValueFromKey(TypeDesc key)
{
- return key.Context.CreateDelegateInfo(key);
+ return new DelegateInfo(key, _delegateFeatures);
}
}
- private DelegateInfoHashtable _delegateInfoHashtable = new DelegateInfoHashtable();
+ private readonly DelegateInfoHashtable _delegateInfoHashtable;
public DelegateInfo GetDelegateInfo(TypeDesc delegateType)
{
return _delegateInfoHashtable.GetOrCreateValue(delegateType);
}
-
- ///
- /// Creates a for a given delegate type.
- ///
- protected virtual DelegateInfo CreateDelegateInfo(TypeDesc key)
- {
- // Type system contexts that support creating delegate infos need to override.
- throw new NotSupportedException();
- }
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DynamicInvoke.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DynamicInvoke.cs
similarity index 85%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DynamicInvoke.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DynamicInvoke.cs
index 290f11dd90a508..0ed3d107b3a396 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DynamicInvoke.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DynamicInvoke.cs
@@ -2,12 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
using Internal.IL.Stubs;
+using Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
-namespace Internal.TypeSystem
+namespace ILCompiler
{
- partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
private class DynamicInvokeThunkHashtable : LockFreeReaderHashtable
{
@@ -17,7 +18,7 @@ private class DynamicInvokeThunkHashtable : LockFreeReaderHashtable value.TargetSignature.GetHashCode();
protected override DynamicInvokeMethodThunk CreateValueFromKey(DynamicInvokeMethodSignature key)
{
- return new DynamicInvokeMethodThunk(key.Context.GeneratedAssembly.GetGlobalModuleType(), key);
+ return new DynamicInvokeMethodThunk(((CompilerTypeSystemContext)key.Context).GeneratedAssembly.GetGlobalModuleType(), key);
}
}
DynamicInvokeThunkHashtable _dynamicInvokeThunks = new DynamicInvokeThunkHashtable();
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.EnumMethods.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.EnumMethods.cs
similarity index 97%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.EnumMethods.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.EnumMethods.cs
index 0be009f53c7bb3..b777e28a2d144e 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.EnumMethods.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.EnumMethods.cs
@@ -3,13 +3,14 @@
using System.Collections.Generic;
+using Internal.TypeSystem;
using Internal.IL.Stubs;
using Debug = System.Diagnostics.Debug;
-namespace Internal.TypeSystem
+namespace ILCompiler
{
- public abstract partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
private class EnumInfo
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.Sorting.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.Sorting.cs
similarity index 64%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.Sorting.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.Sorting.cs
index a2490a4cb196e7..41254150763cf9 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.Sorting.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.Sorting.cs
@@ -3,16 +3,18 @@
using System;
-namespace Internal.TypeSystem
+using Internal.TypeSystem;
+
+namespace ILCompiler
{
- partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
// Functionality related to determinstic ordering of types and members
partial class CompilerGeneratedType : MetadataType
{
- protected internal override int ClassCode => -1036681447;
+ protected override int ClassCode => -1036681447;
- protected internal override int CompareToImpl(TypeDesc other, TypeSystemComparer comparer)
+ protected override int CompareToImpl(TypeDesc other, TypeSystemComparer comparer)
{
// Should be a singleton
throw new NotSupportedException();
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.cs
similarity index 94%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.cs
index a01beba3cea869..280f2d85684a3b 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.cs
@@ -4,14 +4,16 @@
using System;
using System.Collections.Generic;
+using Internal.TypeSystem;
+
using TypeHashingAlgorithms = Internal.NativeFormat.TypeHashingAlgorithms;
using Interlocked = System.Threading.Interlocked;
using AssemblyName = System.Reflection.AssemblyName;
using Debug = System.Diagnostics.Debug;
-namespace Internal.TypeSystem
+namespace ILCompiler
{
- partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
private ModuleDesc _generatedAssembly;
@@ -89,6 +91,14 @@ public override string Name
get;
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return Name;
+ }
+ }
+
public override string Namespace
{
get
@@ -97,6 +107,14 @@ public override string Namespace
}
}
+ public override string DiagnosticNamespace
+ {
+ get
+ {
+ return "Internal.CompilerGenerated";
+ }
+ }
+
public override int GetHashCode()
{
if (_hashcode != 0)
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs
index ad558ae43bf51b..adc509298c0bbc 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs
@@ -149,7 +149,7 @@ protected override bool CompareValueToValue(DefaultInterfaceMethodImplementation
}
protected override DefaultInterfaceMethodImplementationInstantiationThunk CreateValueFromKey(DefaultInterfaceMethodImplementationInstantiationThunkHashtableKey key)
{
- TypeDesc owningTypeOfThunks = key.TargetMethod.Context.GeneratedAssembly.GetGlobalModuleType();
+ TypeDesc owningTypeOfThunks = ((CompilerTypeSystemContext)key.TargetMethod.Context).GeneratedAssembly.GetGlobalModuleType();
return new DefaultInterfaceMethodImplementationInstantiationThunk(owningTypeOfThunks, key.TargetMethod, key.InterfaceIndex);
}
}
@@ -194,6 +194,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return _targetMethod.DiagnosticName;
+ }
+ }
+
public MethodDesc BaseMethod => _targetMethod;
public string Prefix => $"__InstantiatingStub_{_interfaceIndex}_";
@@ -274,6 +282,7 @@ public DefaultInterfaceMethodImplementationWithHiddenParameter(MethodDesc method
public override TypeDesc OwningType => _owningType;
public override string Name => _methodRepresented.Name;
+ public override string DiagnosticName => _methodRepresented.DiagnosticName;
public override MethodSignature Signature
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.ValueTypeMethods.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.ValueTypeMethods.cs
similarity index 97%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.ValueTypeMethods.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.ValueTypeMethods.cs
index f44bf4b11cf8e2..738b43554182c8 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.ValueTypeMethods.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.ValueTypeMethods.cs
@@ -3,13 +3,14 @@
using System.Collections.Generic;
+using Internal.TypeSystem;
using Internal.IL.Stubs;
using Debug = System.Diagnostics.Debug;
-namespace Internal.TypeSystem
+namespace ILCompiler
{
- public abstract partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
private MethodDesc _objectEqualsMethod;
@@ -154,7 +155,7 @@ private bool ComputeCanCompareValueTypeBits(MetadataType type)
// Would be a suprise if this wasn't a valuetype. We checked ContainsGCPointers above.
Debug.Assert(fieldType.IsValueType);
- MethodDesc objectEqualsMethod = fieldType.Context._objectEqualsMethod;
+ MethodDesc objectEqualsMethod = ((CompilerTypeSystemContext)fieldType.Context)._objectEqualsMethod;
// If the field overrides Equals, we can't use the fast helper because we need to call the method.
if (fieldType.FindVirtualFunctionTargetMethodOnObjectType(objectEqualsMethod).OwningType == fieldType)
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DelegateCreationInfo.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DelegateCreationInfo.cs
index 0195f82d6c3692..dc6cd81fcccf5d 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DelegateCreationInfo.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DelegateCreationInfo.cs
@@ -161,7 +161,7 @@ private DelegateCreationInfo(IMethodNode constructor, MethodDesc targetMethod, T
///
public static DelegateCreationInfo Create(TypeDesc delegateType, MethodDesc targetMethod, NodeFactory factory, bool followVirtualDispatch)
{
- TypeSystemContext context = delegateType.Context;
+ CompilerTypeSystemContext context = factory.TypeSystemContext;
DefType systemDelegate = context.GetWellKnownType(WellKnownType.MulticastDelegate).BaseType;
int paramCountTargetMethod = targetMethod.Signature.Length;
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/CallingConventionConverterKey.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/CallingConventionConverterKey.cs
index 7c94539fb6bb42..40b7281dbba01b 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/CallingConventionConverterKey.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/CallingConventionConverterKey.cs
@@ -78,4 +78,156 @@ public static string GetName(this MethodSignature signature)
return nameBuilder.ToString();
}
}
+
+ public class UniqueTypeNameFormatter : TypeNameFormatter
+ {
+ public static UniqueTypeNameFormatter Instance { get; } = new UniqueTypeNameFormatter();
+
+ public override void AppendName(StringBuilder sb, PointerType type)
+ {
+ AppendName(sb, type.ParameterType);
+ sb.Append('*');
+ }
+
+ public override void AppendName(StringBuilder sb, GenericParameterDesc type)
+ {
+ string prefix = type.Kind == GenericParameterKind.Type ? "!" : "!!";
+ sb.Append(prefix);
+ sb.Append(type.Name);
+ }
+
+ public override void AppendName(StringBuilder sb, SignatureTypeVariable type)
+ {
+ sb.Append("!");
+ sb.Append(type.Index.ToStringInvariant());
+ }
+
+ public override void AppendName(StringBuilder sb, SignatureMethodVariable type)
+ {
+ sb.Append("!!");
+ sb.Append(type.Index.ToStringInvariant());
+ }
+
+ public override void AppendName(StringBuilder sb, FunctionPointerType type)
+ {
+ MethodSignature signature = type.Signature;
+
+ AppendName(sb, signature.ReturnType);
+
+ sb.Append(" (");
+ for (int i = 0; i < signature.Length; i++)
+ {
+ if (i > 0)
+ sb.Append(", ");
+ AppendName(sb, signature[i]);
+ }
+
+ // TODO: Append '...' for vararg methods
+
+ sb.Append(')');
+ }
+
+ public override void AppendName(StringBuilder sb, ByRefType type)
+ {
+ AppendName(sb, type.ParameterType);
+ sb.Append(" ByRef");
+ }
+
+ public override void AppendName(StringBuilder sb, ArrayType type)
+ {
+ AppendName(sb, type.ElementType);
+ sb.Append('[');
+
+ if (type.Rank == 1 && type.IsMdArray)
+ sb.Append('*');
+ sb.Append(',', type.Rank - 1);
+
+ sb.Append(']');
+ }
+
+ protected override void AppendNameForInstantiatedType(StringBuilder sb, DefType type)
+ {
+ AppendName(sb, type.GetTypeDefinition());
+ sb.Append('<');
+
+ for (int i = 0; i < type.Instantiation.Length; i++)
+ {
+ if (i > 0)
+ sb.Append(", ");
+ AppendName(sb, type.Instantiation[i]);
+ }
+
+ sb.Append('>');
+ }
+
+ protected override void AppendNameForNamespaceType(StringBuilder sb, DefType type)
+ {
+ string ns = GetTypeNamespace(type);
+ if (ns.Length > 0)
+ {
+ AppendEscapedIdentifier(sb, ns);
+ sb.Append('.');
+ }
+ AppendEscapedIdentifier(sb, GetTypeName(type));
+
+ if (type is MetadataType)
+ {
+ IAssemblyDesc homeAssembly = ((MetadataType)type).Module as IAssemblyDesc;
+ AppendAssemblyName(sb, homeAssembly);
+ }
+ }
+
+ private void AppendAssemblyName(StringBuilder sb, IAssemblyDesc assembly)
+ {
+ if (assembly == null)
+ return;
+
+ sb.Append(',');
+ AppendEscapedIdentifier(sb, assembly.GetName().Name);
+ }
+
+ protected override void AppendNameForNestedType(StringBuilder sb, DefType nestedType, DefType containingType)
+ {
+ AppendName(sb, containingType);
+
+ sb.Append('+');
+
+ string ns = GetTypeNamespace(nestedType);
+ if (ns.Length > 0)
+ {
+ AppendEscapedIdentifier(sb, ns);
+ sb.Append('.');
+ }
+ AppendEscapedIdentifier(sb, GetTypeName(nestedType));
+ }
+
+ private string GetTypeName(DefType type)
+ {
+ return type.Name;
+ }
+
+ private string GetTypeNamespace(DefType type)
+ {
+ return type.Namespace;
+ }
+
+ private static char[] s_escapedChars = new char[] { ',', '=', '"', ']', '[', '*', '&', '+', '\\' };
+ private void AppendEscapedIdentifier(StringBuilder sb, string identifier)
+ {
+ if (identifier.IndexOfAny(s_escapedChars) < 0)
+ {
+ string escapedIdentifier = identifier;
+ foreach (char escapedChar in s_escapedChars)
+ {
+ string escapedCharString = new string(escapedChar, 1);
+ escapedIdentifier = escapedIdentifier.Replace(escapedCharString, "\\" + escapedCharString);
+ }
+ sb.Append(escapedIdentifier);
+ }
+ else
+ {
+ sb.Append(identifier);
+ }
+ }
+ }
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FatFunctionPointerNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FatFunctionPointerNode.cs
index 9873fb76c78370..2dd04047e594e0 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FatFunctionPointerNode.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FatFunctionPointerNode.cs
@@ -35,7 +35,7 @@ public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb)
}
int ISymbolDefinitionNode.Offset => 0;
- int ISymbolNode.Offset => Method.Context.Target.FatFunctionPointerOffset;
+ int ISymbolNode.Offset => Method.Context.Target.Architecture == TargetArchitecture.Wasm32 ? 1 << 31 : 2;
public override bool IsShareable => true;
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs
index e10bbe95f07971..ae9e60343dfb42 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs
@@ -4,18 +4,18 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
-using System.Threading;
+using System.Threading.Tasks;
using ILCompiler.DependencyAnalysis;
using ILCompiler.DependencyAnalysisFramework;
using Internal.IL;
using Internal.IL.Stubs;
+using Internal.JitInterface;
using Internal.TypeSystem;
using Internal.ReadyToRunConstants;
using Debug = System.Diagnostics.Debug;
-using Internal.JitInterface;
namespace ILCompiler
{
@@ -26,8 +26,7 @@ namespace ILCompiler
///
internal sealed class ILScanner : Compilation, IILScanner
{
- private CountdownEvent _compilationCountdown;
- private readonly bool _singleThreaded;
+ private readonly int _parallelism;
internal ILScanner(
DependencyAnalyzerBase dependencyGraph,
@@ -36,11 +35,11 @@ internal ILScanner(
ILProvider ilProvider,
DebugInformationProvider debugInformationProvider,
Logger logger,
- bool singleThreaded)
+ int parallelism)
: base(dependencyGraph, nodeFactory, roots, ilProvider, debugInformationProvider, null, nodeFactory.CompilationModuleGroup, logger)
{
_helperCache = new HelperCache(this);
- _singleThreaded = singleThreaded;
+ _parallelism = parallelism;
}
protected override void CompileInternal(string outputFile, ObjectDumper dumper)
@@ -78,7 +77,7 @@ protected override void ComputeDependencyNodeDependencies(List methodsToCompile)
Logger.Writer.WriteLine($"Scanning {methodsToCompile.Count} methods...");
}
- WaitCallback compileSingleMethodDelegate = m => CompileSingleMethod((ScannedMethodNode)m);
-
- using (_compilationCountdown = new CountdownEvent(methodsToCompile.Count))
- {
- foreach (ScannedMethodNode methodCodeNodeNeedingCode in methodsToCompile)
- {
- ThreadPool.QueueUserWorkItem(compileSingleMethodDelegate, methodCodeNodeNeedingCode);
- }
-
- _compilationCountdown.Wait();
- _compilationCountdown = null;
- }
+ Parallel.ForEach(
+ methodsToCompile,
+ new ParallelOptions { MaxDegreeOfParallelism = _parallelism },
+ CompileSingleMethod);
}
private void CompileSingleThreaded(List methodsToCompile)
@@ -142,11 +133,6 @@ private void CompileSingleMethod(ScannedMethodNode methodCodeNodeNeedingCode)
{
throw new CodeGenerationFailedException(method, ex);
}
- finally
- {
- if (_compilationCountdown != null)
- _compilationCountdown.Signal();
- }
}
ILScanResults IILScanner.Scan()
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScannerBuilder.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScannerBuilder.cs
index 27e7e64b6ce193..cf784d458dde24 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScannerBuilder.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScannerBuilder.cs
@@ -27,7 +27,7 @@ public sealed class ILScannerBuilder
private IEnumerable _compilationRoots = Array.Empty();
private MetadataManager _metadataManager;
private InteropStubManager _interopStubManager = new EmptyInteropStubManager();
- private bool _singleThreaded;
+ private int _parallelism = -1;
internal ILScannerBuilder(CompilerTypeSystemContext context, CompilationModuleGroup compilationGroup, NameMangler mangler, ILProvider ilProvider, PreinitializationManager preinitializationManager)
{
@@ -63,9 +63,9 @@ public ILScannerBuilder UseInteropStubManager(InteropStubManager interopStubMana
return this;
}
- public ILScannerBuilder UseSingleThread(bool enable)
+ public ILScannerBuilder UseParallelism(int parallelism)
{
- _singleThreaded = enable;
+ _parallelism = parallelism;
return this;
}
@@ -74,7 +74,7 @@ public IILScanner ToILScanner()
var nodeFactory = new ILScanNodeFactory(_context, _compilationGroup, _metadataManager, _interopStubManager, _nameMangler, _preinitializationManager);
DependencyAnalyzerBase graph = _dependencyTrackingLevel.CreateDependencyGraph(nodeFactory);
- return new ILScanner(graph, nodeFactory, _compilationRoots, _ilProvider, new NullDebugInformationProvider(), _logger, _singleThreaded);
+ return new ILScanner(graph, nodeFactory, _compilationRoots, _ilProvider, new NullDebugInformationProvider(), _logger, _parallelism);
}
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs
index 47b1ce7e1d05c0..378af488af0208 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs
@@ -34,18 +34,69 @@ public bool FormsCycle(TypeSystemEntity owner)
TypeDesc ownerType = (owner as EcmaMethod)?.OwningType;
return _entitiesInCycles.Contains(owner) || (ownerType != null && _entitiesInCycles.Contains(ownerType));
}
+ }
+
+ private class CycleInfoHashtable : LockFreeReaderHashtable
+ {
+ protected override bool CompareKeyToValue(EcmaModule key, ModuleCycleInfo value) => key == value.Module;
+ protected override bool CompareValueToValue(ModuleCycleInfo value1, ModuleCycleInfo value2) => value1.Module == value2.Module;
+ protected override int GetKeyHashCode(EcmaModule key) => key.GetHashCode();
+ protected override int GetValueHashCode(ModuleCycleInfo value) => value.Module.GetHashCode();
+
+ protected override ModuleCycleInfo CreateValueFromKey(EcmaModule key)
+ {
+ GraphBuilder gb = new GraphBuilder(key);
+ Graph graph = gb.Graph;
+
+ var formalsNeedingLazyGenerics = graph.ComputeVerticesInvolvedInAFlaggedCycle();
+ var entitiesNeedingLazyGenerics = new HashSet();
+
+ foreach (EcmaGenericParameter formal in formalsNeedingLazyGenerics)
+ {
+ var formalDefinition = key.MetadataReader.GetGenericParameter(formal.Handle);
+ if (formal.Kind == GenericParameterKind.Type)
+ {
+ entitiesNeedingLazyGenerics.Add(key.GetType(formalDefinition.Parent));
+ }
+ else
+ {
+ entitiesNeedingLazyGenerics.Add(key.GetMethod(formalDefinition.Parent));
+ }
+ }
+
+ return new ModuleCycleInfo(key, entitiesNeedingLazyGenerics);
+ }
+ }
+
+ internal class GenericCycleDetector
+ {
+ private readonly CycleInfoHashtable _hashtable = new CycleInfoHashtable();
+
+ private readonly struct EntityPair : IEquatable
+ {
+ public readonly TypeSystemEntity Owner;
+ public readonly TypeSystemEntity Referent;
+ public EntityPair(TypeSystemEntity owner, TypeSystemEntity referent)
+ => (Owner, Referent) = (owner, referent);
+ public bool Equals(EntityPair other) => Owner == other.Owner && Referent == other.Referent;
+ public override bool Equals(object obj) => obj is EntityPair p && Equals(p);
+ public override int GetHashCode() => HashCode.Combine(Owner.GetHashCode(), Referent.GetHashCode());
+ }
+
+ // This is a set of entities that had actual problems that caused us to abort compilation
+ // somewhere.
+ // Would prefer this to be a ConcurrentHashSet but there isn't any. ModuleCycleInfo can be looked up
+ // from the key, but since this is a key/value pair, might as well use the value too...
+ private readonly ConcurrentDictionary _actualProblems = new ConcurrentDictionary();
+
+ private readonly int _cutoffPoint;
+
+ public GenericCycleDetector(int cutoffPoint)
+ {
+ _cutoffPoint = cutoffPoint;
+ }
- // Chosen rather arbitrarily. For the app that I was looking at, cutoff point of 7 compiled
- // more than 10 minutes on a release build of the compiler, and I lost patience.
- // Cutoff point of 5 produced an 1.7 GB object file.
- // Cutoff point of 4 produced an 830 MB object file.
- // Cutoff point of 3 produced an 470 MB object file.
- // We want this to be high enough so that it doesn't cut off too early. But also not too
- // high because things that are recursive often end up expanding laterally as well
- // through various other generic code the deep code calls into.
- private const int CutoffPoint = 4;
-
- public bool IsDeepPossiblyCyclicInstantiation(TypeSystemEntity entity)
+ private bool IsDeepPossiblyCyclicInstantiation(TypeSystemEntity entity)
{
if (entity is TypeDesc type)
{
@@ -57,7 +108,7 @@ public bool IsDeepPossiblyCyclicInstantiation(TypeSystemEntity entity)
}
}
- public bool IsDeepPossiblyCyclicInstantiation(TypeDesc type, List seenTypes = null)
+ private bool IsDeepPossiblyCyclicInstantiation(TypeDesc type, List seenTypes = null)
{
switch (type.Category)
{
@@ -80,7 +131,7 @@ public bool IsDeepPossiblyCyclicInstantiation(TypeDesc type, List seen
count++;
}
- if (count > CutoffPoint)
+ if (count > _cutoffPoint)
{
return true;
}
@@ -112,60 +163,6 @@ public bool IsDeepPossiblyCyclicInstantiation(MethodDesc method)
{
return IsDeepPossiblyCyclicInstantiation(method.Instantiation) || IsDeepPossiblyCyclicInstantiation(method.OwningType);
}
- }
-
- private class CycleInfoHashtable : LockFreeReaderHashtable
- {
- protected override bool CompareKeyToValue(EcmaModule key, ModuleCycleInfo value) => key == value.Module;
- protected override bool CompareValueToValue(ModuleCycleInfo value1, ModuleCycleInfo value2) => value1.Module == value2.Module;
- protected override int GetKeyHashCode(EcmaModule key) => key.GetHashCode();
- protected override int GetValueHashCode(ModuleCycleInfo value) => value.Module.GetHashCode();
-
- protected override ModuleCycleInfo CreateValueFromKey(EcmaModule key)
- {
- GraphBuilder gb = new GraphBuilder(key);
- Graph graph = gb.Graph;
-
- var formalsNeedingLazyGenerics = graph.ComputeVerticesInvolvedInAFlaggedCycle();
- var entitiesNeedingLazyGenerics = new HashSet();
-
- foreach (EcmaGenericParameter formal in formalsNeedingLazyGenerics)
- {
- var formalDefinition = key.MetadataReader.GetGenericParameter(formal.Handle);
- if (formal.Kind == GenericParameterKind.Type)
- {
- entitiesNeedingLazyGenerics.Add(key.GetType(formalDefinition.Parent));
- }
- else
- {
- entitiesNeedingLazyGenerics.Add(key.GetMethod(formalDefinition.Parent));
- }
- }
-
- return new ModuleCycleInfo(key, entitiesNeedingLazyGenerics);
- }
- }
-
- internal class GenericCycleDetector
- {
- private readonly CycleInfoHashtable _hashtable = new CycleInfoHashtable();
-
- private readonly struct EntityPair : IEquatable
- {
- public readonly TypeSystemEntity Owner;
- public readonly TypeSystemEntity Referent;
- public EntityPair(TypeSystemEntity owner, TypeSystemEntity referent)
- => (Owner, Referent) = (owner, referent);
- public bool Equals(EntityPair other) => Owner == other.Owner && Referent == other.Referent;
- public override bool Equals(object obj) => obj is EntityPair p && Equals(p);
- public override int GetHashCode() => HashCode.Combine(Owner.GetHashCode(), Referent.GetHashCode());
- }
-
- // This is a set of entities that had actual problems that caused us to abort compilation
- // somewhere.
- // Would prefer this to be a ConcurrentHashSet but there isn't any. ModuleCycleInfo can be looked up
- // from the key, but since this is a key/value pair, might as well use the value too...
- private readonly ConcurrentDictionary _actualProblems = new ConcurrentDictionary();
public void DetectCycle(TypeSystemEntity owner, TypeSystemEntity referent)
{
@@ -196,7 +193,7 @@ public void DetectCycle(TypeSystemEntity owner, TypeSystemEntity referent)
{
// Just the presence of a cycle is not a problem, but once we start getting too deep,
// we need to cut our losses.
- if (cycleInfo.IsDeepPossiblyCyclicInstantiation(referent))
+ if (IsDeepPossiblyCyclicInstantiation(referent))
{
_actualProblems.TryAdd(new EntityPair(owner, referent), cycleInfo);
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MultiFileCompilationModuleGroup.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MultiFileCompilationModuleGroup.cs
index 9f93ae3ea87a13..a7c4b27afd274f 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MultiFileCompilationModuleGroup.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MultiFileCompilationModuleGroup.cs
@@ -15,7 +15,7 @@ public abstract class MultiFileCompilationModuleGroup : CompilationModuleGroup
{
private HashSet _compilationModuleSet;
- public MultiFileCompilationModuleGroup(TypeSystemContext context, IEnumerable compilationModuleSet)
+ public MultiFileCompilationModuleGroup(CompilerTypeSystemContext context, IEnumerable compilationModuleSet)
{
_compilationModuleSet = new HashSet(compilationModuleSet);
@@ -94,7 +94,7 @@ public override bool CanHaveReferenceThroughImportTable
///
public class MultiFileSharedCompilationModuleGroup : MultiFileCompilationModuleGroup
{
- public MultiFileSharedCompilationModuleGroup(TypeSystemContext context, IEnumerable compilationModuleSet)
+ public MultiFileSharedCompilationModuleGroup(CompilerTypeSystemContext context, IEnumerable compilationModuleSet)
: base(context, compilationModuleSet)
{
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs
index d4b53340b55301..ed40a5f6fcc75c 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs
@@ -54,6 +54,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "SetAppContextSwitches";
+ }
+ }
+
public override MethodIL EmitIL()
{
ILEmitter emitter = new ILEmitter();
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs
index 7138804bb23138..4240af2427d154 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs
@@ -48,6 +48,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "NativeLibraryStartup";
+ }
+ }
+
public override MethodIL EmitIL()
{
ILEmitter emitter = new ILEmitter();
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs
index b18b9435491343..2c91f888c4dc05 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs
@@ -53,6 +53,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "StartupCodeMain";
+ }
+ }
+
public override MethodIL EmitIL()
{
ILEmitter emitter = new ILEmitter();
@@ -229,6 +237,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "MainMethodWrapper";
+ }
+ }
+
public override MethodSignature Signature
{
get
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj b/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj
index 3273d2cc58f567..3420564b0715ef 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj
@@ -23,6 +23,147 @@
+
+ IL\DelegateInfo.cs
+
+
+ IL\Stubs\DelegateThunks.Sorting.cs
+
+
+ IL\Stubs\DynamicInvokeMethodThunk.cs
+
+
+ IL\Stubs\DynamicInvokeMethodThunk.Sorting.cs
+
+
+ IL\Stubs\EnumThunks.cs
+
+
+ IL\Stubs\EnumThunks.Sorting.cs
+
+
+ IL\Stubs\PInvokeLazyFixupField.cs
+
+
+ IL\Stubs\PInvokeLazyFixupField.Sorting.cs
+
+
+ IL\Stubs\StructMarshallingThunk.Sorting.cs
+
+
+ IL\Stubs\ValueTypeGetFieldHelperMethodOverride.cs
+
+
+ IL\Stubs\ValueTypeGetFieldHelperMethodOverride.Sorting.cs
+
+
+ TypeSystem\Interop\IL\InlineArrayType.Sorting.cs
+
+
+ Interop\IL\MarshalHelpers.cs
+
+
+ Interop\IL\MarshalHelpers.Aot.cs
+
+
+ Interop\IL\MarshalUtils.cs
+
+
+ Interop\IL\Marshaller.cs
+
+
+ Interop\IL\Marshaller.Aot.cs
+
+
+ Interop\IL\MarshallerKind.cs
+
+
+ TypeSystem\Interop\IL\NativeStructType.Sorting.cs
+
+
+ Interop\IL\PInvokeILEmitterConfiguration.cs
+
+
+ IL\Stubs\PInvokeILEmitter.cs
+
+
+ IL\Stubs\PInvokeILCodeStreams.cs
+
+
+ IL\Stubs\DebuggerSteppingHelpers.cs
+
+
+ IL\Stubs\CalliMarshallingMethodThunk.cs
+
+
+ IL\Stubs\CalliMarshallingMethodThunk.Mangling.cs
+
+
+ IL\Stubs\CalliMarshallingMethodThunk.Sorting.cs
+
+
+ IL\Stubs\DelegateMarshallingMethodThunk.cs
+
+
+ IL\Stubs\DelegateMarshallingMethodThunk.Mangling.cs
+
+
+ IL\Stubs\DelegateMarshallingMethodThunk.Sorting.cs
+
+
+ IL\Stubs\ForwardDelegateCreationThunk.cs
+
+
+ IL\Stubs\ForwardDelegateCreationThunk.Mangling.cs
+
+
+ IL\Stubs\ForwardDelegateCreationThunk.Sorting.cs
+
+
+ IL\Stubs\DelegateThunks.cs
+
+
+ IL\Stubs\StructMarshallingThunk.cs
+
+
+ IL\Stubs\StructMarshallingThunk.Mangling.cs
+
+
+ TypeSystem\Interop\IL\NativeStructType.cs
+
+
+ TypeSystem\Interop\IL\NativeStructType.Mangling.cs
+
+
+ TypeSystem\Interop\IL\PInvokeDelegateWrapper.cs
+
+
+ TypeSystem\Interop\IL\PInvokeDelegateWrapper.Mangling.cs
+
+
+ TypeSystem\Interop\IL\PInvokeDelegateWrapper.Sorting.cs
+
+
+ TypeSystem\Interop\IL\PInvokeDelegateWrapperConstructor.cs
+
+
+ TypeSystem\Interop\IL\PInvokeDelegateWrapperConstructor.Sorting.cs
+
+
+ TypeSystem\Interop\IL\InlineArrayType.cs
+
+
+ TypeSystem\Interop\InteropTypes.cs
+
+
+ TypeSystem\Interop\InteropStateManager.cs
+
+
+ TypeSystem\CodeGen\INonEmittableType.cs
+
+
+ TypeSystem\CodeGen\NativeStructType.CodeGen.cs
+
Compiler\Logging\CompilerGeneratedState.cs
@@ -179,6 +320,12 @@
+
+
+
+
+
+
diff --git a/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj b/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj
index 8fe3bd1982d475..97c97bb7de720d 100644
--- a/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj
@@ -18,7 +18,7 @@
-
+
diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs
index 34aced76b44b01..8f468f78b39771 100644
--- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs
+++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs
@@ -33,7 +33,6 @@ public sealed class ReadyToRunCodegenCompilationBuilder : CompilationBuilder
private string _perfMapPath;
private int _perfMapFormatVersion;
private bool _generateProfileFile;
- private int _parallelism;
Func _printReproInstructions;
private InstructionSetSupport _instructionSetSupport;
private ProfileDataManager _profileData;
@@ -170,12 +169,6 @@ public ReadyToRunCodegenCompilationBuilder UseProfileFile(bool generateProfileFi
return this;
}
- public ReadyToRunCodegenCompilationBuilder UseParallelism(int parallelism)
- {
- _parallelism = parallelism;
- return this;
- }
-
public ReadyToRunCodegenCompilationBuilder UsePrintReproInstructions(Func printReproInstructions)
{
_printReproInstructions = printReproInstructions;
diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj
index 40f19bfefc78a5..5154db358a8b8e 100644
--- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj
@@ -20,7 +20,7 @@
-
+
@@ -44,6 +44,7 @@
+
diff --git a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj
index 86644068f3c172..b57b5be6d076bb 100644
--- a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj
@@ -31,6 +31,6 @@
-
+
diff --git a/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs b/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs
index e794bdd1a94790..0d8b11c51f82e2 100644
--- a/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs
+++ b/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs
@@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
+using System.Threading.Tasks;
using ILCompiler.DependencyAnalysis;
using ILCompiler.DependencyAnalysisFramework;
@@ -21,10 +22,10 @@ public sealed class RyuJitCompilation : Compilation
private readonly ConditionalWeakTable _corinfos = new ConditionalWeakTable();
internal readonly RyuJitCompilationOptions _compilationOptions;
private readonly ExternSymbolMappedField _hardwareIntrinsicFlags;
- private CountdownEvent _compilationCountdown;
private readonly Dictionary _instructionSetMap;
private readonly ProfileDataManager _profileDataManager;
private readonly MethodImportationErrorProvider _methodImportationErrorProvider;
+ private readonly int _parallelism;
public InstructionSetSupport InstructionSetSupport { get; }
@@ -40,7 +41,8 @@ internal RyuJitCompilation(
InstructionSetSupport instructionSetSupport,
ProfileDataManager profileDataManager,
MethodImportationErrorProvider errorProvider,
- RyuJitCompilationOptions options)
+ RyuJitCompilationOptions options,
+ int parallelism)
: base(dependencyGraph, nodeFactory, roots, ilProvider, debugInformationProvider, devirtualizationManager, inliningPolicy, logger)
{
_compilationOptions = options;
@@ -59,6 +61,8 @@ internal RyuJitCompilation(
_profileDataManager = profileDataManager;
_methodImportationErrorProvider = errorProvider;
+
+ _parallelism = parallelism;
}
public ProfileDataManager ProfileData => _profileDataManager;
@@ -125,7 +129,7 @@ protected override void ComputeDependencyNodeDependencies(List methodsToCompile)
Logger.Writer.WriteLine($"Compiling {methodsToCompile.Count} methods...");
}
- WaitCallback compileSingleMethodDelegate = m =>
- {
- CorInfoImpl corInfo = _corinfos.GetValue(Thread.CurrentThread, thread => new CorInfoImpl(this));
- CompileSingleMethod(corInfo, (MethodCodeNode)m);
- };
-
- using (_compilationCountdown = new CountdownEvent(methodsToCompile.Count))
- {
-
- foreach (MethodCodeNode methodCodeNodeNeedingCode in methodsToCompile)
- {
- ThreadPool.QueueUserWorkItem(compileSingleMethodDelegate, methodCodeNodeNeedingCode);
- }
-
- _compilationCountdown.Wait();
- _compilationCountdown = null;
- }
+ Parallel.ForEach(
+ methodsToCompile,
+ new ParallelOptions { MaxDegreeOfParallelism = _parallelism },
+ CompileSingleMethod);
}
@@ -176,52 +167,50 @@ private void CompileSingleThreaded(List methodsToCompile)
}
}
+ private void CompileSingleMethod(MethodCodeNode methodCodeNodeNeedingCode)
+ {
+ CorInfoImpl corInfo = _corinfos.GetValue(Thread.CurrentThread, thread => new CorInfoImpl(this));
+ CompileSingleMethod(corInfo, methodCodeNodeNeedingCode);
+ }
+
private void CompileSingleMethod(CorInfoImpl corInfo, MethodCodeNode methodCodeNodeNeedingCode)
{
- try
- {
- MethodDesc method = methodCodeNodeNeedingCode.Method;
+ MethodDesc method = methodCodeNodeNeedingCode.Method;
- TypeSystemException exception = _methodImportationErrorProvider.GetCompilationError(method);
+ TypeSystemException exception = _methodImportationErrorProvider.GetCompilationError(method);
- // If we previously failed to import the method, do not try to import it again and go
- // directly to the error path.
- if (exception == null)
+ // If we previously failed to import the method, do not try to import it again and go
+ // directly to the error path.
+ if (exception == null)
+ {
+ try
{
- try
- {
- corInfo.CompileMethod(methodCodeNodeNeedingCode);
- }
- catch (TypeSystemException ex)
- {
- exception = ex;
- }
+ corInfo.CompileMethod(methodCodeNodeNeedingCode);
}
-
- if (exception != null)
+ catch (TypeSystemException ex)
{
- // TODO: fail compilation if a switch was passed
-
- // Try to compile the method again, but with a throwing method body this time.
- MethodIL throwingIL = TypeSystemThrowingILEmitter.EmitIL(method, exception);
- corInfo.CompileMethod(methodCodeNodeNeedingCode, throwingIL);
-
- if (exception is TypeSystemException.InvalidProgramException
- && method.OwningType is MetadataType mdOwningType
- && mdOwningType.HasCustomAttribute("System.Runtime.InteropServices", "ClassInterfaceAttribute"))
- {
- Logger.LogWarning("COM interop is not supported with full ahead of time compilation", 3052, method, MessageSubCategory.AotAnalysis);
- }
- else
- {
- Logger.LogWarning($"Method will always throw because: {exception.Message}", 1005, method, MessageSubCategory.AotAnalysis);
- }
+ exception = ex;
}
}
- finally
+
+ if (exception != null)
{
- if (_compilationCountdown != null)
- _compilationCountdown.Signal();
+ // TODO: fail compilation if a switch was passed
+
+ // Try to compile the method again, but with a throwing method body this time.
+ MethodIL throwingIL = TypeSystemThrowingILEmitter.EmitIL(method, exception);
+ corInfo.CompileMethod(methodCodeNodeNeedingCode, throwingIL);
+
+ if (exception is TypeSystemException.InvalidProgramException
+ && method.OwningType is MetadataType mdOwningType
+ && mdOwningType.HasCustomAttribute("System.Runtime.InteropServices", "ClassInterfaceAttribute"))
+ {
+ Logger.LogWarning("COM interop is not supported with full ahead of time compilation", 3052, method, MessageSubCategory.AotAnalysis);
+ }
+ else
+ {
+ Logger.LogWarning($"Method will always throw because: {exception.Message}", 1005, method, MessageSubCategory.AotAnalysis);
+ }
}
}
@@ -252,7 +241,6 @@ public override MethodIL GetMethodIL(MethodDesc method)
public enum RyuJitCompilationOptions
{
MethodBodyFolding = 0x1,
- SingleThreadedCompilation = 0x2,
- ControlFlowGuardAnnotations = 0x4,
+ ControlFlowGuardAnnotations = 0x2,
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilationBuilder.cs b/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilationBuilder.cs
index 162f1a39e86bbc..8b753c71039942 100644
--- a/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilationBuilder.cs
+++ b/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilationBuilder.cs
@@ -107,9 +107,6 @@ public override ICompilation ToCompilation()
if (_methodBodyFolding)
options |= RyuJitCompilationOptions.MethodBodyFolding;
- if (_singleThreaded)
- options |= RyuJitCompilationOptions.SingleThreadedCompilation;
-
if ((_mitigationOptions & SecurityMitigationOptions.ControlFlowGuardAnnotations) != 0)
options |= RyuJitCompilationOptions.ControlFlowGuardAnnotations;
@@ -117,7 +114,7 @@ public override ICompilation ToCompilation()
JitConfigProvider.Initialize(_context.Target, jitFlagBuilder.ToArray(), _ryujitOptions);
DependencyAnalyzerBase graph = CreateDependencyGraph(factory, new ObjectNode.ObjectNodeComparer(new CompilerComparer()));
- return new RyuJitCompilation(graph, factory, _compilationRoots, _ilProvider, _debugInformationProvider, _logger, _devirtualizationManager, _inliningPolicy ?? _compilationGroup, _instructionSetSupport, _profileDataManager, _methodImportationErrorProvider, options);
+ return new RyuJitCompilation(graph, factory, _compilationRoots, _ilProvider, _debugInformationProvider, _logger, _devirtualizationManager, _inliningPolicy ?? _compilationGroup, _instructionSetSupport, _profileDataManager, _methodImportationErrorProvider, options, _parallelism);
}
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.RyuJit/ILCompiler.RyuJit.csproj b/src/coreclr/tools/aot/ILCompiler.RyuJit/ILCompiler.RyuJit.csproj
index efff02a77708c0..cecc90d6da81b0 100644
--- a/src/coreclr/tools/aot/ILCompiler.RyuJit/ILCompiler.RyuJit.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.RyuJit/ILCompiler.RyuJit.csproj
@@ -3,7 +3,7 @@
LibraryILCompilerILCompiler.RyuJit
- net5.0
+ net6.0truefalsex64;x86
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj b/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj
deleted file mode 100644
index 86b9c06a6cf0d2..00000000000000
--- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj
+++ /dev/null
@@ -1,647 +0,0 @@
-
-
- Library
- Internal.TypeSystem
- ILCompiler.TypeSystem.ReadyToRun
- true
- netstandard2.0
- false
- x64;x86
- AnyCPU
- false
- true
- $(DefineConstants);DISABLE_UNMANAGED_PDB_SYMBOLS
-
-
- false
- Debug;Release;Checked
-
-
-
-
- Internal.TypeSystem.Strings.resources
-
-
-
-
-
- $(SystemReflectionMetadataVersion)
-
-
- 1.3.0
-
-
-
-
- TypeSystem\Common\ArrayMethod.Diagnostic.cs
-
-
- TypeSystem\Canon\ArrayType.Canon.cs
-
-
- TypeSystem\Canon\ByRefType.Canon.cs
-
-
- TypeSystem\Canon\CanonTypes.cs
-
-
- TypeSystem\Canon\CanonTypes.Diagnostic.cs
-
-
- TypeSystem\Canon\CanonTypes.Interop.cs
-
-
- TypeSystem\Canon\CanonTypes.Sorting.cs
-
-
- TypeSystem\Canon\FunctionPointerType.Canon.cs
-
-
- TypeSystem\Canon\GenericParameterDesc.Canon.cs
-
-
- TypeSystem\Canon\StandardCanonicalizationAlgorithm.cs
-
-
- TypeSystem\Canon\DefType.Canon.cs
-
-
- TypeSystem\Canon\InstantiatedMethod.Canon.cs
-
-
- TypeSystem\Canon\InstantiatedType.Canon.cs
-
-
- TypeSystem\Canon\MetadataType.Canon.cs
-
-
- TypeSystem\Canon\MethodDelegator.Canon.cs
-
-
- TypeSystem\Canon\MethodDesc.Canon.cs
-
-
- TypeSystem\Canon\MethodForInstantiatedType.Canon.cs
-
-
- TypeSystem\Canon\ParameterizedType.Canon.cs
-
-
- TypeSystem\Canon\PointerType.Canon.cs
-
-
- TypeSystem\Canon\SignatureVariable.Canon.cs
-
-
- TypeSystem\Canon\TypeDesc.Canon.cs
-
-
- TypeSystem\Canon\TypeSystemContext.Canon.cs
-
-
- TypeSystem\CodeGen\FieldDesc.CodeGen.cs
-
-
- TypeSystem\CodeGen\MethodDelegator.CodeGen.cs
-
-
- TypeSystem\CodeGen\MethodDesc.CodeGen.cs
-
-
- TypeSystem\CodeGen\TargetDetails.CodeGen.cs
-
-
- TypeSystem\CodeGen\TypeDesc.CodeGen.cs
-
-
- Utilities\AlignmentHelper.cs
-
-
- Utilities\ArrayOfTRuntimeInterfacesAlgorithm.cs
-
-
- TypeSystem\Common\CastingHelper.cs
-
-
- TypeSystem\Common\ConstructedTypeRewritingHelpers.cs
-
-
- TypeSystem\Common\ExplicitLayoutValidator.cs
-
-
- TypeSystem\Common\FunctionPointerType.cs
-
-
- TypeSystem\Common\IAssemblyDesc.cs
-
-
- TypeSystem\Common\IModuleResolver.cs
-
-
- TypeSystem\Common\Instantiation.cs
-
-
- TypeSystem\Common\ModuleDesc.cs
-
-
- TypeSystem\Common\NotFoundBehavior.cs
-
-
- TypeSystem\Common\ResolutionFailure.cs
-
-
- TypeSystem\Common\TypeSystemEntity.cs
-
-
- TypeSystem\Common\TypeSystemException.cs
-
-
- TypeSystem\Common\TypeSystemException.Resources.cs
-
-
- TypeSystem\Common\ThrowHelper.cs
-
-
- TypeSystem\Common\ThrowHelper.Common.cs
-
-
- TypeSystem\Common\UniversalCanonLayoutAlgorithm.cs
-
-
- Utilities\CustomAttributeTypeNameFormatter.cs
-
-
- Utilities\CustomAttributeTypeNameParser.cs
-
-
- Utilities\GCPointerMap.Algorithm.cs
-
-
- Utilities\GCPointerMap.cs
-
-
- Utilities\DebugNameFormatter.cs
-
-
- Utilities\LockFreeReaderHashtable.cs
-
-
- TypeSystem\Common\ArrayType.cs
-
-
- TypeSystem\Common\BaseTypeRuntimeInterfacesAlgorithm.cs
-
-
- TypeSystem\Common\ByRefType.cs
-
-
- TypeSystem\Common\GenericParameterDesc.cs
-
-
- TypeSystem\Common\GenericParameterDesc.Diagnostic.cs
-
-
- TypeSystem\Common\ExceptionStringID.cs
-
-
- TypeSystem\Common\FieldForInstantiatedType.cs
-
-
- TypeSystem\Common\FieldDesc.cs
-
-
- TypeSystem\Common\FieldDesc.ToString.cs
-
-
- TypeSystem\Common\FieldDesc.FieldLayout.cs
-
-
- TypeSystem\Common\FieldLayoutAlgorithm.cs
-
-
- TypeSystem\Common\InstantiatedMethod.cs
-
-
- TypeSystem\Common\InstantiatedMethod.Diagnostic.cs
-
-
- TypeSystem\Common\InstantiatedType.cs
-
-
- TypeSystem\Common\InstantiatedType.Diagnostic.cs
-
-
- TypeSystem\Common\InstantiatedType.Interfaces.cs
-
-
- TypeSystem\Common\InstantiatedType.MethodImpls.cs
-
-
- TypeSystem\Common\LayoutInt.cs
-
-
- TypeSystem\Common\LinqPoison.cs
-
-
- TypeSystem\Common\MetadataType.cs
-
-
- TypeSystem\Common\DefType.Diagnostic.cs
-
-
- TypeSystem\Common\MetadataType.Interfaces.cs
-
-
- TypeSystem\Common\MetadataType.MethodImpls.cs
-
-
- TypeSystem\Common\MetadataFieldLayoutAlgorithm.cs
-
-
- TypeSystem\Common\MetadataRuntimeInterfacesAlgorithm.cs
-
-
- TypeSystem\Common\MetadataTypeSystemContext.cs
-
-
- TypeSystem\Common\MethodForInstantiatedType.cs
-
-
- TypeSystem\Common\MethodForInstantiatedType.Diagnostic.cs
-
-
- TypeSystem\Common\ParameterizedType.cs
-
-
- TypeSystem\Common\PointerType.cs
-
-
- TypeSystem\Common\PropertySignature.cs
-
-
- TypeSystem\Common\SignatureVariable.cs
-
-
- TypeSystem\Common\TargetArchitecture.cs
-
-
- TypeSystem\Common\TargetDetails.cs
-
-
- TypeSystem\Common\TargetDetails.ToString.cs
-
-
- TypeSystem\Common\ThreadSafeFlags.cs
-
-
- TypeSystem\Common\TypeFlags.cs
-
-
- TypeSystem\Common\TypeHashingAlgorithms.cs
-
-
- TypeSystem\Common\TypeSystemConstraintsHelpers.cs
-
-
- TypeSystem\Common\TypeSystemContext.cs
-
-
- TypeSystem\Common\TypeSystemHelpers.cs
-
-
- Utilities\ExceptionTypeNameFormatter.cs
-
-
- Utilities\ExceptionTypeNameFormatter.Metadata.cs
-
-
- Utilities\TypeNameFormatter.cs
-
-
- TypeSystem\Common\WellKnownType.cs
-
-
- TypeSystem\Common\VirtualMethodAlgorithm.cs
-
-
- TypeSystem\Common\MethodDelegator.cs
-
-
- TypeSystem\Common\MethodDelegator.Diagnostic.cs
-
-
- TypeSystem\Common\MethodDesc.cs
-
-
- TypeSystem\Common\MethodDesc.Diagnostic.cs
-
-
- TypeSystem\Common\MethodDesc.ToString.cs
-
-
- TypeSystem\Common\StandardVirtualMethodAlgorithm.cs
-
-
- TypeSystem\Common\TypeDesc.cs
-
-
- TypeSystem\Common\TypeDesc.ToString.cs
-
-
- TypeSystem\Common\TypeDesc.Interfaces.cs
-
-
- TypeSystem\Common\DefType.cs
-
-
- TypeSystem\Common\DefType.FieldLayout.cs
-
-
- TypeSystem\Common\RuntimeInterfacesAlgorithm.cs
-
-
- Ecma\CustomAttributeTypeProvider.cs
-
-
- Ecma\EcmaAssembly.cs
-
-
- Ecma\EcmaAssembly.Symbols.cs
-
-
- Ecma\EcmaField.Sorting.cs
-
-
- Ecma\EcmaField.CodeGen.cs
-
-
- Ecma\EcmaField.Serialization.cs
-
-
- Ecma\EcmaGenericParameter.Sorting.cs
-
-
- Ecma\EcmaMethod.Sorting.cs
-
-
- Ecma\EcmaModule.Sorting.cs
-
-
- Ecma\EcmaType.Serialization.cs
-
-
- Ecma\EcmaType.Sorting.cs
-
-
- Ecma\PrimitiveTypeProvider.cs
-
-
- Ecma\EcmaModule.Symbols.cs
-
-
- Ecma\SymbolReader\PdbSymbolReader.cs
-
-
- Ecma\SymbolReader\PortablePdbSymbolReader.cs
-
-
- Ecma\SymbolReader\UnmanagedPdbSymbolReader.cs
-
-
- Ecma\EcmaField.cs
-
-
- Ecma\EcmaGenericParameter.cs
-
-
- Ecma\EcmaGenericParameter.Diagnostic.cs
-
-
- Ecma\EcmaMethod.cs
-
-
- Ecma\EcmaMethod.cs
-
-
- Ecma\EcmaModule.cs
-
-
- Ecma\EcmaSignatureParser.cs
-
-
- Ecma\EcmaType.cs
-
-
- Ecma\EcmaType.Diagnostic.cs
-
-
- Ecma\EcmaType.MethodImpls.cs
-
-
- Ecma\EcmaType.Interfaces.cs
-
-
- Ecma\MetadataExtensions.cs
-
-
- Ecma\IMetadataStringDecoderProvider.cs
-
-
- Ecma\CachingMetadataStringDecoder.cs
-
-
- IL\EcmaMethodIL.cs
-
-
- IL\EcmaMethodIL.Symbols.cs
-
-
- IL\MethodIL.cs
-
-
- IL\MethodIL.Symbols.cs
-
-
- IL\MethodILDebugView.cs
-
-
- IL\ILDisassembler.cs
-
-
- IL\InstantiatedMethodIL.cs
-
-
- IL\ILStackHelper.cs
-
-
- IL\ILOpcode.cs
-
-
- IL\ILOpcodeHelper.cs
-
-
- IL\Stubs\ILEmitter.cs
-
-
- IL\Stubs\PInvokeTargetNativeMethod.cs
-
-
- IL\Stubs\PInvokeTargetNativeMethod.Diagnostic.cs
-
-
- IL\Stubs\PInvokeTargetNativeMethod.Mangling.cs
-
-
- IL\Stubs\PInvokeTargetNativeMethod.Sorting.cs
-
-
- TypeSystem\CodeGen\FieldDesc.Serialization.cs
-
-
- TypeSystem\CodeGen\TypeDesc.Serialization.cs
-
-
- TypeSystem\Sorting\FieldDesc.Sorting.cs
-
-
- TypeSystem\Sorting\FieldForInstantiatedType.Sorting.cs
-
-
- TypeSystem\Sorting\InstantiatedMethod.Sorting.cs
-
-
- TypeSystem\Sorting\MethodDesc.Sorting.cs
-
-
- TypeSystem\Sorting\MethodForInstantiatedType.Sorting.cs
-
-
- TypeSystem\Interop\FieldDesc.Interop.cs
-
-
- TypeSystem\Interop\InstantiatedType.Interop.cs
-
-
- TypeSystem\Interop\MetadataType.Interop.cs
-
-
- TypeSystem\Interop\MethodDelegator.Interop.cs
-
-
- TypeSystem\Interop\MethodDesc.Interop.cs
-
-
- TypeSystem\Interop\MarshalAsDescriptor.cs
-
-
- TypeSystem\Mangling\IPrefixMangledMethod.cs
-
-
- TypeSystem\Mangling\IPrefixMangledType.cs
-
-
- TypeSystem\Mangling\IPrefixMangledSignature.cs
-
-
- Utilities\ArrayBuilder.cs
-
-
- TypeSystem\Common\LocalVariableDefinition.cs
-
-
- TypeSystem\RuntimeDetermined\ArrayType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\ByRefType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\FieldDesc.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\FunctionPointerType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\MethodDesc.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\PointerType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\MethodForRuntimeDeterminedType.cs
-
-
- TypeSystem\RuntimeDetermined\MethodForRuntimeDeterminedType.cs
-
-
- TypeSystem\RuntimeDetermined\MethodForRuntimeDeterminedType.Sorting.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedCanonicalizationAlgorithm.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedFieldLayoutAlgorithm.cs
-
-
- TypeSystem\RuntimeDetermined\DefType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\GenericParameterDesc.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\ParameterizedType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedType.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedType.Diagnostic.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedType.Sorting.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedTypeUtilities.cs
-
-
- TypeSystem\RuntimeDetermined\SignatureVariable.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\TypeDesc.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\TypeSystemContext.RuntimeDetermined.cs
-
-
- Common\System\FormattingHelpers.cs
-
-
- TypeSystem\Sorting\ArrayType.Sorting.cs
-
-
- TypeSystem\Sorting\ByRefType.Sorting.cs
-
-
- TypeSystem\Sorting\FunctionPointerType.Sorting.cs
-
-
- TypeSystem\Sorting\InstantiatedType.Sorting.cs
-
-
- TypeSystem\Sorting\MethodSignature.Sorting.cs
-
-
- TypeSystem\Sorting\PointerType.Sorting.cs
-
-
- TypeSystem\Sorting\SignatureVariable.Sorting.cs
-
-
- TypeSystem\Sorting\TypeDesc.Sorting.cs
-
-
- TypeSystem\Sorting\TypeSystemComparer.cs
-
-
-
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ArchitectureSpecificFieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ArchitectureSpecificFieldLayoutTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ArchitectureSpecificFieldLayoutTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ArchitectureSpecificFieldLayoutTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CanonicalizationTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CanonicalizationTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CanonicalizationTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CanonicalizationTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CastingTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CastingTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CastingTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CastingTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ConstraintsValidationTest.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ConstraintsValidationTest.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ConstraintsValidationTest.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ConstraintsValidationTest.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Canonicalization.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Canonicalization.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Canonicalization.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Canonicalization.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Casting.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Casting.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Casting.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Casting.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/CoreTestAssembly.csproj b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/CoreTestAssembly.csproj
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/CoreTestAssembly.csproj
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/CoreTestAssembly.csproj
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GCPointerMap.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GCPointerMap.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GCPointerMap.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GCPointerMap.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GenericConstraints.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GenericConstraints.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GenericConstraints.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GenericConstraints.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GenericTypes.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GenericTypes.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GenericTypes.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GenericTypes.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Hashcode.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Hashcode.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Hashcode.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Hashcode.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InstanceFieldLayout.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InstanceFieldLayout.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InstanceFieldLayout.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InstanceFieldLayout.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InterfaceArrangements.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InterfaceArrangements.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InterfaceArrangements.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InterfaceArrangements.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Marshalling.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Marshalling.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Marshalling.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Marshalling.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Platform.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Platform.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Platform.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Platform.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/StaticFieldLayout.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/StaticFieldLayout.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/StaticFieldLayout.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/StaticFieldLayout.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/SyntheticVirtualOverride.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/SyntheticVirtualOverride.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/SyntheticVirtualOverride.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/SyntheticVirtualOverride.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/TypeNameParsing.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/TypeNameParsing.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/TypeNameParsing.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/TypeNameParsing.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/ValueTypeShapeCharacteristics.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/ValueTypeShapeCharacteristics.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/ValueTypeShapeCharacteristics.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/ValueTypeShapeCharacteristics.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/VirtualFunctionOverride.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/VirtualFunctionOverride.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/VirtualFunctionOverride.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/VirtualFunctionOverride.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/DefType.FieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/DefType.FieldLayoutTests.cs
similarity index 98%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/DefType.FieldLayoutTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/DefType.FieldLayoutTests.cs
index c82f6c21a85be8..f41f4a7ea63068 100644
--- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/DefType.FieldLayoutTests.cs
+++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/DefType.FieldLayoutTests.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using Internal.TypeSystem;
-using Internal.TypeSystem.Interop;
using Xunit;
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ExceptionStringTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ExceptionStringTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ExceptionStringTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ExceptionStringTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/GCPointerMapTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/GCPointerMapTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/GCPointerMapTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/GCPointerMapTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/GenericTypeAndMethodTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/GenericTypeAndMethodTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/GenericTypeAndMethodTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/GenericTypeAndMethodTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/HashcodeTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/HashcodeTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/HashcodeTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/HashcodeTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILCompiler.TypeSystem.ReadyToRun.Tests.csproj b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILCompiler.TypeSystem.Tests.csproj
similarity index 78%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILCompiler.TypeSystem.ReadyToRun.Tests.csproj
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILCompiler.TypeSystem.Tests.csproj
index 558daa29f76b70..767680f651aacd 100644
--- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILCompiler.TypeSystem.ReadyToRun.Tests.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILCompiler.TypeSystem.Tests.csproj
@@ -1,6 +1,6 @@
- ILCompiler.TypeSystem.ReadyToRun.Tests
+ ILCompiler.TypeSystem.Tests$(NetCoreAppToolCurrent)Debug;Release;Checked
@@ -14,6 +14,9 @@
AnyCPU;x64AnyCPUtrue
+
+
+ READYTORUN;$(DefineConstants)
@@ -23,8 +26,7 @@
-
-
+ false
@@ -40,6 +42,11 @@
+
+
+
+
+
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILDisassemblerTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILDisassemblerTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILDisassemblerTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILDisassemblerTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/ILDisassembler.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/ILDisassembler.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/ILDisassembler.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/ILDisassembler.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/ILTestAssembly.ilproj b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/ILTestAssembly.ilproj
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/ILTestAssembly.ilproj
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/ILTestAssembly.ilproj
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/InstanceFieldLayout.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/InstanceFieldLayout.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/InstanceFieldLayout.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/InstanceFieldLayout.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/MDArrayFunctionResolution.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/MDArrayFunctionResolution.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/MDArrayFunctionResolution.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/MDArrayFunctionResolution.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Main.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/Main.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Main.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/Main.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/MethodImplOverride1.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/MethodImplOverride1.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/MethodImplOverride1.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/MethodImplOverride1.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Signature.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/Signature.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Signature.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/Signature.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/StaticFieldLayout.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/StaticFieldLayout.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/StaticFieldLayout.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/StaticFieldLayout.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/VirtualFunctionOverride.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/VirtualFunctionOverride.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/VirtualFunctionOverride.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/VirtualFunctionOverride.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/InstanceFieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/InstanceFieldLayoutTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/InterfacesTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InterfacesTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/InterfacesTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InterfacesTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/MarshalUtilsTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/MarshalUtilsTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/MarshalUtilsTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/MarshalUtilsTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/RuntimeDeterminedTypesTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/RuntimeDeterminedTypesTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/RuntimeDeterminedTypesTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/RuntimeDeterminedTypesTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SignatureTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SignatureTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SignatureTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SignatureTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/StaticFieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/StaticFieldLayoutTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/StaticFieldLayoutTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/StaticFieldLayoutTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SyntheticVirtualOverrideTests.DiagnosticName.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SyntheticVirtualOverrideTests.DiagnosticName.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SyntheticVirtualOverrideTests.DiagnosticName.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SyntheticVirtualOverrideTests.DiagnosticName.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SyntheticVirtualOverrideTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SyntheticVirtualOverrideTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SyntheticVirtualOverrideTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SyntheticVirtualOverrideTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TestMetadataFieldLayoutAlgorithm.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TestMetadataFieldLayoutAlgorithm.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestTypeSystemContext.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TestTypeSystemContext.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestTypeSystemContext.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TestTypeSystemContext.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TypeNameParsingTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TypeNameParsingTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TypeNameParsingTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TypeNameParsingTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/UniversalGenericFieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/UniversalGenericFieldLayoutTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/UniversalGenericFieldLayoutTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/UniversalGenericFieldLayoutTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ValueTypeShapeCharacteristicsTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ValueTypeShapeCharacteristicsTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ValueTypeShapeCharacteristicsTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ValueTypeShapeCharacteristicsTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/VirtualFunctionOverrideTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/VirtualFunctionOverrideTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/VirtualFunctionOverrideTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/VirtualFunctionOverrideTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/WellKnownTypeTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/WellKnownTypeTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/WellKnownTypeTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/WellKnownTypeTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj b/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
index 4aa53fd19c5e11..bf9a6275d972b7 100644
--- a/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
@@ -9,6 +9,8 @@
x64;x86AnyCPUfalse
+ true
+ $(DefineConstants);DISABLE_UNMANAGED_PDB_SYMBOLS
+ true
+ true
@@ -17,8 +24,8 @@
-
-
+
+
diff --git a/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/build/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.props b/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/buildTransitive/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.props
similarity index 100%
rename from src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/build/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.props
rename to src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/buildTransitive/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.props
diff --git a/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/build/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.targets b/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/buildTransitive/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.targets
similarity index 100%
rename from src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/build/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.targets
rename to src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/buildTransitive/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.targets
diff --git a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/Microsoft.Extensions.Hosting.Systemd.csproj b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/Microsoft.Extensions.Hosting.Systemd.csproj
index 5d375e67feab7c..b9faefd40f2f07 100644
--- a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/Microsoft.Extensions.Hosting.Systemd.csproj
+++ b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/Microsoft.Extensions.Hosting.Systemd.csproj
@@ -18,6 +18,11 @@
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdHelpers.cs b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdHelpers.cs
index 244e41c69e179d..b582580c9e97fe 100644
--- a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdHelpers.cs
+++ b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdHelpers.cs
@@ -4,7 +4,6 @@
using System;
using System.Globalization;
using System.IO;
-using System.Runtime.InteropServices;
using System.Text;
namespace Microsoft.Extensions.Hosting.Systemd
@@ -34,7 +33,7 @@ private static bool CheckParentIsSystemd()
try
{
// Check whether our direct parent is 'systemd'.
- int parentPid = GetParentPid();
+ int parentPid = Interop.libc.GetParentPid();
string ppidString = parentPid.ToString(NumberFormatInfo.InvariantInfo);
byte[] comm = File.ReadAllBytes("/proc/" + ppidString + "/comm");
return comm.AsSpan().SequenceEqual(Encoding.ASCII.GetBytes("systemd\n"));
@@ -45,8 +44,5 @@ private static bool CheckParentIsSystemd()
return false;
}
-
- [GeneratedDllImport("libc", EntryPoint = "getppid")]
- private static partial int GetParentPid();
}
}
diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json
index 8d9a5386431a9c..3d7f5a57eeeb85 100644
--- a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json
+++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json
@@ -3638,6 +3638,14 @@
"any",
"base"
],
+ "linux-loongarch64": [
+ "linux-loongarch64",
+ "linux",
+ "unix-loongarch64",
+ "unix",
+ "any",
+ "base"
+ ],
"linux-mips64": [
"linux-mips64",
"linux",
@@ -8100,6 +8108,12 @@
"any",
"base"
],
+ "unix-loongarch64": [
+ "unix-loongarch64",
+ "unix",
+ "any",
+ "base"
+ ],
"unix-mips64": [
"unix-mips64",
"unix",
@@ -8754,4 +8768,4 @@
"any",
"base"
]
-}
+}
\ No newline at end of file
diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json
index 39ca7bdb933c3e..76d454fc536c3a 100644
--- a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json
+++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json
@@ -1475,6 +1475,12 @@
"unix-armel"
]
},
+ "linux-loongarch64": {
+ "#import": [
+ "linux",
+ "unix-loongarch64"
+ ]
+ },
"linux-mips64": {
"#import": [
"linux",
@@ -3399,6 +3405,11 @@
"unix"
]
},
+ "unix-loongarch64": {
+ "#import": [
+ "unix"
+ ]
+ },
"unix-mips64": {
"#import": [
"unix"
@@ -3743,4 +3754,4 @@
]
}
}
-}
+}
\ No newline at end of file
diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props b/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props
index bc7832c33b61fc..b8345349409ecb 100644
--- a/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props
+++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props
@@ -3,11 +3,11 @@
any
- x64;x86;arm;armel;arm64;mips64;s390x
+ x64;x86;arm;armel;arm64;loongarch64;mips64;s390xunix
- x64;x86;arm;armel;arm64;mips64;s390x
+ x64;x86;arm;armel;arm64;loongarch64;mips64;s390xlinux
diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs
index cbfc3cdda8afa0..480e339c4080f5 100644
--- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs
+++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs
@@ -108,9 +108,12 @@ public override int GetHashCode()
public override bool Equals(object? obj)
{
- LazyMemberInfo that = (LazyMemberInfo)obj!;
+ if (obj is not LazyMemberInfo that)
+ {
+ return false;
+ }
- // Difefrent member types mean different members
+ // Different member types mean different members
if (_memberType != that._memberType)
{
return false;
diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfoTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfoTests.cs
index 3216f9ad528d65..e1780c1a1c3e90 100644
--- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfoTests.cs
+++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfoTests.cs
@@ -175,6 +175,12 @@ public void Constructor_PassNullAccessorCreators()
});
}
+ [Fact]
+ public void Equals_PassNullReturnsFalse()
+ {
+ Assert.False(new LazyMemberInfo().Equals(null));
+ }
+
private static IEnumerable>> GetMembersAndAccessors(Type type)
{
yield return new Tuple>(
diff --git a/src/libraries/System.Console/tests/ConsoleKeyInfoTests.cs b/src/libraries/System.Console/tests/ConsoleKeyInfoTests.cs
index da3720a43d0159..c4410457e8850f 100644
--- a/src/libraries/System.Console/tests/ConsoleKeyInfoTests.cs
+++ b/src/libraries/System.Console/tests/ConsoleKeyInfoTests.cs
@@ -33,6 +33,7 @@ public void Ctor_ValueCtor_ValuesPassedToProperties(bool shift, bool alt, bool c
[Theory]
[MemberData(nameof(SampleConsoleKeyInfos))]
+ [SkipOnCoreClr("https://github.com/dotnet/runtime/issues/60240", RuntimeTestModes.JitStressRegs)]
public void Equals_SameData(ConsoleKeyInfo cki)
{
ConsoleKeyInfo other = cki; // otherwise compiler warns about comparing the instance with itself
diff --git a/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs b/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs
index a65a2798e5f6f7..49fbf274d23357 100644
--- a/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs
+++ b/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs
@@ -1700,14 +1700,10 @@ internal static bool AutoGenerated(ForeignKeyConstraint fk, bool checkRelation)
if (fk.ExtendedProperties.Count > 0)
return false;
-
if (fk.AcceptRejectRule != AcceptRejectRule.None)
return false;
if (fk.DeleteRule != Rule.Cascade)
return false;
- if (fk.DeleteRule != Rule.Cascade)
- return false;
-
if (fk.RelatedColumnsReference.Length != 1)
return false;
diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommandBuilder.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommandBuilder.cs
index b9227c61026260..0b5d0ea1050124 100644
--- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommandBuilder.cs
+++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommandBuilder.cs
@@ -330,20 +330,9 @@ public string UnquoteIdentifier(string quotedIdentifier, OdbcConnection? connect
quoteSuffix = quotePrefix;
}
+ // ignoring the return value because it is acceptable for the quotedString to not be quoted in this context.
string? unquotedIdentifier;
- // by the ODBC spec "If the data source does not support quoted identifiers, a blank is returned."
- // So if a blank is returned the string is returned unchanged. Otherwise the returned string is used
- // to unquote the string
- if (!string.IsNullOrEmpty(quotePrefix) || quotePrefix != " ")
- {
- // ignoring the return value because it is acceptable for the quotedString to not be quoted in this
- // context.
- ADP.RemoveStringQuotes(quotePrefix, quoteSuffix, quotedIdentifier, out unquotedIdentifier);
- }
- else
- {
- unquotedIdentifier = quotedIdentifier;
- }
+ ADP.RemoveStringQuotes(quotePrefix, quoteSuffix, quotedIdentifier, out unquotedIdentifier);
return unquotedIdentifier!;
}
}
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Instrument.netfx.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Instrument.netfx.cs
index 2dc030f5662b10..d973afdacafda0 100644
--- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Instrument.netfx.cs
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Instrument.netfx.cs
@@ -17,7 +17,8 @@ namespace System.Diagnostics.Metrics
#endif
public abstract partial class Instrument : Instrument where T : struct
{
- [ThreadStatic] private KeyValuePair[] ts_tags;
+ [ThreadStatic]
+ private static KeyValuePair[] ts_tags;
private const int MaxTagsCount = 8;
@@ -108,4 +109,4 @@ protected void RecordMeasurement(T measurement, in TagList tagList)
ts_tags = tags;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs
index 7e1f6d5d77adec..d6975bd7274153 100644
--- a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs
+++ b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs
@@ -178,10 +178,10 @@ public partial class ProcessModule : System.ComponentModel.Component
internal ProcessModule() { }
public System.IntPtr BaseAddress { get { throw null; } }
public System.IntPtr EntryPointAddress { get { throw null; } }
- public string? FileName { get { throw null; } }
+ public string FileName { get { throw null; } }
public System.Diagnostics.FileVersionInfo FileVersionInfo { get { throw null; } }
public int ModuleMemorySize { get { throw null; } }
- public string? ModuleName { get { throw null; } }
+ public string ModuleName { get { throw null; } }
public override string ToString() { throw null; }
}
public partial class ProcessModuleCollection : System.Collections.ReadOnlyCollectionBase
diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.BSD.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.BSD.cs
index c6c43dd36a91c5..2d1806842d35bd 100644
--- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.BSD.cs
+++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.BSD.cs
@@ -42,16 +42,12 @@ internal static ProcessModuleCollection GetModules(int processId)
// and why MainModule exists.
try
{
- string? exePath = GetProcPath(processId);
+ string exePath = GetProcPath(processId);
if (!string.IsNullOrEmpty(exePath))
{
return new ProcessModuleCollection(1)
{
- new ProcessModule()
- {
- FileName = exePath,
- ModuleName = Path.GetFileName(exePath)
- }
+ new ProcessModule(exePath, Path.GetFileName(exePath))
};
}
}
diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.FreeBSD.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.FreeBSD.cs
index bc2bd2e0753285..0546c4b3605fc8 100644
--- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.FreeBSD.cs
+++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.FreeBSD.cs
@@ -15,7 +15,7 @@ public static int[] GetProcessIds()
return Interop.Process.ListAllPids();
}
- internal static string? GetProcPath(int processId)
+ internal static string GetProcPath(int processId)
{
return Interop.Process.GetProcPath(processId);
}
diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Linux.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Linux.cs
index 9dede5b6685ad0..1f85741f1c77d4 100644
--- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Linux.cs
+++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Linux.cs
@@ -41,18 +41,20 @@ internal static ProcessModuleCollection GetModules(int processId)
ProcessModuleCollection modules = Interop.procfs.ParseMapsModules(processId) ?? new(capacity: 0);
// Move the main executable module to be the first in the list if it's not already
- string? exePath = Process.GetExePath(processId);
- for (int i = 0; i < modules.Count; i++)
+ if (Process.GetExePath(processId) is string exePath)
{
- ProcessModule module = modules[i];
- if (module.FileName == exePath)
+ for (int i = 0; i < modules.Count; i++)
{
- if (i > 0)
+ ProcessModule module = modules[i];
+ if (module.FileName == exePath)
{
- modules.RemoveAt(i);
- modules.Insert(0, module);
+ if (i > 0)
+ {
+ modules.RemoveAt(i);
+ modules.Insert(0, module);
+ }
+ break;
}
- break;
}
}
diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
index 665bfb455c80e9..e64b359b6e770f 100644
--- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
+++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
@@ -161,13 +161,6 @@ private static ProcessModuleCollection GetModules(int processId, bool firstModul
continue;
}
- var module = new ProcessModule()
- {
- ModuleMemorySize = ntModuleInfo.SizeOfImage,
- EntryPointAddress = ntModuleInfo.EntryPoint,
- BaseAddress = ntModuleInfo.BaseOfDll
- };
-
int length = 0;
while ((length = Interop.Kernel32.GetModuleBaseName(processHandle, moduleHandle, chars, chars.Length)) == chars.Length)
{
@@ -178,12 +171,11 @@ private static ProcessModuleCollection GetModules(int processId, bool firstModul
if (length == 0)
{
- module.Dispose();
HandleLastWin32Error();
continue;
}
- module.ModuleName = new string(chars, 0, length);
+ string moduleName = new string(chars, 0, length);
while ((length = Interop.Kernel32.GetModuleFileNameEx(processHandle, moduleHandle, chars, chars.Length)) == chars.Length)
{
@@ -194,7 +186,6 @@ private static ProcessModuleCollection GetModules(int processId, bool firstModul
if (length == 0)
{
- module.Dispose();
HandleLastWin32Error();
continue;
}
@@ -205,9 +196,13 @@ private static ProcessModuleCollection GetModules(int processId, bool firstModul
{
charsSpan = charsSpan.Slice(NtPathPrefix.Length);
}
- module.FileName = charsSpan.ToString();
- modules.Add(module);
+ modules.Add(new ProcessModule(charsSpan.ToString(), moduleName)
+ {
+ ModuleMemorySize = ntModuleInfo.SizeOfImage,
+ EntryPointAddress = ntModuleInfo.EntryPoint,
+ BaseAddress = ntModuleInfo.BaseOfDll,
+ });
}
}
finally
diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessModule.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessModule.cs
index b45513b076c60b..9d0a3338a38edf 100644
--- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessModule.cs
+++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessModule.cs
@@ -13,19 +13,25 @@ namespace System.Diagnostics
[Designer("System.Diagnostics.Design.ProcessModuleDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public class ProcessModule : Component
{
+ private readonly string _fileName;
+ private readonly string _moduleName;
private FileVersionInfo? _fileVersionInfo;
- internal ProcessModule() { }
+ internal ProcessModule(string fileName, string moduleName)
+ {
+ _fileName = fileName;
+ _moduleName = moduleName;
+ }
///
/// Returns the name of the Module.
///
- public string? ModuleName { get; internal set; }
+ public string ModuleName => _moduleName;
///
/// Returns the full file path for the location of the module.
///
- public string? FileName { get; internal set; }
+ public string FileName => _fileName;
///
/// Returns the memory address that the module was loaded at.
@@ -49,7 +55,7 @@ internal ProcessModule() { }
///
/// Returns version information about the module.
///
- public FileVersionInfo FileVersionInfo => _fileVersionInfo ?? (_fileVersionInfo = FileVersionInfo.GetVersionInfo(FileName!));
+ public FileVersionInfo FileVersionInfo => _fileVersionInfo ??= FileVersionInfo.GetVersionInfo(_fileName);
public override string ToString() => $"{base.ToString()} ({ModuleName})";
}
diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.NoCOMWrappers.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.NoCOMWrappers.cs
index 34a5d19a0d9c83..124ce9f3a7bda1 100644
--- a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.NoCOMWrappers.cs
+++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.NoCOMWrappers.cs
@@ -15,6 +15,7 @@ public void Save(Stream outputStream)
{
if (_iconData != null)
{
+ ArgumentNullException.ThrowIfNull(outputStream);
outputStream.Write(_iconData, 0, _iconData.Length);
}
else
@@ -32,9 +33,7 @@ public void Save(Stream outputStream)
{
try
{
- if (outputStream == null)
- throw new ArgumentNullException(nameof(outputStream));
-
+ ArgumentNullException.ThrowIfNull(outputStream);
picture.SaveAsFile(new GPStream(outputStream, makeSeekable: false), -1, out int temp);
}
finally
diff --git a/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs b/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs
index 787f9e37f719db..83a3bd57cbfe1b 100644
--- a/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs
+++ b/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs
@@ -439,5 +439,14 @@ public void TestCreationWithTemporaryLCID(int lcid)
Assert.NotEqual(lcid, new CultureInfo(lcid).LCID);
}
+
+ [InlineData("zh-TW-u-co-zhuyin")]
+ [InlineData("de-DE-u-co-phoneb")]
+ [InlineData("de-u-co-phonebk")]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalization))]
+ public void TestCreationWithMangledSortName(string cultureName)
+ {
+ Assert.True(CultureInfo.GetCultureInfo(cultureName).CompareInfo.Name.Equals(cultureName, StringComparison.OrdinalIgnoreCase));
+ }
}
}
diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/DeflateManagedStream.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/DeflateManagedStream.cs
index c3a276593979af..ec71718a511d3d 100644
--- a/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/DeflateManagedStream.cs
+++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/DeflateManagedStream.cs
@@ -26,8 +26,6 @@ internal DeflateManagedStream(Stream stream, ZipArchiveEntry.CompressionMethodVa
throw new ArgumentNullException(nameof(stream));
if (!stream.CanRead)
throw new ArgumentException(SR.NotSupported_UnreadableStream, nameof(stream));
- if (!stream.CanRead)
- throw new ArgumentException(SR.NotSupported_UnreadableStream, nameof(stream));
Debug.Assert(method == ZipArchiveEntry.CompressionMethodValues.Deflate64);
diff --git a/src/libraries/System.IO.FileSystem/tests/File/EncryptDecrypt.Windows.cs b/src/libraries/System.IO.FileSystem/tests/File/EncryptDecrypt.Windows.cs
new file mode 100644
index 00000000000000..015ba30b6ad7c1
--- /dev/null
+++ b/src/libraries/System.IO.FileSystem/tests/File/EncryptDecrypt.Windows.cs
@@ -0,0 +1,85 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.DotNet.XUnitExtensions;
+using System.Diagnostics;
+using System.Diagnostics.Eventing.Reader;
+using System.Linq;
+using System.Security;
+using System.ServiceProcess;
+using Xunit;
+using Xunit.Abstractions;
+
+namespace System.IO.Tests
+{
+ public partial class EncryptDecrypt
+ {
+ partial void EnsureEFSServiceStarted()
+ {
+ try
+ {
+ using var sc = new ServiceController("EFS");
+ _output.WriteLine($"EFS service is: {sc.Status}");
+ if (sc.Status != ServiceControllerStatus.Running)
+ {
+ _output.WriteLine("Trying to start EFS service");
+ sc.Start();
+ _output.WriteLine($"EFS service is now: {sc.Status}");
+ }
+ }
+ catch (Exception e)
+ {
+ _output.WriteLine(e.ToString());
+ }
+ }
+
+ partial void LogEFSDiagnostics()
+ {
+ int hours = 1; // how many hours to look backwards
+ string query = @$"
+
+
+
+
+
+
+ *[System[TimeCreated[timediff(@SystemTime) >= {hours * 60 * 60 * 1000L}]]]
+
+
+ ";
+
+ var eventQuery = new EventLogQuery("System", PathType.LogName, query);
+
+ using var eventReader = new EventLogReader(eventQuery);
+
+ EventRecord record = eventReader.ReadEvent();
+ var garbage = new string[] { "Background Intelligent", "Intel", "Defender", "Intune", "BITS", "NetBT"};
+
+ _output.WriteLine("===== Dumping recent relevant events: =====");
+ while (record != null)
+ {
+ string description = "";
+ try
+ {
+ description = record.FormatDescription();
+ }
+ catch (EventLogException) { }
+
+ if (!garbage.Any(term => description.Contains(term, StringComparison.OrdinalIgnoreCase)))
+ {
+ _output.WriteLine($"{record.TimeCreated} {record.ProviderName} [{record.LevelDisplayName} {record.Id}] {description.Replace("\r\n", " ")}");
+ }
+
+ record = eventReader.ReadEvent();
+ }
+
+ _output.WriteLine("==== Finished dumping =====");
+ }
+ }
+}
diff --git a/src/libraries/System.IO.FileSystem/tests/File/EncryptDecrypt.cs b/src/libraries/System.IO.FileSystem/tests/File/EncryptDecrypt.cs
index 12299fad33fcf5..c4d34c320668ef 100644
--- a/src/libraries/System.IO.FileSystem/tests/File/EncryptDecrypt.cs
+++ b/src/libraries/System.IO.FileSystem/tests/File/EncryptDecrypt.cs
@@ -1,17 +1,28 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using Microsoft.DotNet.XUnitExtensions;
using System.Diagnostics;
+using System.Diagnostics.Eventing.Reader;
using System.Security;
+using System.ServiceProcess;
using Xunit;
+using Xunit.Abstractions;
namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
- public class EncryptDecrypt : FileSystemTest
+ public partial class EncryptDecrypt : FileSystemTest
{
+ private readonly ITestOutputHelper _output;
+
+ public EncryptDecrypt(ITestOutputHelper output)
+ {
+ _output = output;
+ }
+
[Fact]
- public static void NullArg_ThrowsException()
+ public void NullArg_ThrowsException()
{
AssertExtensions.Throws("path", () => File.Encrypt(null));
AssertExtensions.Throws("path", () => File.Decrypt(null));
@@ -19,7 +30,7 @@ public static void NullArg_ThrowsException()
[SkipOnTargetFramework(TargetFrameworkMonikers.Netcoreapp)]
[Fact]
- public static void EncryptDecrypt_NotSupported()
+ public void EncryptDecrypt_NotSupported()
{
Assert.Throws(() => File.Encrypt("path"));
Assert.Throws(() => File.Decrypt("path"));
@@ -29,7 +40,8 @@ public static void EncryptDecrypt_NotSupported()
// because EFS (Encrypted File System), its underlying technology, is not available on these operating systems.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer), nameof(PlatformDetection.IsNotWindowsHomeEdition))]
[PlatformSpecific(TestPlatforms.Windows)]
- public static void EncryptDecrypt_Read()
+ [OuterLoop] // Occasional failures: https://github.com/dotnet/runtime/issues/12339
+ public void EncryptDecrypt_Read()
{
string tmpFileName = Path.GetTempFileName();
string textContentToEncrypt = "Content to encrypt";
@@ -39,6 +51,8 @@ public static void EncryptDecrypt_Read()
string fileContentRead = File.ReadAllText(tmpFileName);
Assert.Equal(textContentToEncrypt, fileContentRead);
+ EnsureEFSServiceStarted();
+
try
{
File.Encrypt(tmpFileName);
@@ -48,7 +62,13 @@ public static void EncryptDecrypt_Read()
{
// Ignore ERROR_NOT_FOUND 1168 (0x490). It is reported when EFS is disabled by domain policy.
// Ignore ERROR_NO_USER_KEYS (0x1776). This occurs when no user key exists to encrypt with.
- return;
+ throw new SkipTestException($"Encrypt not available. Error 0x{e.HResult:X}");
+ }
+ catch (IOException e)
+ {
+ _output.WriteLine($"Encrypt failed with {e.Message} 0x{e.HResult:X}");
+ LogEFSDiagnostics();
+ throw;
}
Assert.Equal(fileContentRead, File.ReadAllText(tmpFileName));
@@ -63,5 +83,9 @@ public static void EncryptDecrypt_Read()
File.Delete(tmpFileName);
}
}
+
+ partial void EnsureEFSServiceStarted(); // no-op on Unix
+
+ partial void LogEFSDiagnostics(); // no-op on Unix currently
}
}
diff --git a/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj b/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj
index 7c219c593107bf..83f7bf47ea78e0 100644
--- a/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj
+++ b/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj
@@ -76,6 +76,7 @@
+
diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpContentHeaders.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpContentHeaders.cs
index bae8addd668fec..361e27bd8f0596 100644
--- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpContentHeaders.cs
+++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpContentHeaders.cs
@@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
namespace System.Net.Http.Headers
{
@@ -16,17 +14,8 @@ public sealed class HttpContentHeaders : HttpHeaders
private HttpHeaderValueCollection? _contentEncoding;
private HttpHeaderValueCollection? _contentLanguage;
- public ICollection Allow
- {
- get
- {
- if (_allow == null)
- {
- _allow = new HttpHeaderValueCollection(KnownHeaders.Allow.Descriptor, this);
- }
- return _allow;
- }
- }
+ public ICollection Allow =>
+ _allow ??= new HttpHeaderValueCollection(KnownHeaders.Allow.Descriptor, this);
public ContentDispositionHeaderValue? ContentDisposition
{
@@ -36,29 +25,11 @@ public ContentDispositionHeaderValue? ContentDisposition
// Must be a collection (and not provide properties like "GZip", "Deflate", etc.) since the
// order matters!
- public ICollection ContentEncoding
- {
- get
- {
- if (_contentEncoding == null)
- {
- _contentEncoding = new HttpHeaderValueCollection(KnownHeaders.ContentEncoding.Descriptor, this);
- }
- return _contentEncoding;
- }
- }
+ public ICollection ContentEncoding =>
+ _contentEncoding ??= new HttpHeaderValueCollection(KnownHeaders.ContentEncoding.Descriptor, this);
- public ICollection ContentLanguage
- {
- get
- {
- if (_contentLanguage == null)
- {
- _contentLanguage = new HttpHeaderValueCollection(KnownHeaders.ContentLanguage.Descriptor, this);
- }
- return _contentLanguage;
- }
- }
+ public ICollection ContentLanguage =>
+ _contentLanguage ??= new HttpHeaderValueCollection(KnownHeaders.ContentLanguage.Descriptor, this);
public long? ContentLength
{
diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpGeneralHeaders.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpGeneralHeaders.cs
index b5fae3e1eec5ea..4bd4694f4d5d3d 100644
--- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpGeneralHeaders.cs
+++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpGeneralHeaders.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Collections.Generic;
using System.Diagnostics;
namespace System.Net.Http.Headers
@@ -74,29 +73,11 @@ public DateTimeOffset? Date
set { _parent.SetOrRemoveParsedValue(KnownHeaders.Date.Descriptor, value); }
}
- public HttpHeaderValueCollection Pragma
- {
- get
- {
- if (_pragma == null)
- {
- _pragma = new HttpHeaderValueCollection(KnownHeaders.Pragma.Descriptor, _parent);
- }
- return _pragma;
- }
- }
+ public HttpHeaderValueCollection Pragma =>
+ _pragma ??= new HttpHeaderValueCollection(KnownHeaders.Pragma.Descriptor, _parent);
- public HttpHeaderValueCollection Trailer
- {
- get
- {
- if (_trailer == null)
- {
- _trailer = new HttpHeaderValueCollection(KnownHeaders.Trailer.Descriptor, _parent);
- }
- return _trailer;
- }
- }
+ public HttpHeaderValueCollection Trailer =>
+ _trailer ??= new HttpHeaderValueCollection(KnownHeaders.Trailer.Descriptor, _parent);
internal static bool? GetTransferEncodingChunked(HttpHeaders parent, HttpGeneralHeaders? headers)
{
@@ -139,65 +120,20 @@ public bool? TransferEncodingChunked
}
}
- public HttpHeaderValueCollection Upgrade
- {
- get
- {
- if (_upgrade == null)
- {
- _upgrade = new HttpHeaderValueCollection(KnownHeaders.Upgrade.Descriptor, _parent);
- }
- return _upgrade;
- }
- }
+ public HttpHeaderValueCollection Upgrade =>
+ _upgrade ??= new HttpHeaderValueCollection(KnownHeaders.Upgrade.Descriptor, _parent);
- public HttpHeaderValueCollection Via
- {
- get
- {
- if (_via == null)
- {
- _via = new HttpHeaderValueCollection(KnownHeaders.Via.Descriptor, _parent);
- }
- return _via;
- }
- }
+ public HttpHeaderValueCollection Via =>
+ _via ??= new HttpHeaderValueCollection(KnownHeaders.Via.Descriptor, _parent);
- public HttpHeaderValueCollection Warning
- {
- get
- {
- if (_warning == null)
- {
- _warning = new HttpHeaderValueCollection(KnownHeaders.Warning.Descriptor, _parent);
- }
- return _warning;
- }
- }
+ public HttpHeaderValueCollection Warning =>
+ _warning ??= new HttpHeaderValueCollection(KnownHeaders.Warning.Descriptor, _parent);
- public HttpHeaderValueCollection Connection
- {
- get
- {
- if (_connection == null)
- {
- _connection = new HttpHeaderValueCollection(KnownHeaders.Connection.Descriptor, _parent);
- }
- return _connection;
- }
- }
+ public HttpHeaderValueCollection Connection =>
+ _connection ??= new HttpHeaderValueCollection(KnownHeaders.Connection.Descriptor, _parent);
- public HttpHeaderValueCollection TransferEncoding
- {
- get
- {
- if (_transferEncoding == null)
- {
- _transferEncoding = new HttpHeaderValueCollection(KnownHeaders.TransferEncoding.Descriptor, _parent);
- }
- return _transferEncoding;
- }
- }
+ public HttpHeaderValueCollection TransferEncoding =>
+ _transferEncoding ??= new HttpHeaderValueCollection(KnownHeaders.TransferEncoding.Descriptor, _parent);
internal HttpGeneralHeaders(HttpHeaders parent)
{
diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs
index c51adc80d5c301..39b7b3006ee122 100644
--- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs
+++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs
@@ -455,12 +455,12 @@ private async Task AddHttp11ConnectionAsync(HttpRequestMessage request)
}
catch (OperationCanceledException oce) when (oce.CancellationToken == cts.Token)
{
- HandleHttp11ConnectionFailure(CreateConnectTimeoutException(oce));
+ HandleHttp11ConnectionFailure(request, CreateConnectTimeoutException(oce));
return;
}
catch (Exception e)
{
- HandleHttp11ConnectionFailure(e);
+ HandleHttp11ConnectionFailure(request, e);
return;
}
}
@@ -473,7 +473,7 @@ private void CheckForHttp11ConnectionInjection()
{
Debug.Assert(HasSyncObjLock);
- if (!_http11RequestQueue.TryPeekNextRequest(out HttpRequestMessage? request))
+ if (!_http11RequestQueue.TryPeekRequest(out HttpRequestMessage? request))
{
return;
}
@@ -561,6 +561,7 @@ private async Task HandleHttp11Downgrade(HttpRequestMessage request, Socket? soc
if (NetEventSource.Log.IsEnabled()) Trace("Server does not support HTTP2; disabling HTTP2 use and proceeding with HTTP/1.1 connection");
bool canUse = true;
+ TaskCompletionSourceWithCancellation? waiter = null;
lock (SyncObj)
{
Debug.Assert(_pendingHttp2Connection);
@@ -571,10 +572,6 @@ private async Task HandleHttp11Downgrade(HttpRequestMessage request, Socket? soc
_associatedHttp2ConnectionCount--;
_pendingHttp2Connection = false;
- // Signal to any queued HTTP2 requests that they must downgrade.
- while (_http2RequestQueue.TryDequeueNextRequest(null))
- ;
-
if (_associatedHttp11ConnectionCount < _maxHttp11Connections)
{
_associatedHttp11ConnectionCount++;
@@ -585,6 +582,23 @@ private async Task HandleHttp11Downgrade(HttpRequestMessage request, Socket? soc
// We are already at the limit for HTTP/1.1 connections, so do not proceed with this connection.
canUse = false;
}
+
+ _http2RequestQueue.TryDequeueWaiter(out waiter);
+ }
+
+ // Signal to any queued HTTP2 requests that they must downgrade.
+ while (waiter is not null)
+ {
+ if (NetEventSource.Log.IsEnabled()) Trace("Downgrading queued HTTP2 request to HTTP/1.1");
+
+ // We don't care if this fails; that means the request was previously canceled.
+ bool success = waiter.TrySetResult(null);
+ Debug.Assert(success || waiter.Task.IsCanceled);
+
+ lock (SyncObj)
+ {
+ _http2RequestQueue.TryDequeueWaiter(out waiter);
+ }
}
if (!canUse)
@@ -601,12 +615,12 @@ private async Task HandleHttp11Downgrade(HttpRequestMessage request, Socket? soc
}
catch (OperationCanceledException oce) when (oce.CancellationToken == cancellationToken)
{
- HandleHttp11ConnectionFailure(CreateConnectTimeoutException(oce));
+ HandleHttp11ConnectionFailure(request, CreateConnectTimeoutException(oce));
return;
}
catch (Exception e)
{
- HandleHttp11ConnectionFailure(e);
+ HandleHttp11ConnectionFailure(request, e);
return;
}
@@ -654,12 +668,12 @@ private async Task AddHttp2ConnectionAsync(HttpRequestMessage request)
}
catch (OperationCanceledException oce) when (oce.CancellationToken == cts.Token)
{
- HandleHttp2ConnectionFailure(CreateConnectTimeoutException(oce));
+ HandleHttp2ConnectionFailure(request, CreateConnectTimeoutException(oce));
return;
}
catch (Exception e)
{
- HandleHttp2ConnectionFailure(e);
+ HandleHttp2ConnectionFailure(request, e);
return;
}
}
@@ -669,7 +683,7 @@ private async Task AddHttp2ConnectionAsync(HttpRequestMessage request)
ValueTask shutdownTask = connection.WaitForShutdownAsync();
// Add the new connection to the pool.
- ReturnHttp2Connection(connection, isNewConnection: true);
+ ReturnHttp2Connection(connection, request, isNewConnection: true);
// Wait for connection shutdown.
await shutdownTask.ConfigureAwait(false);
@@ -681,7 +695,7 @@ private void CheckForHttp2ConnectionInjection()
{
Debug.Assert(HasSyncObjLock);
- if (!_http2RequestQueue.TryPeekNextRequest(out HttpRequestMessage? request))
+ if (!_http2RequestQueue.TryPeekRequest(out HttpRequestMessage? request))
{
return;
}
@@ -1573,10 +1587,12 @@ private async ValueTask EstablishProxyTunnelAsync(bool async, HttpReques
return (socket, stream);
}
- private void HandleHttp11ConnectionFailure(Exception e)
+ private void HandleHttp11ConnectionFailure(HttpRequestMessage request, Exception e)
{
if (NetEventSource.Log.IsEnabled()) Trace("HTTP/1.1 connection failed");
+ bool failRequest;
+ TaskCompletionSourceWithCancellation? waiter;
lock (SyncObj)
{
Debug.Assert(_associatedHttp11ConnectionCount > 0);
@@ -1585,17 +1601,28 @@ private void HandleHttp11ConnectionFailure(Exception e)
_associatedHttp11ConnectionCount--;
_pendingHttp11ConnectionCount--;
- // Fail the next queued request (if any) with this error.
- _http11RequestQueue.TryFailNextRequest(e);
+ // If the request that caused this connection attempt is still pending, fail it.
+ // Otherwise, the request must have been canceled or satisfied by another connection already.
+ failRequest = _http11RequestQueue.TryDequeueWaiterForSpecificRequest(request, out waiter);
CheckForHttp11ConnectionInjection();
}
+
+ if (failRequest)
+ {
+ // This may fail if the request was already canceled, but we don't care.
+ Debug.Assert(waiter is not null);
+ bool succeeded = waiter.TrySetException(e);
+ Debug.Assert(succeeded || waiter.Task.IsCanceled);
+ }
}
- private void HandleHttp2ConnectionFailure(Exception e)
+ private void HandleHttp2ConnectionFailure(HttpRequestMessage request, Exception e)
{
if (NetEventSource.Log.IsEnabled()) Trace("HTTP2 connection failed");
+ bool failRequest;
+ TaskCompletionSourceWithCancellation? waiter;
lock (SyncObj)
{
Debug.Assert(_associatedHttp2ConnectionCount > 0);
@@ -1604,11 +1631,20 @@ private void HandleHttp2ConnectionFailure(Exception e)
_associatedHttp2ConnectionCount--;
_pendingHttp2Connection = false;
- // Fail the next queued request (if any) with this error.
- _http2RequestQueue.TryFailNextRequest(e);
+ // If the request that caused this connection attempt is still pending, fail it.
+ // Otherwise, the request must have been canceled or satisfied by another connection already.
+ failRequest = _http2RequestQueue.TryDequeueWaiterForSpecificRequest(request, out waiter);
CheckForHttp2ConnectionInjection();
}
+
+ if (failRequest)
+ {
+ // This may fail if the request was already canceled, but we don't care.
+ Debug.Assert(waiter is not null);
+ bool succeeded = waiter.TrySetException(e);
+ Debug.Assert(succeeded || waiter.Task.IsCanceled);
+ }
}
///
@@ -1684,50 +1720,77 @@ public void ReturnHttp11Connection(HttpConnection connection, bool isNewConnecti
return;
}
- lock (SyncObj)
+ // Loop in case we get a cancelled request.
+ while (true)
{
- Debug.Assert(!_availableHttp11Connections.Contains(connection));
-
- if (isNewConnection)
+ TaskCompletionSourceWithCancellation? waiter = null;
+ bool added = false;
+ lock (SyncObj)
{
- Debug.Assert(_pendingHttp11ConnectionCount > 0);
- _pendingHttp11ConnectionCount--;
- }
+ Debug.Assert(!_availableHttp11Connections.Contains(connection), $"Connection already in available list");
+ Debug.Assert(_associatedHttp11ConnectionCount > _availableHttp11Connections.Count,
+ $"Expected _associatedHttp11ConnectionCount={_associatedHttp11ConnectionCount} > _availableHttp11Connections.Count={_availableHttp11Connections.Count}");
+ Debug.Assert(_associatedHttp11ConnectionCount <= _maxHttp11Connections,
+ $"Expected _associatedHttp11ConnectionCount={_associatedHttp11ConnectionCount} <= _maxHttp11Connections={_maxHttp11Connections}");
- if (_http11RequestQueue.TryDequeueNextRequest(connection))
- {
- Debug.Assert(_availableHttp11Connections.Count == 0, $"With {_availableHttp11Connections.Count} available HTTP/1.1 connections, we shouldn't have a waiter.");
+ if (isNewConnection)
+ {
+ Debug.Assert(_pendingHttp11ConnectionCount > 0);
+ _pendingHttp11ConnectionCount--;
+ isNewConnection = false;
+ }
- if (NetEventSource.Log.IsEnabled()) connection.Trace("Dequeued waiting HTTP/1.1 request.");
- return;
+ if (_http11RequestQueue.TryDequeueWaiter(out waiter))
+ {
+ Debug.Assert(_availableHttp11Connections.Count == 0, $"With {_availableHttp11Connections.Count} available HTTP/1.1 connections, we shouldn't have a waiter.");
+ }
+ else if (!_disposed)
+ {
+ // Add connection to the pool.
+ added = true;
+ _availableHttp11Connections.Add(connection);
+ }
+
+ // If the pool has been disposed of, we will dispose the connection below outside the lock.
+ // We do this after processing the queue above so that any queued requests will be handled by existing connections if possible.
}
- if (_disposed)
+ if (waiter is not null)
+ {
+ Debug.Assert(!added);
+ if (waiter.TrySetResult(connection))
+ {
+ if (NetEventSource.Log.IsEnabled()) connection.Trace("Dequeued waiting HTTP/1.1 request.");
+ return;
+ }
+ else
+ {
+ Debug.Assert(waiter.Task.IsCanceled);
+ if (NetEventSource.Log.IsEnabled()) connection.Trace("Discarding canceled HTTP/1.1 request from queue.");
+ // Loop and process the queue again
+ }
+ }
+ else if (added)
{
- // If the pool has been disposed of, dispose the connection being returned,
- // as the pool is being deactivated. We do this after the above in order to
- // use pooled connections to satisfy any requests that pended before the
- // the pool was disposed of.
- if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing connection returned to pool. Pool was disposed.");
+ if (NetEventSource.Log.IsEnabled()) connection.Trace("Put HTTP/1.1 connection in pool.");
+ return;
}
else
{
- // Add connection to the pool.
- _availableHttp11Connections.Add(connection);
- Debug.Assert(_availableHttp11Connections.Count <= _maxHttp11Connections, $"Expected {_availableHttp11Connections.Count} <= {_maxHttp11Connections}");
- if (NetEventSource.Log.IsEnabled()) connection.Trace("Put connection in pool.");
+ Debug.Assert(_disposed);
+ if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP/1.1 connection returned to pool. Pool was disposed.");
+ connection.Dispose();
return;
}
}
-
- // We determined that the connection is no longer usable.
- connection.Dispose();
}
- public void ReturnHttp2Connection(Http2Connection connection, bool isNewConnection)
+ public void ReturnHttp2Connection(Http2Connection connection, HttpRequestMessage? request = null, bool isNewConnection = false)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"{nameof(isNewConnection)}={isNewConnection}");
+ Debug.Assert(isNewConnection || request is null, "Shouldn't have a request unless the connection is new");
+
if (!isNewConnection && CheckExpirationOnReturn(connection))
{
lock (SyncObj)
@@ -1737,91 +1800,111 @@ public void ReturnHttp2Connection(Http2Connection connection, bool isNewConnecti
_associatedHttp2ConnectionCount--;
}
- if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP/2 connection return to pool. Connection lifetime expired.");
+ if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP2 connection return to pool. Connection lifetime expired.");
connection.Dispose();
return;
}
- bool usable = true;
- bool poolDisposed = false;
- lock (SyncObj)
+ while (connection.TryReserveStream())
{
- Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection));
- Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0));
-
- if (isNewConnection)
+ // Loop in case we get a cancelled request.
+ while (true)
{
- Debug.Assert(_pendingHttp2Connection);
- _pendingHttp2Connection = false;
- }
-
- while (!_http2RequestQueue.IsEmpty)
- {
- Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"With {_availableHttp11Connections.Count} available HTTP2 connections, we shouldn't have a waiter.");
-
- if (!connection.TryReserveStream())
+ TaskCompletionSourceWithCancellation? waiter = null;
+ bool added = false;
+ lock (SyncObj)
{
- usable = false;
+ Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection), $"HTTP2 connection already in available list");
+ Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0),
+ $"Expected _associatedHttp2ConnectionCount={_associatedHttp2ConnectionCount} > _availableHttp2Connections.Count={(_availableHttp2Connections?.Count ?? 0)}");
+
if (isNewConnection)
{
- // The new connection could not handle even one request, either because it shut down before we could use it for any requests,
- // or because it immediately set the max concurrent streams limit to 0.
- // We don't want to get stuck in a loop where we keep trying to create new connections for the same request.
- // Fail the next request, if any.
- HttpRequestException hre = new HttpRequestException(SR.net_http_http2_connection_not_established);
- ExceptionDispatchInfo.SetCurrentStackTrace(hre);
- _http2RequestQueue.TryFailNextRequest(hre);
+ Debug.Assert(_pendingHttp2Connection);
+ _pendingHttp2Connection = false;
+ isNewConnection = false;
}
- break;
- }
- isNewConnection = false;
+ if (_http2RequestQueue.TryDequeueWaiter(out waiter))
+ {
+ Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"With {(_availableHttp2Connections?.Count ?? 0)} available HTTP2 connections, we shouldn't have a waiter.");
+ }
+ else if (_disposed)
+ {
+ // The pool has been disposed. We will dispose this connection below outside the lock.
+ // We do this check after processing the request queue so that any queued requests will be handled by existing connections if possible.
+ _associatedHttp2ConnectionCount--;
+ }
+ else
+ {
+ // Add connection to the pool.
+ added = true;
+ _availableHttp2Connections ??= new List();
+ _availableHttp2Connections.Add(connection);
+ }
+ }
- if (!_http2RequestQueue.TryDequeueNextRequest(connection))
+ if (waiter is not null)
{
- connection.ReleaseStream();
- break;
+ Debug.Assert(!added);
+ if (waiter.TrySetResult(connection))
+ {
+ if (NetEventSource.Log.IsEnabled()) connection.Trace("Dequeued waiting HTTP2 request.");
+ break;
+ }
+ else
+ {
+ Debug.Assert(waiter.Task.IsCanceled);
+ if (NetEventSource.Log.IsEnabled()) connection.Trace("Discarding canceled HTTP2 request from queue.");
+ // Loop and process the queue again
+ }
}
-
- if (NetEventSource.Log.IsEnabled()) connection.Trace("Dequeued waiting HTTP/2 request.");
- }
-
- // Since we only inject one connection at a time, we may want to inject another now.
- CheckForHttp2ConnectionInjection();
-
- if (_disposed)
- {
- // If the pool has been disposed of, we want to dispose the connection being returned, as the pool is being deactivated.
- // We do this after the above in order to satisfy any requests that were queued before the pool was disposed of.
- Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0));
- _associatedHttp2ConnectionCount--;
- poolDisposed = true;
- }
- else if (usable)
- {
- if (_availableHttp2Connections is null)
+ else
{
- _availableHttp2Connections = new List();
+ connection.ReleaseStream();
+ if (added)
+ {
+ if (NetEventSource.Log.IsEnabled()) connection.Trace("Put HTTP2 connection in pool.");
+ return;
+ }
+ else
+ {
+ Debug.Assert(_disposed);
+ if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP2 connection returned to pool. Pool was disposed.");
+ connection.Dispose();
+ return;
+ }
}
-
- // Add connection to the pool.
- _availableHttp2Connections.Add(connection);
- if (NetEventSource.Log.IsEnabled()) connection.Trace("Put HTTP/2 connection in pool.");
- return;
}
}
- if (poolDisposed)
+ if (isNewConnection)
{
- if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP/2 connection returned to pool. Pool was disposed.");
+ Debug.Assert(request is not null, "Expect request for a new connection");
+
+ // The new connection could not handle even one request, either because it shut down before we could use it for any requests,
+ // or because it immediately set the max concurrent streams limit to 0.
+ // We don't want to get stuck in a loop where we keep trying to create new connections for the same request.
+ // So, treat this as a connection failure.
+
+ if (NetEventSource.Log.IsEnabled()) connection.Trace("New HTTP2 connection is unusable due to no available streams.");
connection.Dispose();
- return;
- }
- Debug.Assert(!usable);
+ HttpRequestException hre = new HttpRequestException(SR.net_http_http2_connection_not_established);
+ ExceptionDispatchInfo.SetCurrentStackTrace(hre);
+ HandleHttp2ConnectionFailure(request, hre);
+ }
+ else
+ {
+ // Since we only inject one connection at a time, we may want to inject another now.
+ lock (SyncObj)
+ {
+ CheckForHttp2ConnectionInjection();
+ }
- // We need to wait until the connection is usable again.
- DisableHttp2Connection(connection);
+ // We need to wait until the connection is usable again.
+ DisableHttp2Connection(connection);
+ }
}
///
@@ -1945,6 +2028,7 @@ public bool CleanCacheAndDisposeIfUnused()
{
TimeSpan pooledConnectionLifetime = _poolManager.Settings._pooledConnectionLifetime;
TimeSpan pooledConnectionIdleTimeout = _poolManager.Settings._pooledConnectionIdleTimeout;
+ long nowTicks = Environment.TickCount64;
List? toDispose = null;
@@ -1965,8 +2049,6 @@ public bool CleanCacheAndDisposeIfUnused()
// will be purged next time around.
_usedSinceLastCleanup = false;
- long nowTicks = Environment.TickCount64;
-
ScavengeConnectionList(_availableHttp11Connections, ref toDispose, nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout);
if (_availableHttp2Connections is not null)
{
@@ -2143,66 +2225,43 @@ public TaskCompletionSourceWithCancellation EnqueueRequest(HttpRequestMessage
return waiter;
}
- public bool TryFailNextRequest(Exception e)
+ public bool TryDequeueWaiterForSpecificRequest(HttpRequestMessage request, [MaybeNullWhen(false)] out TaskCompletionSourceWithCancellation waiter)
{
- Debug.Assert(e is HttpRequestException or OperationCanceledException, "Unexpected exception type for connection failure");
-
- if (_queue is not null)
+ if (_queue is not null && _queue.TryPeek(out QueueItem item) && item.Request == request)
{
- // Fail the next queued request (if any) with this error.
- while (_queue.TryDequeue(out QueueItem item))
- {
- // Try to complete the waiter task. If it's been cancelled already, this will fail.
- if (item.Waiter.TrySetException(e))
- {
- return true;
- }
-
- // Couldn't transfer to that waiter because it was cancelled. Try again.
- Debug.Assert(item.Waiter.Task.IsCanceled);
- }
+ _queue.Dequeue();
+ waiter = item.Waiter;
+ return true;
}
+ waiter = null;
return false;
}
- public bool TryDequeueNextRequest(T connection)
+ public bool TryDequeueWaiter([MaybeNullWhen(false)] out TaskCompletionSourceWithCancellation waiter)
{
- if (_queue is not null)
+ if (_queue is not null && _queue.TryDequeue(out QueueItem item))
{
- while (_queue.TryDequeue(out QueueItem item))
- {
- // Try to complete the task. If it's been cancelled already, this will return false.
- if (item.Waiter.TrySetResult(connection))
- {
- return true;
- }
-
- // Couldn't transfer to that waiter because it was cancelled. Try again.
- Debug.Assert(item.Waiter.Task.IsCanceled);
- }
+ waiter = item.Waiter;
+ return true;
}
+ waiter = null;
return false;
}
- public bool TryPeekNextRequest([NotNullWhen(true)] out HttpRequestMessage? request)
+ public bool TryPeekRequest([MaybeNullWhen(false)] out HttpRequestMessage request)
{
- if (_queue is not null)
+ if (_queue is not null && _queue.TryPeek(out QueueItem item))
{
- if (_queue.TryPeek(out QueueItem item))
- {
- request = item.Request;
- return true;
- }
+ request = item.Request;
+ return true;
}
request = null;
return false;
}
- public bool IsEmpty => Count == 0;
-
public int Count => (_queue?.Count ?? 0);
}
}
diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Cancellation.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Cancellation.cs
index e232ee94419897..0c62b3bc3c0c7b 100644
--- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Cancellation.cs
+++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Cancellation.cs
@@ -3,6 +3,7 @@
using System.Diagnostics;
using System.IO;
+using System.Net.Sockets;
using System.Net.Test.Common;
using System.Threading;
using System.Threading.Tasks;
@@ -104,6 +105,97 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
options: new GenericLoopbackOptions() { UseSsl = false });
}
+ [OuterLoop]
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public async Task ConnectionFailure_AfterInitialRequestCancelled_SecondRequestSucceedsOnNewConnection(bool useSsl)
+ {
+ if (UseVersion == HttpVersion.Version30)
+ {
+ // HTTP3 does not support ConnectCallback
+ return;
+ }
+
+ if (!TestAsync)
+ {
+ // Test relies on ordering of async operations, so we can't test the sync case
+ return;
+ }
+
+ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
+ {
+ int connectCount = 0;
+
+ TaskCompletionSource tcsFirstConnectionInitiated = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
+ TaskCompletionSource tcsFirstRequestCanceled = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
+
+ using (var handler = CreateHttpClientHandler())
+ using (var client = CreateHttpClient(handler))
+ {
+ handler.ServerCertificateCustomValidationCallback = TestHelper.AllowAllCertificates;
+ var socketsHandler = GetUnderlyingSocketsHttpHandler(handler);
+ socketsHandler.ConnectCallback = async (context, token) =>
+ {
+ // Note we force serialization of connection creation by waiting on tcsFirstConnectionInitiated below,
+ // so we don't need to worry about concurrent access to connectCount.
+ bool isFirstConnection = connectCount == 0;
+ connectCount++;
+
+ Assert.True(connectCount <= 2);
+
+ if (isFirstConnection)
+ {
+ tcsFirstConnectionInitiated.SetResult();
+ }
+ else
+ {
+ Assert.True(tcsFirstConnectionInitiated.Task.IsCompletedSuccessfully);
+ }
+
+ // Wait until first request is cancelled and has completed
+ await tcsFirstRequestCanceled.Task;
+
+ if (isFirstConnection)
+ {
+ // Fail the first connection attempt
+ throw new Exception("Failing first connection");
+ }
+ else
+ {
+ // Succeed the second connection attempt
+ Socket socket = new Socket(SocketType.Stream, ProtocolType.Tcp) { NoDelay = true };
+ await socket.ConnectAsync(context.DnsEndPoint, token);
+ return new NetworkStream(socket, ownsSocket: true);
+ }
+ };
+
+ using CancellationTokenSource cts = new CancellationTokenSource();
+ Task t1 = client.SendAsync(new HttpRequestMessage(HttpMethod.Get, uri) { Version = UseVersion, VersionPolicy = HttpVersionPolicy.RequestVersionExact }, cts.Token);
+
+ // Wait for the connection attempt to be initiated before we send the second request, to avoid races in connection creation
+ await tcsFirstConnectionInitiated.Task;
+ Task t2 = client.SendAsync(new HttpRequestMessage(HttpMethod.Get, uri) { Version = UseVersion, VersionPolicy = HttpVersionPolicy.RequestVersionExact }, default);
+
+ // Cancel the first message and wait for it to complete
+ cts.Cancel();
+ await Assert.ThrowsAnyAsync(() => t1);
+
+ // Signal connections to proceed
+ tcsFirstRequestCanceled.SetResult();
+
+ // Second request should succeed, even though the first connection failed
+ HttpResponseMessage resp2 = await t2;
+ Assert.Equal(HttpStatusCode.OK, resp2.StatusCode);
+ Assert.Equal("Hello world", await resp2.Content.ReadAsStringAsync());
+ }
+ }, async server =>
+ {
+ await server.AcceptConnectionSendResponseAndCloseAsync(content: "Hello world");
+ },
+ options: new GenericLoopbackOptions() { UseSsl = useSsl });
+ }
+
[OuterLoop("Incurs significant delay")]
[Fact]
public async Task Expect100Continue_WaitsExpectedPeriodOfTimeBeforeSendingContent()
diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/HttpRequestStream.cs b/src/libraries/System.Net.HttpListener/src/System/Net/HttpRequestStream.cs
index 19036503817842..1cf9595c8feb14 100644
--- a/src/libraries/System.Net.HttpListener/src/System/Net/HttpRequestStream.cs
+++ b/src/libraries/System.Net.HttpListener/src/System/Net/HttpRequestStream.cs
@@ -15,10 +15,10 @@ internal partial class HttpRequestStream : Stream
public override int Read(byte[] buffer, int offset, int count)
{
- if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset);
-
ValidateBufferArguments(buffer, offset, count);
+ if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset);
+
if (count == 0 || _closed)
{
return 0;
@@ -29,10 +29,10 @@ public override int Read(byte[] buffer, int offset, int count)
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
{
- if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset);
-
ValidateBufferArguments(buffer, offset, count);
+ if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset);
+
return BeginReadCore(buffer, offset, count, callback, state)!;
}
diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListener.Windows.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListener.Windows.cs
index 63c96497909f3a..48076f1b39a82e 100644
--- a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListener.Windows.cs
+++ b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListener.Windows.cs
@@ -508,7 +508,14 @@ public HttpListenerContext GetContext()
uint size = 4096;
ulong requestId = 0;
memoryBlob = new SyncRequestContext((int)size);
- HttpListenerSession session = _currentSession!;
+ HttpListenerSession? session = _currentSession;
+
+ // Because there is no synchronization, the listener can be stopped or closed while the method is executing,
+ // resulting in a null session
+ if (session == null)
+ {
+ throw new HttpListenerException((int)Interop.HttpApi.ERROR_INVALID_PARAMETER);
+ }
while (true)
{
@@ -617,10 +624,20 @@ public IAsyncResult BeginGetContext(AsyncCallback? callback, object? state)
{
throw new InvalidOperationException(SR.Format(SR.net_listener_mustcall, "Start()"));
}
+
+ HttpListenerSession? session = _currentSession;
+
+ // Because there is no synchronization, the listener can be stopped or closed while the method is executing,
+ // resulting in a null session
+ if (session == null)
+ {
+ throw new HttpListenerException((int)Interop.HttpApi.ERROR_INVALID_PARAMETER);
+ }
+
// prepare the ListenerAsyncResult object (this will have it's own
// event that the user can wait on for IO completion - which means we
// need to signal it when IO completes)
- asyncResult = new ListenerAsyncResult(_currentSession!, state, callback);
+ asyncResult = new ListenerAsyncResult(session, state, callback);
uint statusCode = asyncResult.QueueBeginGetContext();
if (statusCode != Interop.HttpApi.ERROR_SUCCESS &&
statusCode != Interop.HttpApi.ERROR_IO_PENDING)
diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimePart.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimePart.cs
index 218df997c6e22a..84fe52f5f48b9a 100644
--- a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimePart.cs
+++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimePart.cs
@@ -111,8 +111,6 @@ internal void SetContent(Stream stream)
if (_streamSet)
{
_stream!.Close();
- _stream = null;
- _streamSet = false;
}
_stream = stream;
diff --git a/src/libraries/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs b/src/libraries/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs
index b753063dfb4162..5ae74af0bd538c 100644
--- a/src/libraries/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs
+++ b/src/libraries/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs
@@ -155,7 +155,18 @@ public void TryGetAddrInfo_LocalHost_TryGetNameInfo()
Assert.NotNull(aliases);
Assert.NotNull(addresses);
- string name = NameResolutionPal.TryGetNameInfo(addresses[0], out error, out nativeErrorCode);
+ // Not all addresses returned by TryGetAddInfo can be resolved to host names, depending on network configuration.
+ // However at least one should be.
+ string name = null;
+ foreach(IPAddress address in addresses)
+ {
+ name = NameResolutionPal.TryGetNameInfo(address, out error, out nativeErrorCode);
+ if (error != SocketError.HostNotFound)
+ {
+ break;
+ }
+ }
+
Assert.Equal(SocketError.Success, error);
Assert.NotNull(name);
}
@@ -181,12 +192,22 @@ public void TryGetAddrInfo_HostName_TryGetNameInfo()
Assert.NotNull(aliases);
Assert.NotNull(addresses);
- string name = NameResolutionPal.TryGetNameInfo(addresses[0], out error, out nativeErrorCode);
- if (error == SocketError.HostNotFound)
+ // Not all addresses returned by TryGetAddInfo can be resolved to host names, depending on network configuration.
+ // However at least one should be.
+ string name = null;
+ foreach(IPAddress address in addresses)
+ {
+ name = NameResolutionPal.TryGetNameInfo(address, out error, out nativeErrorCode);
+ if (error != SocketError.HostNotFound)
+ {
+ break;
+ }
+ }
+
+ if (error == SocketError.HostNotFound && Environment.OSVersion.Platform == PlatformID.Unix)
{
// On Unix, getaddrinfo returns private ipv4 address for hostname. If the OS doesn't have the
// reverse dns lookup entry for this address, getnameinfo returns host not found.
- Assert.Equal(PlatformID.Unix, Environment.OSVersion.Platform);
return;
}
diff --git a/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/IcmpV4MessageConstants.cs b/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/IcmpV4MessageConstants.cs
index 6fcf1794a11c2a..4794b9b720f39f 100644
--- a/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/IcmpV4MessageConstants.cs
+++ b/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/IcmpV4MessageConstants.cs
@@ -53,38 +53,22 @@ internal static class IcmpV4MessageConstants
{
public static IPStatus MapV4TypeToIPStatus(int type, int code)
{
- switch ((IcmpV4MessageType)type)
+ return (IcmpV4MessageType)type switch
{
- case IcmpV4MessageType.EchoReply:
- return IPStatus.Success;
-
- case IcmpV4MessageType.DestinationUnreachable:
- switch ((IcmpV4DestinationUnreachableCode)code)
- {
- case IcmpV4DestinationUnreachableCode.DestinationNetworkUnreachable:
- return IPStatus.DestinationNetworkUnreachable;
- case IcmpV4DestinationUnreachableCode.DestinationHostUnreachable:
- return IPStatus.DestinationHostUnreachable;
- case IcmpV4DestinationUnreachableCode.DestinationProtocolUnreachable:
- return IPStatus.DestinationProtocolUnreachable;
- case IcmpV4DestinationUnreachableCode.DestinationPortUnreachable:
- return IPStatus.DestinationPortUnreachable;
- default:
- return IPStatus.DestinationUnreachable;
- }
-
- case IcmpV4MessageType.SourceQuench:
- return IPStatus.SourceQuench;
-
- case IcmpV4MessageType.TimeExceeded:
- return IPStatus.TimeExceeded;
-
- case IcmpV4MessageType.ParameterProblemBadIPHeader:
- return IPStatus.BadHeader;
-
- default:
- return IPStatus.Unknown;
- }
+ IcmpV4MessageType.EchoReply => IPStatus.Success,
+ IcmpV4MessageType.DestinationUnreachable => (IcmpV4DestinationUnreachableCode)code switch
+ {
+ IcmpV4DestinationUnreachableCode.DestinationNetworkUnreachable => IPStatus.DestinationNetworkUnreachable,
+ IcmpV4DestinationUnreachableCode.DestinationHostUnreachable => IPStatus.DestinationHostUnreachable,
+ IcmpV4DestinationUnreachableCode.DestinationProtocolUnreachable => IPStatus.DestinationProtocolUnreachable,
+ IcmpV4DestinationUnreachableCode.DestinationPortUnreachable => IPStatus.DestinationPortUnreachable,
+ _ => IPStatus.DestinationUnreachable,
+ },
+ IcmpV4MessageType.SourceQuench => IPStatus.SourceQuench,
+ IcmpV4MessageType.TimeExceeded => IPStatus.TtlExpired,
+ IcmpV4MessageType.ParameterProblemBadIPHeader => IPStatus.BadHeader,
+ _ => IPStatus.Unknown,
+ };
}
}
}
diff --git a/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/IcmpV6MessageConstants.cs b/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/IcmpV6MessageConstants.cs
index d0a098cf342d6f..e00a236a282bc9 100644
--- a/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/IcmpV6MessageConstants.cs
+++ b/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/IcmpV6MessageConstants.cs
@@ -54,52 +54,30 @@ internal static class IcmpV6MessageConstants
{
public static IPStatus MapV6TypeToIPStatus(byte type, byte code)
{
- switch ((IcmpV6MessageType)type)
+ return (IcmpV6MessageType)type switch
{
- case IcmpV6MessageType.EchoReply:
- return IPStatus.Success;
-
- case IcmpV6MessageType.DestinationUnreachable:
- switch ((IcmpV6DestinationUnreachableCode)code)
- {
- case IcmpV6DestinationUnreachableCode.NoRouteToDestination:
- return IPStatus.BadRoute;
- case IcmpV6DestinationUnreachableCode.SourceRoutingHeaderError:
- return IPStatus.BadHeader;
- default:
- return IPStatus.DestinationUnreachable;
- }
-
- case IcmpV6MessageType.PacketTooBig:
- return IPStatus.PacketTooBig;
-
- case IcmpV6MessageType.TimeExceeded:
- switch ((IcmpV6TimeExceededCode)code)
- {
- case IcmpV6TimeExceededCode.HopLimitExceeded:
- return IPStatus.TimeExceeded;
- case IcmpV6TimeExceededCode.FragmentReassemblyTimeExceeded:
- return IPStatus.TtlReassemblyTimeExceeded;
- default:
- return IPStatus.TimeExceeded;
- }
-
- case IcmpV6MessageType.ParameterProblem:
- switch ((IcmpV6ParameterProblemCode)code)
- {
- case IcmpV6ParameterProblemCode.ErroneousHeaderField:
- return IPStatus.BadHeader;
- case IcmpV6ParameterProblemCode.UnrecognizedNextHeader:
- return IPStatus.UnrecognizedNextHeader;
- case IcmpV6ParameterProblemCode.UnrecognizedIpv6Option:
- return IPStatus.BadOption;
- default:
- return IPStatus.ParameterProblem;
- }
-
- default:
- return IPStatus.Unknown;
- }
+ IcmpV6MessageType.EchoReply => IPStatus.Success,
+ IcmpV6MessageType.DestinationUnreachable => (IcmpV6DestinationUnreachableCode)code switch
+ {
+ IcmpV6DestinationUnreachableCode.NoRouteToDestination => IPStatus.BadRoute,
+ IcmpV6DestinationUnreachableCode.SourceRoutingHeaderError => IPStatus.BadHeader,
+ _ => IPStatus.DestinationUnreachable,
+ },
+ IcmpV6MessageType.PacketTooBig => IPStatus.PacketTooBig,
+ IcmpV6MessageType.TimeExceeded => (IcmpV6TimeExceededCode)code switch
+ {
+ IcmpV6TimeExceededCode.FragmentReassemblyTimeExceeded => IPStatus.TtlReassemblyTimeExceeded,
+ _ => IPStatus.TtlExpired,
+ },
+ IcmpV6MessageType.ParameterProblem => (IcmpV6ParameterProblemCode)code switch
+ {
+ IcmpV6ParameterProblemCode.ErroneousHeaderField => IPStatus.BadHeader,
+ IcmpV6ParameterProblemCode.UnrecognizedNextHeader => IPStatus.UnrecognizedNextHeader,
+ IcmpV6ParameterProblemCode.UnrecognizedIpv6Option => IPStatus.BadOption,
+ _ => IPStatus.ParameterProblem,
+ },
+ _ => IPStatus.Unknown,
+ };
}
}
}
diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs
index 0ddef7980c836f..d59c76ce47228a 100644
--- a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs
+++ b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs
@@ -28,7 +28,7 @@ internal sealed class CipherSuitesPolicyPal
internal CipherSuitesPolicyPal(IEnumerable allowedCipherSuites)
{
- if (!Interop.Ssl.Tls13Supported)
+ if (!Interop.Ssl.Capabilities.Tls13Supported)
{
throw new PlatformNotSupportedException(SR.net_ssl_ciphersuites_policy_not_supported);
}
diff --git a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoArmIntrinsics.xml b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoArmIntrinsics.xml
index d30ea62e250f4f..1da6f6d57d26e3 100644
--- a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoArmIntrinsics.xml
+++ b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoArmIntrinsics.xml
@@ -1,52 +1,55 @@
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoX86Intrinsics.xml b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoX86Intrinsics.xml
index 59d0783d0a7895..50dababbb347c4 100644
--- a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoX86Intrinsics.xml
+++ b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoX86Intrinsics.xml
@@ -1,5 +1,8 @@
+
+
+
diff --git a/src/libraries/System.Private.CoreLib/src/Internal/Padding.cs b/src/libraries/System.Private.CoreLib/src/Internal/Padding.cs
index 17f3643be3e469..5f846ce3f8b985 100644
--- a/src/libraries/System.Private.CoreLib/src/Internal/Padding.cs
+++ b/src/libraries/System.Private.CoreLib/src/Internal/Padding.cs
@@ -9,7 +9,7 @@ namespace Internal
internal static class PaddingHelpers
{
/// A size greater than or equal to the size of the most common CPU cache lines.
-#if TARGET_ARM64
+#if TARGET_ARM64 || TARGET_LOONGARCH64
internal const int CACHE_LINE_SIZE = 128;
#else
internal const int CACHE_LINE_SIZE = 64;
diff --git a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
index 57a9c28c693960..f98789424343b4 100644
--- a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
+++ b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
@@ -1021,10 +1021,10 @@
Must complete Convert() operation or call Encoder.Reset() before calling GetBytes() or GetByteCount(). Encoder '{0}' fallback '{1}'.
- The output byte buffer is too small to contain the encoded data, encoding '{0}' fallback '{1}'.
+ The output byte buffer is too small to contain the encoded data, encoding codepage '{0}' and fallback '{1}'.
- The output char buffer is too small to contain the decoded characters, encoding '{0}' fallback '{1}'.
+ The output char buffer is too small to contain the decoded characters, encoding codepage '{0}' and fallback '{1}'.'{0}' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
@@ -1824,7 +1824,7 @@
Pointer startIndex and length do not refer to a valid string.
- Period must be less than 2^32-2.
+ Period must be less than 2^32-1.The position may not be greater or equal to the capacity of the accessor.
@@ -1854,7 +1854,7 @@
Stream length must be non-negative and less than 2^31 - 1 - origin.
- Time-out interval must be less than 2^32-2.
+ Time-out interval must be less than 2^32-1.The length of the buffer must be less than the maximum UIntPtr value for your platform.
diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
index 24b049b1df2ff1..5c3b0ad8ed3ae2 100644
--- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
+++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
@@ -17,7 +17,7 @@
true$(MSBuildThisFileDirectory)ILLink\true
- true
+ truetrue
@@ -41,7 +41,7 @@
-
+
diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffer.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Buffer.Unix.cs
index 4d0c18ca9d7108..008bc9310a2417 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Buffer.Unix.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Buffer.Unix.cs
@@ -5,7 +5,7 @@ namespace System
{
public static partial class Buffer
{
-#if TARGET_ARM64
+#if TARGET_ARM64 || TARGET_LOONGARCH64
// Managed code is currently faster than glibc unoptimized memmove
// TODO-ARM64-UNIX-OPT revisit when glibc optimized memmove is in Linux distros
// https://github.com/dotnet/runtime/issues/8897
diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffer.cs b/src/libraries/System.Private.CoreLib/src/System/Buffer.cs
index 64bd6fca168e33..027c138d1ac6aa 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Buffer.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Buffer.cs
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-#if TARGET_AMD64 || TARGET_ARM64 || (TARGET_32BIT && !TARGET_ARM)
+#if TARGET_AMD64 || TARGET_ARM64 || (TARGET_32BIT && !TARGET_ARM) || TARGET_LOONGARCH64
#define HAS_CUSTOM_BLOCKS
#endif
diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs
index a9b9274952ae0a..02c846c457beea 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs
@@ -14,7 +14,7 @@ public partial class CompareInfo
[NonSerialized]
private bool _isAsciiEqualityOrdinal;
- private void IcuInitSortHandle()
+ private void IcuInitSortHandle(string interopCultureName)
{
if (GlobalizationMode.Invariant)
{
@@ -23,6 +23,7 @@ private void IcuInitSortHandle()
else
{
Debug.Assert(!GlobalizationMode.UseNls);
+ Debug.Assert(interopCultureName != null);
// Inline the following condition to avoid potential implementation cycles within globalization
//
@@ -31,7 +32,7 @@ private void IcuInitSortHandle()
_isAsciiEqualityOrdinal = _sortName.Length == 0 ||
(_sortName.Length >= 2 && _sortName[0] == 'e' && _sortName[1] == 'n' && (_sortName.Length == 2 || _sortName[2] == '-'));
- _sortHandle = SortHandleCache.GetCachedSortHandle(_sortName);
+ _sortHandle = SortHandleCache.GetCachedSortHandle(interopCultureName);
}
}
diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs
index b8e7d60a24ed18..bf68d1214d3616 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs
@@ -191,7 +191,7 @@ private void InitSort(CultureInfo culture)
}
else
{
- IcuInitSortHandle();
+ IcuInitSortHandle(culture.InteropName!);
}
}
diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Icu.cs
index 0d2035b9b40e14..85bf08e06095ac 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Icu.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Icu.cs
@@ -50,7 +50,11 @@ private bool InitIcuCultureDataCore()
index = _sWindowsName.IndexOf(ICU_COLLATION_KEYWORD, StringComparison.Ordinal);
if (index >= 0)
{
- _sName = string.Concat(_sWindowsName.AsSpan(0, index), "_", alternateSortName);
+ // Use original culture name if alternateSortName is not set, which is possible even if the normalized
+ // culture name has "@collation=".
+ // "zh-TW-u-co-zhuyin" is a good example. The term "u-co-" means the following part will be the sort name
+ // and it will be treated in ICU as "zh-TW@collation=zhuyin".
+ _sName = alternateSortName.Length == 0 ? realNameBuffer : string.Concat(_sWindowsName.AsSpan(0, index), "_", alternateSortName);
}
else
{
diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs
index 6b0c66fbd361a2..d92419490f16f6 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs
@@ -413,6 +413,12 @@ internal sealed partial class CultureData
private static volatile Dictionary? s_cachedRegions;
private static volatile Dictionary? s_regionNames;
+ ///
+ /// The culture name to use to interop with the underlying native globalization libraries like ICU or Windows NLS APIs.
+ /// For example, we can have the name de_DE@collation=phonebook when using ICU for the German culture de-DE with the phonebook sorting behavior.
+ ///
+ internal string? InteropName => _sWindowsName;
+
internal static CultureData? GetCultureDataForRegion(string? cultureName, bool useUserOverride)
{
// First do a shortcut for Invariant
diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.cs
index c0870e1f7a863e..baf1e6dd215017 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.cs
@@ -580,6 +580,12 @@ public static CultureInfo[] GetCultures(CultureTypes types)
///
internal string SortName => _sortName ??= _cultureData.SortName;
+ ///
+ /// The culture name to use to interop with the underlying native globalization libraries like ICU or Windows NLS APIs.
+ /// For example, we can have the name de_DE@collation=phonebook when using ICU for the German culture de-DE with the phonebook sorting behavior.
+ ///
+ internal string? InteropName => _cultureData.InteropName;
+
public string IetfLanguageTag =>
// special case the compatibility cultures
Name switch
diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs
index 70c36a619ec635..86ad06f841e37d 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs
@@ -4,6 +4,7 @@
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
using Internal.Runtime.CompilerServices;
@@ -311,17 +312,19 @@ public static Vector ConditionalSelect(Vector condition, VectorThe vector to convert.
/// The converted vector.
[Intrinsic]
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe Vector ConvertToDouble(Vector value)
{
- Unsafe.SkipInit(out Vector result);
-
- for (int i = 0; i < Vector.Count; i++)
+ if (Avx2.IsSupported)
{
- var element = (double)value.GetElementUnsafe(i);
- result.SetElementUnsafe(i, element);
+ Debug.Assert(Vector.Count == Vector256.Count);
+ return Vector256.ConvertToDouble(value.AsVector256()).AsVector();
+ }
+ else
+ {
+ Debug.Assert(Vector.Count == Vector128.Count);
+ return Vector128.ConvertToDouble(value.AsVector128()).AsVector();
}
-
- return result;
}
/// Converts a to a .
@@ -329,17 +332,19 @@ public static unsafe Vector ConvertToDouble(Vector value)
/// The converted vector.
[CLSCompliant(false)]
[Intrinsic]
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe Vector ConvertToDouble(Vector value)
{
- Unsafe.SkipInit(out Vector result);
-
- for (int i = 0; i < Vector.Count; i++)
+ if (Avx2.IsSupported)
{
- var element = (double)value.GetElementUnsafe(i);
- result.SetElementUnsafe(i, element);
+ Debug.Assert(Vector.Count == Vector256.Count);
+ return Vector256.ConvertToDouble(value.AsVector256()).AsVector();
+ }
+ else
+ {
+ Debug.Assert(Vector.Count == Vector128.Count);
+ return Vector128.ConvertToDouble(value.AsVector128()).AsVector();
}
-
- return result;
}
/// Converts a to a .
@@ -398,17 +403,19 @@ public static unsafe Vector ConvertToSingle(Vector value)
/// The converted vector.
[CLSCompliant(false)]
[Intrinsic]
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe Vector ConvertToSingle(Vector value)
{
- Unsafe.SkipInit(out Vector result);
-
- for (int i = 0; i < Vector.Count; i++)
+ if (Avx2.IsSupported)
{
- var element = (float)value.GetElementUnsafe(i);
- result.SetElementUnsafe(i, element);
+ Debug.Assert(Vector.Count == Vector256.Count);
+ return Vector256.ConvertToSingle(value.AsVector256()).AsVector();
+ }
+ else
+ {
+ Debug.Assert(Vector.Count == Vector128.Count);
+ return Vector128.ConvertToSingle(value.AsVector128()).AsVector();
}
-
- return result;
}
/// Converts a to a .
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs
index 29e39d69d3303d..e12808600c45d8 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs
@@ -75,7 +75,7 @@ internal unsafe ref struct QCallAssembly
internal QCallAssembly(ref System.Reflection.RuntimeAssembly assembly)
{
_ptr = Unsafe.AsPointer(ref assembly);
- _assembly = assembly.GetUnderlyingNativeHandle();
+ _assembly = assembly?.GetUnderlyingNativeHandle() ?? IntPtr.Zero;
}
}
@@ -88,10 +88,7 @@ internal unsafe ref struct QCallTypeHandle
internal QCallTypeHandle(ref System.RuntimeType type)
{
_ptr = Unsafe.AsPointer(ref type);
- if (type != null)
- _handle = type.GetUnderlyingNativeHandle();
- else
- _handle = IntPtr.Zero;
+ _handle = type?.GetUnderlyingNativeHandle() ?? IntPtr.Zero;
}
internal QCallTypeHandle(ref System.RuntimeTypeHandle rth)
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs
index ddaf26982c575d..8187320ec97683 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs
@@ -114,7 +114,7 @@ internal static bool IsPrimitiveType(this CorElementType et)
/// A field handle that specifies the location of the data to be referred to by the ReadOnlySpan{T}. The Rva of the field must be aligned on a natural boundary of type T
/// A ReadOnlySpan{T} of the data stored in the field
/// does not refer to a field which is an Rva, is misaligned, or T is of an invalid type.
- /// This method is intended for compiler user rather than use directly in code. T must be one of byte, sbyte, char, short, ushort, int, long, ulong, float, or double.
+ /// This method is intended for compiler use rather than use directly in code. T must be one of byte, sbyte, char, short, ushort, int, long, ulong, float, or double.
[Intrinsic]
public static unsafe ReadOnlySpan CreateSpan(RuntimeFieldHandle fldHandle) => new ReadOnlySpan(GetSpanDataFrom(fldHandle, typeof(T).TypeHandle, out int length), length);
}
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/TaskAwaiter.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/TaskAwaiter.cs
index 7e3666d23314d7..913cf3ae13abf5 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/TaskAwaiter.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/TaskAwaiter.cs
@@ -88,7 +88,7 @@ public void OnCompleted(Action continuation)
/// The action to invoke when the await operation completes.
/// The argument is null (Nothing in Visual Basic).
/// The awaiter was not properly initialized.
- /// This method is intended for compiler user rather than use directly in code.
+ /// This method is intended for compiler use rather than use directly in code.
public void UnsafeOnCompleted(Action continuation)
{
OnCompletedInternal(m_task, continuation, continueOnCapturedContext: true, flowExecutionContext: false);
@@ -197,7 +197,7 @@ private static void ThrowForNonSuccess(Task task)
/// Whether to flow ExecutionContext across the await.
/// The argument is null (Nothing in Visual Basic).
/// The awaiter was not properly initialized.
- /// This method is intended for compiler user rather than use directly in code.
+ /// This method is intended for compiler use rather than use directly in code.
internal static void OnCompletedInternal(Task task, Action continuation, bool continueOnCapturedContext, bool flowExecutionContext)
{
if (continuation == null) throw new ArgumentNullException(nameof(continuation));
@@ -336,7 +336,7 @@ internal TaskAwaiter(Task task)
/// The action to invoke when the await operation completes.
/// The argument is null (Nothing in Visual Basic).
/// The awaiter was not properly initialized.
- /// This method is intended for compiler user rather than use directly in code.
+ /// This method is intended for compiler use rather than use directly in code.
public void OnCompleted(Action continuation)
{
TaskAwaiter.OnCompletedInternal(m_task, continuation, continueOnCapturedContext: true, flowExecutionContext: true);
@@ -346,7 +346,7 @@ public void OnCompleted(Action continuation)
/// The action to invoke when the await operation completes.
/// The argument is null (Nothing in Visual Basic).
/// The awaiter was not properly initialized.
- /// This method is intended for compiler user rather than use directly in code.
+ /// This method is intended for compiler use rather than use directly in code.
public void UnsafeOnCompleted(Action continuation)
{
TaskAwaiter.OnCompletedInternal(m_task, continuation, continueOnCapturedContext: true, flowExecutionContext: false);
@@ -438,7 +438,7 @@ internal ConfiguredTaskAwaiter(Task task, bool continueOnCapturedContext)
/// The action to invoke when the await operation completes.
/// The argument is null (Nothing in Visual Basic).
/// The awaiter was not properly initialized.
- /// This method is intended for compiler user rather than use directly in code.
+ /// This method is intended for compiler use rather than use directly in code.
public void OnCompleted(Action continuation)
{
TaskAwaiter.OnCompletedInternal(m_task, continuation, m_continueOnCapturedContext, flowExecutionContext: true);
@@ -448,7 +448,7 @@ public void OnCompleted(Action continuation)
/// The action to invoke when the await operation completes.
/// The argument is null (Nothing in Visual Basic).
/// The awaiter was not properly initialized.
- /// This method is intended for compiler user rather than use directly in code.
+ /// This method is intended for compiler use rather than use directly in code.
public void UnsafeOnCompleted(Action continuation)
{
TaskAwaiter.OnCompletedInternal(m_task, continuation, m_continueOnCapturedContext, flowExecutionContext: false);
@@ -523,7 +523,7 @@ internal ConfiguredTaskAwaiter(Task task, bool continueOnCapturedContex
/// The action to invoke when the await operation completes.
/// The argument is null (Nothing in Visual Basic).
/// The awaiter was not properly initialized.
- /// This method is intended for compiler user rather than use directly in code.
+ /// This method is intended for compiler use rather than use directly in code.
public void OnCompleted(Action continuation)
{
TaskAwaiter.OnCompletedInternal(m_task, continuation, m_continueOnCapturedContext, flowExecutionContext: true);
@@ -533,7 +533,7 @@ public void OnCompleted(Action continuation)
/// The action to invoke when the await operation completes.
/// The argument is null (Nothing in Visual Basic).
/// The awaiter was not properly initialized.
- /// This method is intended for compiler user rather than use directly in code.
+ /// This method is intended for compiler use rather than use directly in code.
public void UnsafeOnCompleted(Action continuation)
{
TaskAwaiter.OnCompletedInternal(m_task, continuation, m_continueOnCapturedContext, flowExecutionContext: false);
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/YieldAwaitable.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/YieldAwaitable.cs
index 7500cba3d4e303..3e17c5b74d973c 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/YieldAwaitable.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/YieldAwaitable.cs
@@ -38,7 +38,7 @@ public readonly struct YieldAwaitable
{
/// Gets an awaiter for this .
/// An awaiter for this awaitable.
- /// This method is intended for compiler user rather than use directly in code.
+ /// This method is intended for compiler use rather than use directly in code.
public YieldAwaiter GetAwaiter() { return default; }
/// Provides an awaiter that switches into a target environment.
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Architecture.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Architecture.cs
index 2c52a9b8ea433c..225fec28c763ac 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Architecture.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Architecture.cs
@@ -10,6 +10,7 @@ public enum Architecture
Arm,
Arm64,
Wasm,
- S390x
+ S390x,
+ LoongArch64
}
}
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/RuntimeInformation.ProcessArchitecture.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/RuntimeInformation.ProcessArchitecture.cs
index 298d0395042990..0da595b95e0746 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/RuntimeInformation.ProcessArchitecture.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/RuntimeInformation.ProcessArchitecture.cs
@@ -18,6 +18,8 @@ public static Architecture ProcessArchitecture
=> Architecture.Wasm;
#elif TARGET_S390X
=> Architecture.S390x;
+#elif TARGET_LOONGARCH64
+ => Architecture.LoongArch64;
#else
#error Unknown Architecture
#endif
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/SafeBuffer.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/SafeBuffer.cs
index e2a3b7bdecd9aa..3e7f204573ca05 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/SafeBuffer.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/SafeBuffer.cs
@@ -153,6 +153,8 @@ public void AcquirePointer(ref byte* pointer)
if (_numBytes == Uninitialized)
throw NotInitialized();
+ pointer = null;
+
bool junk = false;
DangerousAddRef(ref junk);
pointer = (byte*)handle;
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs
index 445a0af111baa9..1acc80f5be335c 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs
@@ -170,6 +170,25 @@ public static Vector128 AsInt32(this Vector128 vector)
public static Vector128 AsInt64(this Vector128 vector)
where T : struct => vector.As();
+ /// Reinterprets a as a new .
+ /// The type of the input vector.
+ /// The vector to reinterpret.
+ /// reinterpreted as a new .
+ /// The type of () is not supported.
+ [Intrinsic]
+ public static Vector128 AsNInt(this Vector128 vector)
+ where T : struct => vector.As();
+
+ /// Reinterprets a as a new .
+ /// The type of the input vector.
+ /// The vector to reinterpret.
+ /// reinterpreted as a new .
+ /// The type of () is not supported.
+ [Intrinsic]
+ [CLSCompliant(false)]
+ public static Vector128 AsNUInt(this Vector128 vector)
+ where T : struct => vector.As();
+
/// Reinterprets a as a new .
/// The type of the input vector.
/// The vector to reinterpret.
@@ -359,17 +378,50 @@ public static Vector128 ConditionalSelect(Vector128 condition, Vector12
/// The vector to convert.
/// The converted vector.
[Intrinsic]
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe Vector128 ConvertToDouble(Vector128 vector)
{
- Unsafe.SkipInit(out Vector128 result);
+ if (Sse2.IsSupported)
+ {
+ // Based on __m256d int64_to_double_fast_precise(const __m256i v)
+ // from https://stackoverflow.com/a/41223013/12860347. CC BY-SA 4.0
- for (int i = 0; i < Vector128.Count; i++)
+ Vector128 lowerBits;
+
+ if (Avx2.IsSupported)
+ {
+ lowerBits = vector.AsInt32();
+ lowerBits = Avx2.Blend(lowerBits, Create(0x43300000_00000000).AsInt32(), 0b1010); // Blend the 32 lowest significant bits of vector with the bit representation of double(2^52)
+ }
+ else
+ {
+ lowerBits = Sse2.And(vector, Create(0x00000000_FFFFFFFFL)).AsInt32();
+ lowerBits = Sse2.Or(lowerBits, Create(0x43300000_00000000).AsInt32());
+ }
+
+ var upperBits = Sse2.ShiftRightLogical(vector, 32); // Extract the 32 most significant bits of vector
+ upperBits = Sse2.Xor(upperBits, Create(0x45300000_80000000)); // Flip the msb of upperBits and blend with the bit representation of double(2^84 + 2^63)
+
+ var result = Sse2.Subtract(upperBits.AsDouble(), Create(0x45300000_80100000).AsDouble()); // Compute in double precision: (upper - (2^84 + 2^63 + 2^52)) + lower
+ return Sse2.Add(result, lowerBits.AsDouble());
+ }
+ else
{
- var value = (double)vector.GetElementUnsafe(i);
- result.SetElementUnsafe(i, value);
+ return SoftwareFallback(vector);
}
- return result;
+ static Vector128 SoftwareFallback(Vector128 vector)
+ {
+ Unsafe.SkipInit(out Vector128 result);
+
+ for (int i = 0; i < Vector128.Count; i++)
+ {
+ var value = (double)vector.GetElementUnsafe(i);
+ result.SetElementUnsafe(i, value);
+ }
+
+ return result;
+ }
}
/// Converts a to a .
@@ -377,17 +429,50 @@ public static unsafe Vector128 ConvertToDouble(Vector128 vector)
/// The converted vector.
[CLSCompliant(false)]
[Intrinsic]
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe Vector128 ConvertToDouble(Vector128 vector)
{
- Unsafe.SkipInit(out Vector128 result);
+ if (Sse2.IsSupported)
+ {
+ // Based on __m256d uint64_to_double_fast_precise(const __m256i v)
+ // from https://stackoverflow.com/a/41223013/12860347. CC BY-SA 4.0
- for (int i = 0; i < Vector128.Count; i++)
+ Vector128 lowerBits;
+
+ if (Avx2.IsSupported)
+ {
+ lowerBits = vector.AsUInt32();
+ lowerBits = Avx2.Blend(lowerBits, Create(0x43300000_00000000UL).AsUInt32(), 0b1010); // Blend the 32 lowest significant bits of vector with the bit representation of double(2^52)
+ }
+ else
+ {
+ lowerBits = Sse2.And(vector, Create(0x00000000_FFFFFFFFUL)).AsUInt32();
+ lowerBits = Sse2.Or(lowerBits, Create(0x43300000_00000000UL).AsUInt32());
+ }
+
+ var upperBits = Sse2.ShiftRightLogical(vector, 32); // Extract the 32 most significant bits of vector
+ upperBits = Sse2.Xor(upperBits, Create(0x45300000_00000000UL)); // Blend upperBits with the bit representation of double(2^84)
+
+ var result = Sse2.Subtract(upperBits.AsDouble(), Create(0x45300000_00100000UL).AsDouble()); // Compute in double precision: (upper - (2^84 + 2^52)) + lower
+ return Sse2.Add(result, lowerBits.AsDouble());
+ }
+ else
{
- var value = (double)vector.GetElementUnsafe(i);
- result.SetElementUnsafe(i, value);
+ return SoftwareFallback(vector);
}
- return result;
+ static Vector128 SoftwareFallback(Vector128 vector)
+ {
+ Unsafe.SkipInit(out Vector128 result);
+
+ for (int i = 0; i < Vector128.Count; i++)
+ {
+ var value = (double)vector.GetElementUnsafe(i);
+ result.SetElementUnsafe(i, value);
+ }
+
+ return result;
+ }
}
/// Converts a to a .
@@ -446,17 +531,56 @@ public static unsafe Vector128 ConvertToSingle(Vector128 vector)
/// The converted vector.
[CLSCompliant(false)]
[Intrinsic]
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe Vector128 ConvertToSingle(Vector128 vector)
{
- Unsafe.SkipInit(out Vector128 result);
+ if (Sse2.IsSupported)
+ {
+ // This first bit of magic works because float can exactly represent integers up to 2^24
+ //
+ // This means everything between 0 and 2^16 (ushort.MaxValue + 1) are exact and so
+ // converting each of the upper and lower halves will give an exact result
- for (int i = 0; i < Vector128.Count; i++)
+ var lowerBits = Sse2.And(vector, Create(0x0000FFFFU)).AsInt32();
+ var upperBits = Sse2.ShiftRightLogical(vector, 16).AsInt32();
+
+ var lower = Sse2.ConvertToVector128Single(lowerBits);
+ var upper = Sse2.ConvertToVector128Single(upperBits);
+
+ // This next bit of magic works because all multiples of 65536, at least up to 65535
+ // are likewise exactly representable
+ //
+ // This means that scaling upper by 65536 gives us the exactly representable base value
+ // and then the remaining lower value, which is likewise up to 65535 can be added on
+ // giving us a result that will correctly round to the nearest representable value
+
+ if (Fma.IsSupported)
+ {
+ return Fma.MultiplyAdd(upper, Vector128.Create(65536.0f), lower);
+ }
+ else
+ {
+ var result = Sse.Multiply(upper, Vector128.Create(65536.0f));
+ return Sse.Add(result, lower);
+ }
+ }
+ else
{
- var value = (float)vector.GetElementUnsafe(i);
- result.SetElementUnsafe(i, value);
+ return SoftwareFallback(vector);
}
- return result;
+ static Vector128 SoftwareFallback(Vector128 vector)
+ {
+ Unsafe.SkipInit(out Vector128 result);
+
+ for (int i = 0; i < Vector128.Count; i++)
+ {
+ var value = (float)vector.GetElementUnsafe(i);
+ result.SetElementUnsafe(i, value);
+ }
+
+ return result;
+ }
}
/// Converts a to a .
@@ -759,6 +883,59 @@ static Vector128 SoftwareFallback(long value)
}
}
+ /// Creates a new instance with all elements initialized to the specified value.
+ /// The value that all elements will be initialized to.
+ /// A new with all elements initialized to .
+ [Intrinsic]
+ public static unsafe Vector128 Create(nint value)
+ {
+ if (Sse2.IsSupported || AdvSimd.IsSupported)
+ {
+ return Create(value);
+ }
+
+ return SoftwareFallback(value);
+
+ static Vector128 SoftwareFallback(nint value)
+ {
+ if (Environment.Is64BitProcess)
+ {
+ return Create((long)value).AsNInt();
+ }
+ else
+ {
+ return Create((int)value).AsNInt();
+ }
+ }
+ }
+
+ /// Creates a new instance with all elements initialized to the specified value.
+ /// The value that all elements will be initialized to.
+ /// A new with all elements initialized to .
+ [Intrinsic]
+ [CLSCompliant(false)]
+ public static unsafe Vector128 Create(nuint value)
+ {
+ if (Sse2.IsSupported || AdvSimd.IsSupported)
+ {
+ return Create(value);
+ }
+
+ return SoftwareFallback(value);
+
+ static Vector128 SoftwareFallback(nuint value)
+ {
+ if (Environment.Is64BitProcess)
+ {
+ return Create((ulong)value).AsNUInt();
+ }
+ else
+ {
+ return Create((uint)value).AsNUInt();
+ }
+ }
+ }
+
/// Creates a new instance with all elements initialized to the specified value.
/// The value that all elements will be initialized to.
/// On x86, this method corresponds to __m128i _mm_set1_epi8
@@ -1712,6 +1889,7 @@ static Vector128 SoftwareFallback(int value)
/// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero.
/// The value that element 0 will be initialized to.
/// A new instance with the first element initialized to and the remaining elements initialized to zero.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe Vector128 CreateScalar(long value)
{
if (AdvSimd.IsSupported)
@@ -1734,6 +1912,39 @@ static Vector128 SoftwareFallback(long value)
}
}
+ /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero.
+ /// The value that element 0 will be initialized to.
+ /// A new instance with the first element initialized to and the remaining elements initialized to zero.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static unsafe Vector128 CreateScalar(nint value)
+ {
+ if (Environment.Is64BitProcess)
+ {
+ return CreateScalar((long)value).AsNInt();
+ }
+ else
+ {
+ return CreateScalar((int)value).AsNInt();
+ }
+ }
+
+ /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero.
+ /// The value that element 0 will be initialized to.
+ /// A new instance with the first element initialized to and the remaining elements initialized to zero.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [CLSCompliant(false)]
+ public static unsafe Vector128 CreateScalar(nuint value)
+ {
+ if (Environment.Is64BitProcess)
+ {
+ return CreateScalar((ulong)value).AsNUInt();
+ }
+ else
+ {
+ return CreateScalar((uint)value).AsNUInt();
+ }
+ }
+
/// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero.
/// The value that element 0 will be initialized to.
/// A new instance with the first element initialized to and the remaining elements initialized to zero.
@@ -1942,6 +2153,39 @@ public static unsafe Vector128 CreateScalarUnsafe(long value)
return Unsafe.AsRef>(pResult);
}
+ /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized.
+ /// The value that element 0 will be initialized to.
+ /// A new instance with the first element initialized to and the remaining elements left uninitialized.
+ [Intrinsic]
+ public static unsafe Vector128 CreateScalarUnsafe(nint value)
+ {
+ if (Environment.Is64BitProcess)
+ {
+ return CreateScalarUnsafe((long)value).AsNInt();
+ }
+ else
+ {
+ return CreateScalarUnsafe((int)value).AsNInt();
+ }
+ }
+
+ /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized.
+ /// The value that element 0 will be initialized to.
+ /// A new instance with the first element initialized to and the remaining elements left uninitialized.
+ [Intrinsic]
+ [CLSCompliant(false)]
+ public static unsafe Vector128 CreateScalarUnsafe(nuint value)
+ {
+ if (Environment.Is64BitProcess)
+ {
+ return CreateScalarUnsafe((ulong)value).AsNUInt();
+ }
+ else
+ {
+ return CreateScalarUnsafe((uint)value).AsNUInt();
+ }
+ }
+
/// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized.
/// The value that element 0 will be initialized to.
/// A new instance with the first element initialized to and the remaining elements left uninitialized.
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs
index d696075b9c9720..f51cea7305f6dc 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs
@@ -169,6 +169,25 @@ public static Vector256 AsInt32(this Vector256 vector)
public static Vector256 AsInt64(this Vector256 vector)
where T : struct => vector.As();
+ /// Reinterprets a as a new .
+ /// The type of the input vector.
+ /// The vector to reinterpret.
+ /// reinterpreted as a new .
+ /// The type of () is not supported.
+ [Intrinsic]
+ public static Vector256 AsNInt(this Vector256 vector)
+ where T : struct => vector.As();
+
+ /// Reinterprets a as a new .
+ /// The type of the input vector.
+ /// The vector to reinterpret.
+ /// reinterpreted as a new .
+ /// The type of () is not supported.
+ [Intrinsic]
+ [CLSCompliant(false)]
+ public static Vector256 AsNUInt(this Vector256 vector)
+ where T : struct => vector.As();
+
/// Reinterprets a as a new .
/// The type of the input vector.
/// The vector to reinterpret.
@@ -320,17 +339,42 @@ public static Vector256 ConditionalSelect(Vector256 condition, Vector25
/// The vector to convert.
/// The converted vector.
[Intrinsic]
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe Vector256 ConvertToDouble(Vector256 vector)
{
- Unsafe.SkipInit(out Vector256 result);
+ if (Avx2.IsSupported)
+ {
+ // Based on __m256d int64_to_double_fast_precise(const __m256i v)
+ // from https://stackoverflow.com/a/41223013/12860347. CC BY-SA 4.0
- for (int i = 0; i < Vector256.Count; i++)
+ Vector256 lowerBits;
+
+ lowerBits = vector.AsInt32();
+ lowerBits = Avx2.Blend(lowerBits, Create(0x43300000_00000000).AsInt32(), 0b10101010); // Blend the 32 lowest significant bits of vector with the bit representation of double(2^52)
+
+ var upperBits = Avx2.ShiftRightLogical(vector, 32); // Extract the 32 most significant bits of vector
+ upperBits = Avx2.Xor(upperBits, Create(0x45300000_80000000)); // Flip the msb of upperBits and blend with the bit representation of double(2^84 + 2^63)
+
+ var result = Avx.Subtract(upperBits.AsDouble(), Create(0x45300000_80100000).AsDouble()); // Compute in double precision: (upper - (2^84 + 2^63 + 2^52)) + lower
+ return Avx.Add(result, lowerBits.AsDouble());
+ }
+ else
{
- var value = (double)vector.GetElementUnsafe(i);
- result.SetElementUnsafe(i, value);
+ return SoftwareFallback(vector);
}
- return result;
+ static Vector256 SoftwareFallback(Vector256 vector)
+ {
+ Unsafe.SkipInit(out Vector256 result);
+
+ for (int i = 0; i < Vector256.Count; i++)
+ {
+ var value = (double)vector.GetElementUnsafe(i);
+ result.SetElementUnsafe(i, value);
+ }
+
+ return result;
+ }
}
/// Converts a to a .
@@ -338,17 +382,42 @@ public static unsafe Vector256 ConvertToDouble(Vector256 vector)
/// The converted vector.
[CLSCompliant(false)]
[Intrinsic]
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe Vector256 ConvertToDouble(Vector256 vector)
{
- Unsafe.SkipInit(out Vector256 result);
+ if (Avx2.IsSupported)
+ {
+ // Based on __m256d uint64_to_double_fast_precise(const __m256i v)
+ // from https://stackoverflow.com/a/41223013/12860347. CC BY-SA 4.0
- for (int i = 0; i < Vector256.Count; i++)
+ Vector256 lowerBits;
+
+ lowerBits = vector.AsUInt32();
+ lowerBits = Avx2.Blend(lowerBits, Create(0x43300000_00000000UL).AsUInt32(), 0b10101010); // Blend the 32 lowest significant bits of vector with the bit representation of double(2^52) */
+
+ var upperBits = Avx2.ShiftRightLogical(vector, 32); // Extract the 32 most significant bits of vector
+ upperBits = Avx2.Xor(upperBits, Create(0x45300000_00000000UL)); // Blend upperBits with the bit representation of double(2^84)
+
+ var result = Avx.Subtract(upperBits.AsDouble(), Create(0x45300000_00100000UL).AsDouble()); // Compute in double precision: (upper - (2^84 + 2^52)) + lower
+ return Avx.Add(result, lowerBits.AsDouble());
+ }
+ else
{
- var value = (double)vector.GetElementUnsafe(i);
- result.SetElementUnsafe(i, value);
+ return SoftwareFallback(vector);
}
- return result;
+ static Vector256 SoftwareFallback(Vector256 vector)
+ {
+ Unsafe.SkipInit(out Vector256 result);
+
+ for (int i = 0; i < Vector256