Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AnnotationStore.AddPreservedMethod (MethodDefinition key, MethodDefinition method) should be in the reference assembly #1456

Closed
rolfbjarne opened this issue Aug 27, 2020 · 1 comment · Fixed by #1524

Comments

@rolfbjarne
Copy link
Member

The method AnnotationStore.AddPreservedMethod (MethodDefinition key, MethodDefinition method):

https://github.com/mono/linker/blob/2b04c065c84aa8f30600e3b1989c537fc77de95b/src/linker/Linker/Annotations.cs#L402-L405

is not in the reference assembly (a different overload is there):

https://github.com/mono/linker/blob/763e8acb9a6c1e5e3e391ce9bcd3b71a13356caf/src/linker/ref/Linker/Annotations.cs#L22-L25

Xamarin.iOS uses this method to preserve a method if another method is preserved:

https://github.com/xamarin/xamarin-macios/blob/d5ddc920e760c116e01395bb98dd22f2af81abc4/tools/linker/MonoTouch.Tuner/PreserveSmartEnumConversionsSubStep.cs#L44-L51

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Aug 27, 2020
radekdoulik added a commit to radekdoulik/linker that referenced this issue Oct 2, 2020
Add `AnnotationStore.AddPreservedMethod` to public API.

Context: dotnet#1456
@radekdoulik
Copy link
Member

I would like to use that method in XA custom step as well, to replace code like https://github.com/xamarin/xamarin-android/blob/d471b4a4308310afb8fa3fa1047003a7caedd57f/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/MonoDroidMarkStep.cs#L437, where we need to move it outside of MarkStep.

marek-safar pushed a commit that referenced this issue Oct 2, 2020
Add `AnnotationStore.AddPreservedMethod` to public API.

Context: #1456
agocke pushed a commit to dotnet/runtime that referenced this issue Nov 16, 2022
Add `AnnotationStore.AddPreservedMethod` to public API.

Context: dotnet/linker#1456


Commit migrated from dotnet/linker@e6dadc9
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants