summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/roslyn-3.9.0-bootstrap-with-csc-3.8.patch
blob: 2cb8bf84ccf2632087c9f6e951f16c32983a4685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
--- a/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs
+++ b/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs
@@ -2214,7 +2214,7 @@
 
         private BinderFactory GetBinderFactory(SyntaxTree syntaxTree, bool ignoreAccessibility, ref WeakReference<BinderFactory>[]? cachedBinderFactories)
         {
-            Debug.Assert(System.Runtime.CompilerServices.Unsafe.AreSame(ref cachedBinderFactories, ref ignoreAccessibility ? ref _ignoreAccessibilityBinderFactories : ref _binderFactories));
+            // Unsafe.AreSame not available on Mono
 
             var treeNum = GetSyntaxTreeOrdinal(syntaxTree);
             WeakReference<BinderFactory>[]? binderFactories = cachedBinderFactories;
--- a/src/Compilers/Shared/BuildClient.cs
+++ b/src/Compilers/Shared/BuildClient.cs
@@ -84,7 +84,7 @@
             {
                 // Register encodings for console
                 // https://github.com/dotnet/roslyn/issues/10785
-                System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
+                // CodePagesEncodingProvider not available on Mono
             }
 
             var client = new BuildClient(language, compileFunc, logger);
--- a/src/Compilers/Core/Portable/PEWriter/Members.cs
+++ b/src/Compilers/Core/Portable/PEWriter/Members.cs
@@ -58,7 +58,7 @@
         /// Extensible calling convention protocol. This represents either the union of calling convention modopts after the paramcount specifier
         /// in IL, or platform default if none are present
         /// </summary>
-        Unmanaged = SignatureCallingConvention.Unmanaged,
+        Unmanaged = 9,
 
         /// <summary>
         /// The convention for calling a generic method.
--- a/src/Compilers/Core/Portable/PEWriter/PeWriter.cs
+++ b/src/Compilers/Core/Portable/PEWriter/PeWriter.cs
@@ -350,7 +350,7 @@
                 _resourceSection = resourceSection;
             }
 
-            protected override void Serialize(BlobBuilder builder, SectionLocation location)
+            protected internal override void Serialize(BlobBuilder builder, SectionLocation location)
             {
                 NativeResourceWriter.SerializeWin32Resources(builder, _resourceSection, location.RelativeVirtualAddress);
             }
@@ -366,7 +366,7 @@
                 _resources = resources;
             }
 
-            protected override void Serialize(BlobBuilder builder, SectionLocation location)
+            protected internal override void Serialize(BlobBuilder builder, SectionLocation location)
             {
                 NativeResourceWriter.SerializeWin32Resources(builder, _resources, location.RelativeVirtualAddress);
             }
--- a/src/Compilers/Core/Portable/Emit/EditAndContinue/DeltaMetadataWriter.cs
+++ b/src/Compilers/Core/Portable/Emit/EditAndContinue/DeltaMetadataWriter.cs
@@ -635,7 +635,7 @@
 
             if (localVariables.Length > 0)
             {
-                var writer = PooledBlobBuilder.GetInstance();
+                var writer = Microsoft.Cci.PooledBlobBuilder.GetInstance();
                 var encoder = new BlobEncoder(writer).LocalVariableSignature(localVariables.Length);
 
                 foreach (ILocalDefinition local in localVariables)
--- a/src/Compilers/Core/Portable/Collections/ImmutableArrayExtensions.cs
+++ b/src/Compilers/Core/Portable/Collections/ImmutableArrayExtensions.cs
@@ -669,7 +669,7 @@
         // TODO(https://github.com/dotnet/corefx/issues/34126): Remove when System.Collections.Immutable
         // provides a Span API
         internal static T[] DangerousGetUnderlyingArray<T>(this ImmutableArray<T> array)
-            => Unsafe.As<ImmutableArray<T>, ImmutableArrayProxy<T>>(ref array).MutableArray;
+            => System.Linq.Enumerable.ToArray(array);
 
         internal static ReadOnlySpan<T> AsSpan<T>(this ImmutableArray<T> array)
             => array.DangerousGetUnderlyingArray();
@@ -678,7 +678,7 @@
         {
             var proxy = new ImmutableArrayProxy<T> { MutableArray = array };
             array = null!;
-            return Unsafe.As<ImmutableArrayProxy<T>, ImmutableArray<T>>(ref proxy);
+            return System.Collections.Immutable.ImmutableArray.Create(proxy.MutableArray);
         }
 
         internal static Dictionary<K, ImmutableArray<T>> ToDictionary<K, T>(this ImmutableArray<T> items, Func<T, K> keySelector, IEqualityComparer<K>? comparer = null)