From 90c617d39a9775e8eb0c5d4aba2f0cc6932bfb87 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 8 Sep 2021 11:10:41 -0700 Subject: [PATCH] Move to using the new Roslyn IIncrementalGenerator API for better in-VS performance (#1374) --- Directory.Build.props | 2 +- .../Ancillary.Interop.csproj | 1 - .../Benchmarks/Benchmarks.csproj | 3 +- .../IncrementalGenerationTests.cs | 203 +++++++ .../DllImportGenerator.UnitTests/TestUtils.cs | 56 +- .../DllImportGenerator/Comparers.cs | 95 ++++ .../DllImportGenerator/DllImportGenerator.cs | 504 +++++++++++------- ...lImportStub.cs => DllImportStubContext.cs} | 176 +++--- .../GeneratedDllImportData.cs | 48 ++ .../GeneratorDiagnostics.cs | 108 ++-- .../DllImportGenerator/ManagedTypeInfo.cs | 74 +++ .../Marshalling/BlittableMarshaller.cs | 2 +- .../Marshalling/BoolMarshaller.cs | 2 +- .../Marshalling/CharMarshaller.cs | 2 +- .../Marshalling/DelegateMarshaller.cs | 2 +- .../Marshalling/Forwarder.cs | 4 +- .../Marshalling/HResultExceptionMarshaller.cs | 2 +- .../Marshalling/MarshallingGenerator.cs | 99 ++-- .../Marshalling/SafeHandleMarshaller.cs | 8 +- .../MarshallingAttributeInfo.cs | 94 ++-- .../DllImportGenerator/StubCodeContext.cs | 4 +- .../DllImportGenerator/StubCodeGenerator.cs | 175 +++--- .../DllImportGenerator/TypePositionInfo.cs | 44 +- .../TypeSymbolExtensions.cs | 4 +- .../UnreachableException.cs | 13 + eng/Version.Details.xml | 4 +- eng/Versions.props | 4 +- global.json | 4 +- 28 files changed, 1140 insertions(+), 597 deletions(-) create mode 100644 DllImportGenerator/DllImportGenerator.UnitTests/IncrementalGenerationTests.cs create mode 100644 DllImportGenerator/DllImportGenerator/Comparers.cs rename DllImportGenerator/DllImportGenerator/{DllImportStub.cs => DllImportStubContext.cs} (62%) create mode 100644 DllImportGenerator/DllImportGenerator/GeneratedDllImportData.cs create mode 100644 DllImportGenerator/DllImportGenerator/ManagedTypeInfo.cs create mode 100644 DllImportGenerator/DllImportGenerator/UnreachableException.cs diff --git a/Directory.Build.props b/Directory.Build.props index c2a6fec87fd1..c22450ed10bd 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,7 +7,7 @@ True embedded true - 9 + 10 true - + https://github.com/dotnet/runtime - 01188c75f06412dc86508e7b653deaeace9623ba + 91ba01788d4d83475fec3aea7c830376e08585da diff --git a/eng/Versions.props b/eng/Versions.props index fc425df2da3a..fed00ea970b2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -15,11 +15,11 @@ false 16.7.1 - 6.0.0-preview.6.21317.4 + 6.0.0-preview.7.21377.19 2.4.1 2.4.3 - 3.10.0-3.21229.26 + 4.0.0-2.21329.25 1.1.0 3.3.3-beta1.21268.3 diff --git a/global.json b/global.json index 2495b5a8245d..a0a4f3664b71 100644 --- a/global.json +++ b/global.json @@ -1,11 +1,11 @@ { "sdk": { - "version": "6.0.100-preview.6.21316.11", + "version": "6.0.100-preview.7.21379.14", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "6.0.100-preview.6.21316.11", + "dotnet": "6.0.100-preview.7.21379.14", "runtimes": { "dotnet": [ "$(MicrosoftNETCoreAppVersion)"