-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Support emitting function pointers in signatures #41340
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
Conversation
|
@333fred It looks like tests are failing #Closed |
src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerMethodSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerMethodSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerMethodSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerParameterSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerMethodSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Emitter/Model/FunctionPointerSymbolsAdapter.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerTypeSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Symbol/Symbols/FunctionPointerTypeSymbolTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/SymbolDisplay/SymbolDisplayVisitor.Types.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Emitter/Model/FunctionPointerSymbolsAdapter.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Metadata/PE/TupleTypeDecoder.cs
Outdated
Show resolved
Hide resolved
It feels like other decoders should also be adjusted: nullable, dynamic, etc. #Closed Refers to: src/Compilers/CSharp/Portable/Symbols/Metadata/PE/TupleTypeDecoder.cs:63 in c83dd64. [](commit_id = c83dd642d5f722a90583a2058438a16a8fc562ea, deletion_comment = False) |
src/Compilers/CSharp/Portable/Symbols/PublicModel/FunctionPointerTypeSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/PublicModel/FunctionPointerTypeSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerTypeSymbol.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return CreateITypeSymbol [](start = 12, length = 24)
I think the code reuse doesn't give us a lot of benefits, but disallows us to assert that we properly use internal cash for public symbols. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return [](start = 12, length = 6)
Debug.Assert(nullableAnnotation != DefaultNullableAnnotation);? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ParamInfo retInfo = retAndParamTypes[0] [](start = 12, length = 51)
Why can't we do all this return type related work within the constructor? #Pending
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could. But given that Chuck just asked me to move what was in the constructor into a helper method, I'm going to leave this where it is.
In reply to: 374405675 [](ancestors = 374405675)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could. But given that Chuck just asked me to move what was in the constructor into a helper method, I'm going to leave this where it is.
I am not sure how one is related to the other. I think, from the API design perspective, it would be better if constructor were taking all data in raw form, or all data in "preprocessed" form.
In reply to: 374952548 [](ancestors = 374952548,374405675)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeGenFunctionPointersTests [](start = 17, length = 28)
It might be useful to have targeted tests for metadata import from IL to ensure that things end up in the right places. #Closed
|
Done with review pass (iteration 2) #Closed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SignatureCallingConvention [](start = 27, length = 26)
It feels like translating between two enums is just another hoop to jump over. Would it be possible to remove the Cci version of the enum and switch to using SignatureCallingConvention, which, I assume, is a public type and could be used in our public APIs as well? #Closed
I'll put a prototype. I was specifically avoiding them in this pr. In reply to: 581664963 [](ancestors = 581664963) Refers to: src/Compilers/CSharp/Portable/Symbols/Metadata/PE/TupleTypeDecoder.cs:63 in c83dd64. [](commit_id = c83dd642d5f722a90583a2058438a16a8fc562ea, deletion_comment = False) |
|
@AlekseyTs @cston addressed feedback. In reply to: 581682378 [](ancestors = 581682378) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convention & SignatureMask [](start = 35, length = 26)
Are we silently ignoring bits outside SignatureMask? Should we throw UnsupportedSignatureContent() when decoding those cases instead? #Pending
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cci.CallingConventionUtils.FromSignatureConvention(signatureHeader.CallingConvention) [](start = 63, length = 85)
signatureHeader.CallingConvention.FromSignatureConvention() #WontFix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I specifically didn't do that here because we don't import Cci today, and I'm not willing to go through and remove the Cci. qualifiers from everything else in this file.
In reply to: 375063146 [](ancestors = 375063146)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, there aren't that many here, I'll just do it.
In reply to: 375578610 [](ancestors = 375578610,375063146)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there aren't that many here
But there are conflicting names between Cci. and SRM., so I'll leave it.
In reply to: 375582556 [](ancestors = 375582556,375578610,375063146)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider extracting a helper method for use here and in CreateFromMetadata() above. #Pending
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MakeParametersFromMetadata [](start = 70, length = 26)
It looks like there is only one call site, consider making this a local function #Pending
AlekseyTs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (iteration 3), with refactoring suggestions.
ghost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-approval
@AlekseyTs @dotnet/roslyn-compiler for review.