Browse Source

Make TypeDef-ctor of FindTypeDecoder internal.

pull/2643/head
Siegfried Pammer 3 years ago
parent
commit
a9c8f86abc
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/LocalFunctionDecompiler.cs
  2. 11
      ICSharpCode.Decompiler/Metadata/FindTypeDecoder.cs

2
ICSharpCode.Decompiler/IL/Transforms/LocalFunctionDecompiler.cs

@ -827,7 +827,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -827,7 +827,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
if (!IsLocalFunctionMethod(module, method, context))
continue;
var md = metadata.GetMethodDefinition(method);
if (md.DecodeSignature(new FindTypeDecoder(typeHandle, module, 0), default).ParameterTypes.Any())
if (md.DecodeSignature(new FindTypeDecoder(typeHandle, module), default).ParameterTypes.Any())
return true;
}

11
ICSharpCode.Decompiler/Metadata/FindTypeDecoder.cs

@ -36,14 +36,21 @@ namespace ICSharpCode.Decompiler.Metadata @@ -36,14 +36,21 @@ namespace ICSharpCode.Decompiler.Metadata
readonly string? namespaceName;
readonly PrimitiveTypeCode primitiveType;
public FindTypeDecoder(TypeDefinitionHandle handle, PEFile declaringModule, PrimitiveTypeCode primitiveType)
/// <summary>
/// Constructs a FindTypeDecoder that finds uses of a specific type-definition handle.
/// This assumes that the module we are search in is the same as the module containing the type-definiton.
/// </summary>
internal FindTypeDecoder(TypeDefinitionHandle handle, PEFile declaringModule)
{
this.handle = handle;
this.declaringModule = declaringModule;
this.primitiveType = primitiveType;
this.primitiveType = 0;
this.currentModule = null;
}
/// <summary>
/// Constructs a FindTypeDecoder that can be used to find <paramref name="type"/> in signatures from <paramref name="currentModule"/>.
/// </summary>
public FindTypeDecoder(MetadataModule currentModule, ITypeDefinition type)
{
this.currentModule = currentModule;

Loading…
Cancel
Save