CompilerServices APIs
authorFadi Hanna <fadim@microsoft.com>
Thu, 16 Mar 2017 23:10:28 +0000 (16:10 -0700)
committerdotnet-bot <dotnet-bot@microsoft.com>
Fri, 17 Mar 2017 16:42:34 +0000 (16:42 +0000)
[tfs-changeset: 1651141]

Commit migrated from https://github.com/dotnet/coreclr/commit/9d2a4a9f30ca6a6d0d538548f7972e2c0d8cfeb8

12 files changed:
src/coreclr/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxations.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/DiscardableAttribute.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/LoadHint.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/MethodCodeType.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/MethodImplOptions.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/SuppressIldasmAttribute.cs [new file with mode: 0644]

index 87437f7..b56dc38 100644 (file)
     <Compile Include="$(MSBuildThisFileDirectory)System\Reflection\PropertyInfo.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Reflection\TypeDelegator.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Reflection\TypeInfo.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\CompilationRelaxations.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\CompilerGlobalScopeAttribute.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\DefaultDependencyAttribute.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\DependencyAttribute.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\DiscardableAttribute.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ExtensionAttribute.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\FixedAddressValueTypeAttribute.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\FormattableStringFactory.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\IsVolatile.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ITuple.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\LoadHint.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\MethodCodeType.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\MethodImplOptions.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\StringFreezingAttribute.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\SuppressIldasmAttribute.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\TupleElementNamesAttribute.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\ConstrainedExecution\Cer.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\ConstrainedExecution\Consistency.cs"/>
diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxations.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxations.cs
new file mode 100644 (file)
index 0000000..4da9502
--- /dev/null
@@ -0,0 +1,16 @@
+// 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
+{
+    /// IMPORTANT: Keep this in sync with corhdr.h
+    [Flags]
+    [Serializable]
+    public enum CompilationRelaxations : int
+    {
+        NoStringInterning = 0x0008  // Start in 0x0008, we had other non public flags in this enum before,
+                                    // so we'll start here just in case somebody used them. This flag is only
+                                    // valid when set for Assemblies.
+    }
+}
\ No newline at end of file
diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs
new file mode 100644 (file)
index 0000000..22fa694
--- /dev/null
@@ -0,0 +1,16 @@
+// 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
+{
+    // Attribute used to communicate to the VS7 debugger that a class should be treated as if it has global scope.
+    
+    [Serializable]
+    [AttributeUsage(AttributeTargets.Class)]
+    public class CompilerGlobalScopeAttribute : Attribute
+    {
+        public CompilerGlobalScopeAttribute() { }
+    }
+}
+
diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs
new file mode 100644 (file)
index 0000000..f5419d4
--- /dev/null
@@ -0,0 +1,18 @@
+// 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
+{
+    [Serializable]
+    [AttributeUsage(AttributeTargets.Assembly)]
+    public sealed class DefaultDependencyAttribute : Attribute
+    {
+        public DefaultDependencyAttribute(LoadHint loadHintArgument)
+        {
+            LoadHint = loadHintArgument;
+        }
+
+        public LoadHint LoadHint { get; }
+    }
+}
\ No newline at end of file
diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs
new file mode 100644 (file)
index 0000000..56f4242
--- /dev/null
@@ -0,0 +1,20 @@
+// 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
+{
+    [Serializable]
+    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+    public sealed class DependencyAttribute : Attribute
+    {
+        public DependencyAttribute(String dependentAssemblyArgument, LoadHint loadHintArgument)
+        {
+            DependentAssembly = dependentAssemblyArgument;
+            LoadHint = loadHintArgument;
+        }
+
+        public String DependentAssembly { get; }
+        public LoadHint LoadHint { get; }
+    }
+}
\ No newline at end of file
diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/DiscardableAttribute.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/DiscardableAttribute.cs
new file mode 100644 (file)
index 0000000..c88b3a7
--- /dev/null
@@ -0,0 +1,13 @@
+// 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
+{
+    // Custom attribute to indicating a TypeDef is a discardable attribute.
+    
+    public class DiscardableAttribute : Attribute
+    {
+        public DiscardableAttribute() { }
+    }
+}
diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs
new file mode 100644 (file)
index 0000000..baf5824
--- /dev/null
@@ -0,0 +1,13 @@
+// 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
+{
+    [Serializable]
+    [AttributeUsage(AttributeTargets.Field)]
+    public sealed class FixedAddressValueTypeAttribute : Attribute
+    {
+        public FixedAddressValueTypeAttribute() { }
+    }
+}
\ No newline at end of file
diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/LoadHint.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/LoadHint.cs
new file mode 100644 (file)
index 0000000..ae6d9b9
--- /dev/null
@@ -0,0 +1,14 @@
+// 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
+{
+    [Serializable]
+    public enum LoadHint
+    {
+        Default = 0x0000,           // No preference specified
+        Always = 0x0001,            // Dependency is always loaded
+        Sometimes = 0x0002,         // Dependency is sometimes loaded
+    }
+}
\ No newline at end of file
diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/MethodCodeType.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/MethodCodeType.cs
new file mode 100644 (file)
index 0000000..e82993a
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+using System.Reflection;
+
+namespace System.Runtime.CompilerServices
+{
+    [Serializable]
+    public enum MethodCodeType
+    {
+        IL = MethodImplAttributes.IL,
+        Native = MethodImplAttributes.Native,
+        OPTIL = MethodImplAttributes.OPTIL,
+        Runtime = MethodImplAttributes.Runtime
+    }
+}
diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/MethodImplOptions.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/MethodImplOptions.cs
new file mode 100644 (file)
index 0000000..2b5affc
--- /dev/null
@@ -0,0 +1,21 @@
+// 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
+{
+    // This Enum matchs the miImpl flags defined in corhdr.h. It is used to specify 
+    // certain method properties.
+    [Flags]
+    public enum MethodImplOptions
+    {
+        Unmanaged = 0x0004,
+        NoInlining = 0x0008,
+        ForwardRef = 0x0010,
+        Synchronized = 0x0020,
+        NoOptimization = 0x0040,
+        PreserveSig = 0x0080,
+        AggressiveInlining = 0x0100,
+        InternalCall = 0x1000
+    }
+}
\ No newline at end of file
diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs
new file mode 100644 (file)
index 0000000..7772a1a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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
+{
+    // Custom attribute to indicate that strings should be frozen.
+    
+    [Serializable]
+    [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
+    public sealed class StringFreezingAttribute : Attribute
+    {
+        public StringFreezingAttribute() { }
+    }
+}
diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/SuppressIldasmAttribute.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/CompilerServices/SuppressIldasmAttribute.cs
new file mode 100644 (file)
index 0000000..b4224b1
--- /dev/null
@@ -0,0 +1,13 @@
+// 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
+{
+    [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module)]
+    public sealed class SuppressIldasmAttribute : Attribute
+    {
+        public SuppressIldasmAttribute() { }
+    }
+}
+