Skip to content

[cDAC] implement DacDbi GetTypeLayout/GetArrayLayout#127877

Open
Copilot wants to merge 2 commits intomainfrom
copilot/implement-dacdbi-get-type-layout
Open

[cDAC] implement DacDbi GetTypeLayout/GetArrayLayout#127877
Copilot wants to merge 2 commits intomainfrom
copilot/implement-dacdbi-get-type-layout

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

Description

Implements cDAC-side DacDbi type/array layout APIs and adds RuntimeTypeSystem classification APIs required for this.

    bool IsObjRef(TypeHandle typeHandle) => throw new NotImplementedException();
    CorElementType GetInternalCorElementType(TypeHandle typeHandle) => throw new NotImplementedException();

Copilot AI self-assigned this May 6, 2026
Copilot AI review requested due to automatic review settings May 6, 2026 17:48
Copilot AI review requested due to automatic review settings May 6, 2026 17:48
@rcj1 rcj1 changed the title cDAC: implement DacDbi GetTypeLayout/GetArrayLayout and add RTS IsObjRef/IsPrimitive [cDAC] implement DacDbi GetTypeLayout/GetArrayLayout May 6, 2026
Copilot AI review requested due to automatic review settings May 6, 2026 17:56
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

public virtual CorElementType GetSignatureCorElementType(TypeHandle typeHandle);

// Internal element type of the type. Unlike GetSignatureCorElementType, this returns the underlying
// primitive type for enums and PrimitiveValueType categories (e.g. I4 for an enum with int underlying type).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The primitive value types is another historical artifact that we should delete #127894

{
CorElementType elementType = GetSignatureCorElementType(typeHandle);
// Keep this aligned with CorTypeInfo::IsObjRef semantics for signature element types.
return elementType is CorElementType.String or CorElementType.Class or CorElementType.Array or CorElementType.Object or CorElementType.SzArray;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
return elementType is CorElementType.String or CorElementType.Class or CorElementType.Array or CorElementType.Object or CorElementType.SzArray;
return elementType is CorElementType.Class or CorElementType.Array or CorElementType.SzArray;

Nit: This never returns CorElementType.Object or CorElementType.String

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants