Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolver improvements #22

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/Echo
Submodule Echo updated 363 files
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,20 @@ public static VMInlineOperandData Read(BinaryReader reader)
internal record VMTypeData : VMInlineOperandData
{
public string Name { get; }
public bool HasGenericTypeArgs { get; }
public bool IsGenericParameterType { get; }
public int GenericArgumentIndex { get; }
public int GenericTypeArgumentIndex { get; }
public VMInlineOperand[] GenericTypes { get; }

public TypeName TypeName { get; }
public bool HasGenericTypeParameters { get; }
public bool IsGenericParameterIndex { get; }
public int GenericMethodParameterIndex { get; }
public int GenericTypeParameterIndex { get; }
public VMInlineOperand[] GenericParameters { get; }

public VMTypeData(BinaryReader reader) : base(VMInlineOperandType.Type)
{
Name = reader.ReadString();
HasGenericTypeArgs = reader.ReadBoolean();
IsGenericParameterType = reader.ReadBoolean();
GenericArgumentIndex = reader.ReadInt32();
GenericTypeArgumentIndex = reader.ReadInt32();
GenericTypes = VMInlineOperand.ReadArrayInternal(reader);

TypeName = new TypeName(Name);
HasGenericTypeParameters = reader.ReadBoolean();
IsGenericParameterIndex = reader.ReadBoolean();
GenericMethodParameterIndex = reader.ReadInt32();
GenericTypeParameterIndex = reader.ReadInt32();
GenericParameters = VMInlineOperand.ReadArrayInternal(reader);
}
}

Expand All @@ -70,16 +66,6 @@ internal record VMFieldData : VMInlineOperandData
public string Name { get; }
public bool IsStatic { get; }

public BindingFlags BindingFlags
{
get
{
var bindingFlags = BindingFlags.Public | BindingFlags.NonPublic;
bindingFlags |= IsStatic ? BindingFlags.Static : BindingFlags.Instance;
return bindingFlags;
}
}

public VMFieldData(BinaryReader reader) : base(VMInlineOperandType.Field)
{
DeclaringType = VMInlineOperand.ReadInternal(reader);
Expand All @@ -97,11 +83,11 @@ internal record VMMethodData : VMInlineOperandData
public byte Flags { get; }

public bool IsStatic { get; }
public bool HasGenericArguments { get; }
public bool HasGenericParameters { get; }
public string Name { get; }
public VMInlineOperand ReturnType { get; }
public VMInlineOperand[] Parameters { get; }
public VMInlineOperand[] GenericArguments { get; }
public VMInlineOperand[] GenericParameters { get; }

public BindingFlags BindingFlags
{
Expand All @@ -119,11 +105,11 @@ public VMMethodData(BinaryReader reader) : base(VMInlineOperandType.Method)
Flags = reader.ReadByte();
// these constants are also different between versions (#3)
IsStatic = (Flags & 1) > 0;
HasGenericArguments = (Flags & 2) > 0;
HasGenericParameters = (Flags & 2) > 0;
Name = reader.ReadString();
ReturnType = VMInlineOperand.ReadInternal(reader);
Parameters = VMInlineOperand.ReadArrayInternal(reader);
GenericArguments = VMInlineOperand.ReadArrayInternal(reader);
GenericParameters = VMInlineOperand.ReadArrayInternal(reader);
}
}

Expand Down
125 changes: 0 additions & 125 deletions src/EazyDevirt/Core/Architecture/TypeName.cs

This file was deleted.

Loading