-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Handle 'unmanaged' calling convention value #39030
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This should be looking at the custom modifier on the return parameter only.
If someone places a modifier on one of the parameters, it should be ignored. I think this can actually be hit with C# - a method signature that has a function pointer as one of the parameters would have multiple modifiers in it.
I don't know how to extract that information from
EmbeddedSignatureData
. It's a ridiculously bad API and it should have never been merged into the type system. I get unreasonably angry whenever I see it. @davidwrighton might have advice.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.
Boo, totally missed that. Could the
EmbeddedSignatureData.index
string be an indicator? From looking through how it is set, it looks like the modifiers for the return type should have the 'lowest' index, but I'm not entirely sure what exactly that is representing / how to parse that? It seems like the lowest possible is0.1.1.1
from what I can tell?@davidwrighton - would appreciate any guidance. I'd like to get this change done before the P8 snap tomorrow.
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.
Hmm... yes, the api is the worst. (but it does ... work... blech.) It represents the hierarchy of parsing the signature, and it actually allows for substitution inside of the signature without breaking stuff (which I must say is somewhat miraculous).
However, the goal was to require the modopt for these to be at the very beginning of the modifier stream before any non mod opts. Fortunately, that will result in the index following a consistent pattern. I need to do some research to understand the actual pattern you need to actually work with. I hope I can get back to you today.
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.
Ok, so, you'll want to only examine those modopts which have exactly the index of
0.1.1.1
I've just filed #39329 which adds a test to ensure that this behavior remains consistent.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.
You might also consider adding an constant string to the MethodSignature type named
IndexOfCustomModifiersOnReturnType
and put the magic string in there. I don't like the idea of blindly writing the literal string0.1.1.1
here.