Skip to content

Commit

Permalink
Move System.Runtime.CompilerServices.CallConv* types to System.Privat…
Browse files Browse the repository at this point in the history
…e.CoreLib and expose via System.Runtime. (#38473)

* Move the calling convention types used in the new calling convention modopt-based encoding down to System.Private.CoreLib/System.Runtime.

* Make S.R.CS.VisualC a partial facade so the tooling will generate the type forwards in the src assembly.
  • Loading branch information
jkoritzinsky authored Jun 27, 2020
1 parent 31699de commit 1b7edcb
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\CallerFilePathAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\CallerLineNumberAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\CallerMemberNameAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\CallingConventions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\CompilationRelaxations.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\CompilationRelaxationsAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\CompilerGeneratedAttribute.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace System.Runtime.CompilerServices
{
public class CallConvCdecl
{
public CallConvCdecl() { }
}
public class CallConvFastcall
{
public CallConvFastcall() { }
}
public class CallConvStdcall
{
public CallConvStdcall() { }
}
public class CallConvThiscall
{
public CallConvThiscall() { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// ------------------------------------------------------------------------------
// Changes to this file must follow the https://aka.ms/api-review process.
// ------------------------------------------------------------------------------

[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallConvCdecl))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallConvStdcall))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallConvThiscall))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallConvFastcall))]
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,6 @@

namespace System.Runtime.CompilerServices
{
public partial class CallConvCdecl
{
public CallConvCdecl() { }
}
public partial class CallConvFastcall
{
public CallConvFastcall() { }
}
public partial class CallConvStdcall
{
public CallConvStdcall() { }
}
public partial class CallConvThiscall
{
public CallConvThiscall() { }
}
public static partial class CompilerMarshalOverride
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<ItemGroup>
<Compile Include="System.Runtime.CompilerServices.VisualC.cs" />
<Compile Include="System.Runtime.CompilerServices.VisualC.manual.cs" />
<Compile Include="System.Runtime.CompilerServices.VisualC.TypeForwards.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<AssemblyName>System.Runtime.CompilerServices.VisualC</AssemblyName>
<Nullable>enable</Nullable>
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
</PropertyGroup>
<!-- Shared CoreCLR -->
Expand All @@ -11,4 +12,4 @@
<ItemGroup>
<Reference Include="System.Runtime" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,6 @@ internal AssemblyAttributesGoHereSM()
}
}

// Types used in Custom Modifier to specify calling conventions.
public class CallConvCdecl
{
}

public class CallConvStdcall
{
}

public class CallConvThiscall
{
}

public class CallConvFastcall
{
}

[AttributeUsage(AttributeTargets.All)]
internal sealed class DecoratedNameAttribute : Attribute
{
Expand Down
16 changes: 16 additions & 0 deletions src/libraries/System.Runtime/ref/System.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8993,6 +8993,22 @@ public void SetResult() { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial class CallConvCdecl
{
public CallConvCdecl() { }
}
public partial class CallConvFastcall
{
public CallConvFastcall() { }
}
public partial class CallConvStdcall
{
public CallConvStdcall() { }
}
public partial class CallConvThiscall
{
public CallConvThiscall() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)]
public sealed partial class CallerArgumentExpressionAttribute : System.Attribute
{
Expand Down

0 comments on commit 1b7edcb

Please sign in to comment.