[linker] Remove now unneeded code from PreserveCode (#8504)

`monotouch-glue.m` was replaced a while ago and the new code does not
need `Class.LookupFullName` to be preserved in debug builds.

Also `PreserveType` was unused code (left from even older times?)
This commit is contained in:
Sebastien Pouliot 2020-05-05 09:27:26 -04:00 коммит произвёл GitHub
Родитель f8be1a8802
Коммит e45278259b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 0 добавлений и 36 удалений

Просмотреть файл

@ -186,7 +186,6 @@ namespace ObjCRuntime {
return Messaging.IntPtr_objc_msgSend (obj, Selector.GetHandle (Selector.Class));
}
// note: PreserveCode.cs keep this around only for debug builds (see: monotouch-glue.m)
internal static string LookupFullName (IntPtr klass)
{
Type type = Lookup (klass);

Просмотреть файл

@ -25,9 +25,6 @@ namespace MonoTouch.Tuner {
PreserveDictionaryConstructor ();
PreserveQueryableEnumerable ();
if (context.GetParameter ("debug-build") == "True")
PreserveDebugFeatures ();
}
void PreserveDictionaryConstructor ()
@ -62,37 +59,5 @@ namespace MonoTouch.Tuner {
foreach (MethodDefinition method in queryable.Methods)
a.AddPreservedMethod (queryable_enumerable, method);
}
void PreserveDebugFeatures ()
{
AssemblyDefinition monotouch;
if (!Context.TryGetLinkedAssembly ((Profile.Current as BaseProfile).ProductAssembly, out monotouch))
return;
var klass = monotouch.MainModule.GetType (Namespaces.ObjCRuntime, "Class");
if (klass == null || !klass.HasMethods)
return;
foreach (MethodDefinition method in klass.Methods) {
if (method.Name == "LookupFullName")
Context.Annotations.AddPreservedMethod (klass, method);
}
}
void PreserveType (TypeDefinition type)
{
if (type == null)
return;
Context.Annotations.Mark (type);
foreach (var method in type.Methods)
Context.Annotations.AddPreservedMethod (type, method);
if (!type.HasNestedTypes)
return;
foreach (var nested in type.NestedTypes)
PreserveType (nested);
}
}
}