diff options
author | Michal Strehovský <michals@microsoft.com> | 2015-12-15 06:06:35 +0300 |
---|---|---|
committer | Michal Strehovský <michals@microsoft.com> | 2015-12-15 06:06:35 +0300 |
commit | bdd1cc1f511642071a1f2f5e2069a908b7685233 (patch) | |
tree | b99c6c785eab92e12fb84c78f939a5e47865f440 | |
parent | 964952dfbda231ab28e582ce4638488729e94e57 (diff) |
Introduce IAssemblyDesc
-rw-r--r-- | src/Common/src/TypeSystem/Common/IAssemblyDesc.cs | 18 | ||||
-rw-r--r-- | src/Common/src/TypeSystem/Ecma/EcmaModule.cs | 2 | ||||
-rw-r--r-- | src/ILCompiler.TypeSystem/src/ILCompiler.TypeSystem.csproj | 3 |
3 files changed, 22 insertions, 1 deletions
diff --git a/src/Common/src/TypeSystem/Common/IAssemblyDesc.cs b/src/Common/src/TypeSystem/Common/IAssemblyDesc.cs new file mode 100644 index 000000000..545697628 --- /dev/null +++ b/src/Common/src/TypeSystem/Common/IAssemblyDesc.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Reflection; + +namespace Internal.TypeSystem +{ + /// <summary> + /// Optional interface a <see cref="ModuleDesc"/> should implement if it represents an assembly. + /// </summary> + public interface IAssemblyDesc + { + /// <summary> + /// Gets the assembly name. + /// </summary> + AssemblyName GetName(); + } +} diff --git a/src/Common/src/TypeSystem/Ecma/EcmaModule.cs b/src/Common/src/TypeSystem/Ecma/EcmaModule.cs index 021d48a30..02a808720 100644 --- a/src/Common/src/TypeSystem/Ecma/EcmaModule.cs +++ b/src/Common/src/TypeSystem/Ecma/EcmaModule.cs @@ -12,7 +12,7 @@ using Internal.TypeSystem; namespace Internal.TypeSystem.Ecma { - public sealed class EcmaModule : ModuleDesc + public sealed class EcmaModule : ModuleDesc, IAssemblyDesc { private PEReader _peReader; private MetadataReader _metadataReader; diff --git a/src/ILCompiler.TypeSystem/src/ILCompiler.TypeSystem.csproj b/src/ILCompiler.TypeSystem/src/ILCompiler.TypeSystem.csproj index 6b927a265..d7d54e601 100644 --- a/src/ILCompiler.TypeSystem/src/ILCompiler.TypeSystem.csproj +++ b/src/ILCompiler.TypeSystem/src/ILCompiler.TypeSystem.csproj @@ -23,6 +23,9 @@ <Compile Include="..\..\Common\src\TypeSystem\Common\AlignmentHelper.cs"> <Link>Utilities\AlignmentHelper.cs</Link> </Compile> + <Compile Include="..\..\Common\src\TypeSystem\Common\IAssemblyDesc.cs"> + <Link>IAssemblyDesc.cs</Link> + </Compile> <Compile Include="..\..\Common\src\TypeSystem\Common\ModuleDesc.cs"> <Link>ModuleDesc.cs</Link> </Compile> |