[linker] Only look for BindAs attributes in assemblies that reference the BindAsAttribute type.
This commit is contained in:
Родитель
9859e04ee2
Коммит
99cc47e99b
|
@ -27,9 +27,16 @@ namespace Xamarin.Linker.Steps
|
|||
|
||||
public override bool IsActiveFor (AssemblyDefinition assembly)
|
||||
{
|
||||
// we need to process all assemblies, because the functions we want to
|
||||
// preserve are not necessarily in the assembly we're processing.
|
||||
if (Profile.IsProductAssembly (assembly))
|
||||
return true;
|
||||
|
||||
// We don't need to process assemblies that don't reference ObjCRuntime.BindAsAttribute.
|
||||
foreach (var tr in assembly.MainModule.GetTypeReferences ()) {
|
||||
if (tr.IsPlatformType ("ObjCRuntime", "BindAsAttribute"))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Preserve (Tuple<MethodDefinition, MethodDefinition> pair, MethodDefinition conditionA, MethodDefinition conditionB = null)
|
||||
|
|
Загрузка…
Ссылка в новой задаче