1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-08 03:27:04 +09:00
Satori/docs/tools/illink/optimizations.md
Tlakaelel Axayakatl Ceja 18e20d84fd
Update ILLink wording (#82050)
Update linker wording to disambiguate the term from native linker, switched to illink
Deleted illink steps-explained document since is no longer accurate
This change did not change attribute justification messages
Add changes to use same wording between shared files
2023-02-23 10:44:50 -08:00

1.2 KiB

Optimizations definitions

unusedinterfaces optimization

The unusedinterfaces optimization controls whether or not trimming may remove the interfaceimpl annotation which denotes whether a class implements an interface. When the optimization is off, the ILLink tool will not remove the annotations regardless of the visibility of the interface (even private interface implementations will be kept). However, unused methods from interfaces may still be removed, as well as .override directives from methods that implement an interface method. When the optimization is on and the ILLink tool can provably determine that an interface will not be used on a type, the annotation will be removed. In order to know whether it is safe to remove an interface implementation, it is necessary to have a "global" view of the code. In other words, if an assembly is passed without selecting link for the action option for ILLink, all classes that implement interfaces from that assembly will keep those interface implementation annotations. For example, if you implement System.IFormattable from the System.Runtime assembly, but pass the assembly with --action copy System.Runtime, the interface implementation will be kept even if your code doesn't use it.