Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

CV Array type#3639

Merged
sandreenko merged 5 commits intodotnet:masterfrom
sandreenko:ArrayType
May 18, 2017
Merged

CV Array type#3639
sandreenko merged 5 commits intodotnet:masterfrom
sandreenko:ArrayType

Conversation

@sandreenko
Copy link

CodeView ArrayType was added.
Also all names were changed to mangled names, as ProjectN does.

Sergey Andreenko added 4 commits May 17, 2017 11:10
CV has unique indexes and use them to link types inside, but somehow
not-unique names create conflicts. Use mangled names to avoid them.
{
System.Diagnostics.Debug.Assert(type.IsArray, "GetArrayTypeIndex was called with wrong type");
ArrayType arrayType = (ArrayType)type;
ArrayTypeDescriptor arrayTypeDescriptor = new ArrayTypeDescriptor();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an object initializer reads nicer here:

ArrayTypeDescriptor arrayTypeDescriptor = new ArrayTypeDescriptor
{
    ElementType = GetVariableTypeIndex(arrayType.ElementType, false);
    Size = (uint)arrayType.GetElementSize().AsInt;
    Rank = (uint)arrayType.Rank;
    IsMultiDimensional = arrayType.IsMdArray? 1:0;
};

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.

arrayTypeDescriptor.Rank = (uint)arrayType.Rank;
arrayTypeDescriptor.IsMultiDimensional = arrayType.IsMdArray? 1:0;

ClassTypeDescriptor classDescriptor = new ClassTypeDescriptor();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here - object initializer :)

Copy link
Member

@davidwrighton davidwrighton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@sandreenko sandreenko merged commit ca37661 into dotnet:master May 18, 2017
@sandreenko sandreenko deleted the ArrayType branch May 18, 2017 23:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants