From d8a5947324c5655fa89f6f2c1359c46c027c3a86 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Wed, 28 Mar 2018 02:30:20 +0200 Subject: [PATCH] Add ModuleDefinition to IDecompilerTypeSystem --- ICSharpCode.Decompiler/TypeSystem/IDecompilerTypeSystem.cs | 2 ++ .../TypeSystem/SpecializingDecompilerTypeSystem.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ICSharpCode.Decompiler/TypeSystem/IDecompilerTypeSystem.cs b/ICSharpCode.Decompiler/TypeSystem/IDecompilerTypeSystem.cs index 5eb330c72..34e42be69 100644 --- a/ICSharpCode.Decompiler/TypeSystem/IDecompilerTypeSystem.cs +++ b/ICSharpCode.Decompiler/TypeSystem/IDecompilerTypeSystem.cs @@ -17,6 +17,7 @@ // DEALINGS IN THE SOFTWARE. using System.Reflection.Metadata; +using ICSharpCode.Decompiler.Metadata; namespace ICSharpCode.Decompiler.TypeSystem { @@ -33,6 +34,7 @@ namespace ICSharpCode.Decompiler.TypeSystem IMember ResolveAsMember(EntityHandle memberReference); MetadataReader GetMetadata(); + PEFile ModuleDefinition { get; } /// /// Gets a type system instance that automatically specializes the results diff --git a/ICSharpCode.Decompiler/TypeSystem/SpecializingDecompilerTypeSystem.cs b/ICSharpCode.Decompiler/TypeSystem/SpecializingDecompilerTypeSystem.cs index 25289738b..9867149d0 100644 --- a/ICSharpCode.Decompiler/TypeSystem/SpecializingDecompilerTypeSystem.cs +++ b/ICSharpCode.Decompiler/TypeSystem/SpecializingDecompilerTypeSystem.cs @@ -47,6 +47,8 @@ namespace ICSharpCode.Decompiler.TypeSystem get { return context.Compilation; } } + public Metadata.PEFile ModuleDefinition => context.ModuleDefinition; + public TypeParameterSubstitution Substitution { get { return substitution; } }