Imported Upstream version 4.2.0.179

Former-commit-id: 4610231f55806d2a05ed69e5ff3faa7336cc1479
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent aa7da660d6
commit c042cd0c52
7507 changed files with 90259 additions and 657307 deletions

View File

@@ -346,9 +346,25 @@ namespace Mono.Linker.Steps {
// even if we (just before saving) will resolve all type references (bug #26752)
void MarkWithResolvedScope (TypeReference type)
{
// we cannot set the Scope of a TypeSpecification so there's no point in resolving it
if ((type == null) || (type is TypeSpecification))
if (type == null)
return;
// a GenericInstanceType can could contains generic arguments with scope that
// needs to be updated out of the PCL facade (bug #28823)
var git = (type as GenericInstanceType);
if ((git != null) && git.HasGenericArguments) {
foreach (var ga in git.GenericArguments)
MarkWithResolvedScope (ga);
return;
}
// we cannot set the Scope of a TypeSpecification but it's element type can be set
// e.g. System.String[] -> System.String
var ts = (type as TypeSpecification);
if (ts != null) {
MarkWithResolvedScope (ts.GetElementType ());
return;
}
var td = type.Resolve ();
if (td != null)
type.Scope = td.Scope;
@@ -498,6 +514,8 @@ namespace Mono.Linker.Steps {
MarkMethodsIf (type.Methods, IsStaticConstructorPredicate);
}
DoAdditionalTypeProcessing (type);
Annotations.Mark (type);
ApplyPreserveInfo (type);
@@ -505,6 +523,11 @@ namespace Mono.Linker.Steps {
return type;
}
// Allow subclassers to mark additional things when marking a method
protected virtual void DoAdditionalTypeProcessing (TypeDefinition method)
{
}
void MarkTypeSpecialCustomAttributes (TypeDefinition type)
{
if (!type.HasCustomAttributes)
@@ -554,17 +577,21 @@ namespace Mono.Linker.Steps {
return argument != null;
}
protected void MarkNamedMethod (TypeDefinition type, string method_name)
protected int MarkNamedMethod (TypeDefinition type, string method_name)
{
if (!type.HasMethods)
return;
return 0;
int count = 0;
foreach (MethodDefinition method in type.Methods) {
if (method.Name != method_name)
continue;
MarkMethod (method);
count++;
}
return count;
}
void MarkSoapHeader (MethodDefinition method, CustomAttribute attribute)
@@ -941,11 +968,18 @@ namespace Mono.Linker.Steps {
if (ShouldParseMethodBody (method))
MarkMethodBody (method.Body);
DoAdditionalMethodProcessing (method);
Annotations.Mark (method);
ApplyPreserveMethods (method);
}
// Allow subclassers to mark additional things when marking a method
protected virtual void DoAdditionalMethodProcessing (MethodDefinition method)
{
}
void MarkBaseMethods (MethodDefinition method)
{
IList base_methods = Annotations.GetBaseMethods (method);