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

[mono][metadata] Add a method custom attribute scanning function #19880

Merged
merged 1 commit into from
Jun 1, 2020

Conversation

monojenkins
Copy link
Contributor

@monojenkins monojenkins commented May 29, 2020

!! This PR is a copy of dotnet/runtime#37172, please do not edit or review it in this repo !!
Do not automatically approve this PR:

* Consider how the changes affect configurations in this repo,
* Check effects on files that are not mirrored,
* Identify test cases that may be needed in this repo.

!! Merge the PR only after the original PR is merged !!



Our normal custom attribute lookup method may trigger loading. This is undesirable during class initialization, for example. For this reason, we have mono_class_metadata_foreach_custom_attr that scans a class for custom attributes without triggering loading.

This PR adds mono_method_metadata_foreach_custom_attr that does the same thing - looks for custom attributes on methods without causing any loader activity.

This PR also reorganizes the code in class-init.c that uses these metadata custom attribute lookups to be a bit easier to use.

Finally we add a convenience method (unused so far) to look for PreserveBaseOverridesAttribute which is defined in dotnet/runtime#35315 and which will be necessary to implement covariant returns.

Our normal custom attribute lookup method may trigger loading.  This is undesirable during class initialization, for example.  For this reason, we have `mono_class_metadata_foreach_custom_attr` that scans a class for custom attributes without triggering loading.

This PR adds `mono_method_metadata_foreach_custom_attr` that does the same thing - looks for custom attributes on methods without causing any loader activity.

This PR also reorganizes the code in `class-init.c` that uses these metadata custom attribute lookups to be a bit easier to use.

Finally we add a convenience method (unused so far) to look for `PreserveBaseOverridesAttribute` which is defined in dotnet/runtime#35315 and which will be necessary to implement covariant returns.
@lambdageek lambdageek merged commit 2d187d7 into mono:master Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants