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

SymbolDisplayVisitor doesn't correctly classify function pointer calling conventions #70746

Closed
Youssef1313 opened this issue Nov 9, 2023 · 1 comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@Youssef1313
Copy link
Member

There are four calling conventions that are special-cased and hard coded in the compiler implementation. They don't necessarily represent classes.

case SignatureCallingConvention.CDecl:
builder.Add(CreatePart(SymbolDisplayPartKind.ClassName, symbol, "Cdecl"));
break;
case SignatureCallingConvention.StdCall:
builder.Add(CreatePart(SymbolDisplayPartKind.ClassName, symbol, "Stdcall"));
break;
case SignatureCallingConvention.ThisCall:
builder.Add(CreatePart(SymbolDisplayPartKind.ClassName, symbol, "Thiscall"));
break;
case SignatureCallingConvention.FastCall:
builder.Add(CreatePart(SymbolDisplayPartKind.ClassName, symbol, "Fastcall"));
break;

case { CallingConventions: { Count: 1 } specifiers }:
return specifiers[0].Name switch
{
// Special identifiers cases
{ ValueText: "Cdecl" } => CallingConvention.CDecl,
{ ValueText: "Stdcall" } => CallingConvention.Standard,
{ ValueText: "Thiscall" } => CallingConvention.ThisCall,
{ ValueText: "Fastcall" } => CallingConvention.FastCall,

While the BCL have corresponding classes, e.g, System.Runtime.CompilerServices.CallConvCdecl. The language rules don't seem to require these classes to exist, so IMO these are more like keywords not class names.

This issue is opened as the first step towards getting #59052.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 9, 2023
@Youssef1313
Copy link
Member Author

Closing per the discussion with @333fred

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant