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

Added model for layout information #26

Open
wants to merge 1 commit into
base: metadata-provider
Choose a base branch
from
Open
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
23 changes: 21 additions & 2 deletions Model/Types/TypeDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,25 @@ public enum VisibilityKind
Internal = 4,
Public = 8
}

public enum LayoutKind
{
Unknown,
AutoLayout, // Class fields are auto-laid out
SequentialLayout, // Class fields are laid out sequentially
ExplicitLayout, // Layout is supplied explicitly
}
public class LayoutInformation
{
public LayoutKind Kind { get; set; }
public short PackingSize { get; set; }
public int ClassSize { get; set; }
public LayoutInformation(LayoutKind kind = LayoutKind.Unknown)
{
Kind = kind;
PackingSize = -1;
ClassSize = -1;
}
}
public class TypeDefinition : IBasicType, IGenericDefinition, ITypeMemberDefinition, ITypeDefinitionContainer
{
public TypeKind TypeKind { get; set; }
Expand All @@ -623,7 +641,7 @@ public class TypeDefinition : IBasicType, IGenericDefinition, ITypeMemberDefinit
public IList<MethodDefinition> Methods { get; private set; }
public IList<TypeDefinition> Types { get; private set; }
public IBasicType UnderlayingType { get; set; }

public LayoutInformation LayoutInformation { get; set; }
public TypeDefinition(string name, TypeKind typeKind = TypeKind.Unknown, TypeDefinitionKind kind = TypeDefinitionKind.Unknown)
{
this.Name = name;
Expand All @@ -635,6 +653,7 @@ public TypeDefinition(string name, TypeKind typeKind = TypeKind.Unknown, TypeDef
this.Fields = new List<FieldDefinition>();
this.Methods = new List<MethodDefinition>();
this.Types = new List<TypeDefinition>();
this.LayoutInformation = new LayoutInformation();
}

public string GenericName
Expand Down