Delete serialization support from the managed type system (#84675)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Wed, 12 Apr 2023 09:47:23 +0000 (18:47 +0900)
committerGitHub <noreply@github.com>
Wed, 12 Apr 2023 09:47:23 +0000 (18:47 +0900)
Long time ago we tried to make binary serialization sort of work with PublishAot. That code was deleted, but this was left.

src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Serialization.cs [deleted file]
src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.cs
src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Serialization.cs [deleted file]
src/coreclr/tools/Common/TypeSystem/Serialization/FieldDesc.Serialization.cs [deleted file]
src/coreclr/tools/Common/TypeSystem/Serialization/TypeDesc.Serialization.cs [deleted file]
src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj

diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Serialization.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Serialization.cs
deleted file mode 100644 (file)
index f2767d4..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace Internal.TypeSystem.Ecma
-{
-    public partial class EcmaField
-    {
-        public override bool IsNotSerialized
-        {
-            get
-            {
-                return (GetFieldFlags(FieldFlags.BasicMetadataCache | FieldFlags.NotSerialized) & FieldFlags.NotSerialized) != 0;
-            }
-        }
-    }
-}
index 9e1c2f9..c712849 100644 (file)
@@ -18,7 +18,6 @@ namespace Internal.TypeSystem.Ecma
             public const int InitOnly               = 0x0004;
             public const int Literal                = 0x0008;
             public const int HasRva                 = 0x0010;
-            public const int NotSerialized          = 0x0020;
 
             public const int AttributeMetadataCache = 0x0100;
             public const int ThreadStatic           = 0x0200;
@@ -147,11 +146,6 @@ namespace Internal.TypeSystem.Ecma
                 if ((fieldAttributes & FieldAttributes.HasFieldRVA) != 0)
                     flags |= FieldFlags.HasRva;
 
-#pragma warning disable SYSLIB0050 // Legacy serialization infrastructure is obsolete
-                if ((fieldAttributes & FieldAttributes.NotSerialized) != 0)
-                    flags |= FieldFlags.NotSerialized;
-#pragma warning restore SYSLIB0050
-
                 flags |= FieldFlags.BasicMetadataCache;
             }
 
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Serialization.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Serialization.cs
deleted file mode 100644 (file)
index 9cfd879..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Reflection;
-
-namespace Internal.TypeSystem.Ecma
-{
-    public partial class EcmaType
-    {
-        public override bool IsSerializable
-        {
-            get
-            {
-                return (_typeDefinition.Attributes & TypeAttributes.Serializable) != 0;
-            }
-        }
-    }
-}
diff --git a/src/coreclr/tools/Common/TypeSystem/Serialization/FieldDesc.Serialization.cs b/src/coreclr/tools/Common/TypeSystem/Serialization/FieldDesc.Serialization.cs
deleted file mode 100644 (file)
index c30d252..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace Internal.TypeSystem
-{
-    // Additional members of FieldDesc related to serialization.
-    public partial class FieldDesc
-    {
-        /// <summary>
-        /// Gets a value indicating whether this field is not serialized.
-        /// specially.
-        /// </summary>
-        public virtual bool IsNotSerialized
-        {
-            get
-            {
-                return false;
-            }
-        }
-    }
-
-    public partial class FieldForInstantiatedType
-    {
-        public override bool IsNotSerialized
-        {
-            get
-            {
-                return _fieldDef.IsNotSerialized;
-            }
-        }
-    }
-}
diff --git a/src/coreclr/tools/Common/TypeSystem/Serialization/TypeDesc.Serialization.cs b/src/coreclr/tools/Common/TypeSystem/Serialization/TypeDesc.Serialization.cs
deleted file mode 100644 (file)
index ff129b0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace Internal.TypeSystem
-{
-    public partial class TypeDesc
-    {
-        /// <summary>
-        /// Gets a value indicating whether this type is serializable.
-        /// </summary>
-        public virtual bool IsSerializable
-        {
-            get
-            {
-                return false;
-            }
-        }
-    }
-
-    public partial class InstantiatedType
-    {
-        public override bool IsSerializable
-        {
-            get
-            {
-                return _typeDef.IsSerializable;
-            }
-        }
-    }
-}
index 4e5d5b1..5a80cac 100644 (file)
     <Compile Include="..\..\Common\TypeSystem\Ecma\EcmaField.CodeGen.cs">
       <Link>Ecma\EcmaField.CodeGen.cs</Link>
     </Compile>
-    <Compile Include="..\..\Common\TypeSystem\Ecma\EcmaField.Serialization.cs">
-      <Link>Ecma\EcmaField.Serialization.cs</Link>
-    </Compile>
     <Compile Include="..\..\Common\TypeSystem\Ecma\EcmaGenericParameter.Sorting.cs">
       <Link>Ecma\EcmaGenericParameter.Sorting.cs</Link>
     </Compile>
     <Compile Include="..\..\Common\TypeSystem\Ecma\EcmaModule.Sorting.cs">
       <Link>Ecma\EcmaModule.Sorting.cs</Link>
     </Compile>
-    <Compile Include="..\..\Common\TypeSystem\Ecma\EcmaType.Serialization.cs">
-      <Link>Ecma\EcmaType.Serialization.cs</Link>
-    </Compile>
     <Compile Include="..\..\Common\TypeSystem\Ecma\EcmaType.Sorting.cs">
       <Link>Ecma\EcmaType.Sorting.cs</Link>
     </Compile>
     <Compile Include="..\..\Common\TypeSystem\IL\Stubs\PInvokeTargetNativeMethod.Sorting.cs">
       <Link>IL\Stubs\PInvokeTargetNativeMethod.Sorting.cs</Link>
     </Compile>
-    <Compile Include="..\..\Common\TypeSystem\Serialization\FieldDesc.Serialization.cs">
-      <Link>TypeSystem\CodeGen\FieldDesc.Serialization.cs</Link>
-    </Compile>
-    <Compile Include="..\..\Common\TypeSystem\Serialization\TypeDesc.Serialization.cs">
-      <Link>TypeSystem\CodeGen\TypeDesc.Serialization.cs</Link>
-    </Compile>
     <Compile Include="..\..\Common\TypeSystem\Sorting\FieldDesc.Sorting.cs">
       <Link>TypeSystem\Sorting\FieldDesc.Sorting.cs</Link>
     </Compile>