Imported Upstream version 4.2.1.124

Former-commit-id: 3b6a300a4ce80578c93599ba6e26a8f66743cde0
This commit is contained in:
Xamarin Public Jenkins
2015-12-09 05:54:53 -05:00
parent 4c37e28ac4
commit d11e8b35fd
33 changed files with 84 additions and 76 deletions

View File

@ -334,6 +334,9 @@ namespace Mono.Linker.Steps {
return;
MarkType (et);
if (argument.Value == null)
return;
foreach (var cac in (CustomAttributeArgument[]) argument.Value)
MarkWithResolvedScope ((TypeReference) cac.Value);
} else if (at.Namespace == "System" && at.Name == "Type") {
@ -355,7 +358,6 @@ namespace Mono.Linker.Steps {
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

View File

@ -129,15 +129,24 @@ namespace Mono.Linker.Steps {
return new Regex (pattern.Replace(".", @"\.").Replace("*", "(.*)"));
}
void MatchType (TypeDefinition type, Regex regex, XPathNavigator nav)
{
if (regex.Match (type.FullName).Success)
ProcessType (type, nav);
if (!type.HasNestedTypes)
return;
foreach (var nt in type.NestedTypes)
MatchType (nt, regex, nav);
}
void ProcessTypePattern (string fullname, AssemblyDefinition assembly, XPathNavigator nav)
{
Regex regex = CreateRegexFromPattern (fullname);
foreach (TypeDefinition type in assembly.MainModule.Types) {
if (!regex.Match (type.FullName).Success)
continue;
ProcessType (type, nav);
MatchType (type, regex, nav);
}
}