Skip to content
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,12 @@ private void EmitTypeName(Handle typeHandle, bool namespaceQualified)
EmitString(typeHandle.ToGenericParameterHandle(_metadataReader).GetGenericParameter(_metadataReader).Name);
break;

case HandleType.FunctionPointerSignature:
EmitFunctionPointerTypeName(typeHandle.ToFunctionPointerSignatureHandle(_metadataReader));
break;

default:
Debug.Assert(false);
Debug.Assert(false, $"Type handle {typeHandle.HandleType} does not handled");
Copy link
Contributor

Choose a reason for hiding this comment

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

"is" or "was" not handled seems more appropriate.

_outputBuilder.Append("???");
break;
}
Expand Down Expand Up @@ -407,6 +411,21 @@ private void EmitPointerTypeName(PointerSignatureHandle pointerSigHandle)
_outputBuilder.Append('*');
}

/// <summary>
/// Emit function pointer type.
/// </summary>
/// <param name="functionPointerSigHandle">Function pointer type specification signature handle</param>
private void EmitFunctionPointerTypeName(FunctionPointerSignatureHandle functionPointerSigHandle)
{
FunctionPointerSignature functionPointerSig = _metadataReader.GetFunctionPointerSignature(functionPointerSigHandle);
_outputBuilder.Append("delegate*<");
Copy link
Member

Choose a reason for hiding this comment

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

This should emit whatever CoreCLR will emit for this, which is probably not delegate*. Not at my PC anymore but I'm guessing IntPtr. Thanks for looking into this!

MethodSignature methodSignature = functionPointerSig.Signature.GetMethodSignature(_metadataReader);
EmitTypeVector(methodSignature.Parameters);
_outputBuilder.Append(',');
EmitTypeName(methodSignature.ReturnType, namespaceQualified: false);
_outputBuilder.Append('>');
}

/// <summary>
/// Emit by-reference type.
/// </summary>
Expand Down