diff options
Diffstat (limited to 'mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs')
-rw-r--r-- | mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs b/mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs index bb944b1b55..30b7779f58 100644 --- a/mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs +++ b/mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs @@ -189,7 +189,7 @@ namespace Mono.Linker.Steps { MarkCustomAttribute (ca); } - void MarkCustomAttribute (CustomAttribute ca) + protected virtual void MarkCustomAttribute (CustomAttribute ca) { MarkMethod (ca.Constructor); @@ -296,7 +296,7 @@ namespace Mono.Linker.Steps { MarkCustomAttributes (module); } - void MarkField (FieldReference reference) + protected void MarkField (FieldReference reference) { // if (IgnoreScope (reference.DeclaringType.Scope)) // return; @@ -346,10 +346,7 @@ namespace Mono.Linker.Steps { protected virtual void MarkSerializable (TypeDefinition type) { - if (!type.HasMethods) - return; - - MarkMethodsIf (type.Methods, IsDefaultConstructorPredicate); + MarkDefaultConstructor (type); MarkMethodsIf (type.Methods, IsSpecialSerializationConstructorPredicate); } @@ -582,6 +579,14 @@ namespace Mono.Linker.Steps { return method.IsConstructor && !method.IsStatic; } + protected void MarkDefaultConstructor (TypeDefinition type) + { + if ((type == null) || !type.HasMethods) + return; + + MarkMethodsIf (type.Methods, IsDefaultConstructorPredicate); + } + static MethodPredicate IsStaticConstructorPredicate = new MethodPredicate (IsStaticConstructor); static bool IsStaticConstructor (MethodDefinition method) @@ -901,12 +906,12 @@ namespace Mono.Linker.Steps { return null; } - void MarkProperty (PropertyDefinition prop) + protected void MarkProperty (PropertyDefinition prop) { MarkCustomAttributes (prop); } - void MarkEvent (EventDefinition evt) + protected void MarkEvent (EventDefinition evt) { MarkCustomAttributes (evt); MarkMethodIfNotNull (evt.AddMethod); |