Skip to content

Factor out binding logic for DynamicallyAccessedMemberTypes#1223

Merged
sbomer merged 4 commits into
dotnet:masterfrom
sbomer:membersBinder
Jun 2, 2020
Merged

Factor out binding logic for DynamicallyAccessedMemberTypes#1223
sbomer merged 4 commits into
dotnet:masterfrom
sbomer:membersBinder

Conversation

@sbomer
Copy link
Copy Markdown
Member

@sbomer sbomer commented May 29, 2020

This will be used for DynamicDependencyAttribute as well.

In #1215 (comment) there were concerns about the performance of HasFlag, potentially boxing on Unity for example. Let's continue the discussion here.

using System.Reflection;
using Mono.Cecil;

namespace Mono.Linker.Dataflow
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: Maybe we should put this into Mono.Linker namespace as it's not DataFlow-only anymore... but I'm fine either way

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, this should go to something like Mono.Linker.TypeDefinitionLookup class and possibly changed to extension methods

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changed to Mono.Linker with extension methods. I kept the class name because this is specific to the DynamicallyAccessedMemberTypes, and doesn't have other member lookup logic.

sbomer added 4 commits June 1, 2020 21:28
This will be used for DynamicDependencyAttribute as well.
Instead of type itself for DynamicallyAccessedMemberTypes.All
- Add clarifying comments
@sbomer sbomer merged commit 1758eaa into dotnet:master Jun 2, 2020
tkapin pushed a commit to tkapin/runtime that referenced this pull request Jan 31, 2023
…inker#1223)

* Factor out binding logic for DynamicallyAccessedMemberTypes

This will be used for DynamicDependencyAttribute as well.

* Use null sentinel

Instead of type itself for DynamicallyAccessedMemberTypes.All

* PR feedback

- Add clarifying comments

* Change namespace and use extension methods

Commit migrated from dotnet/linker@1758eaa
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.

4 participants