Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -13,6 +13,7 @@
<type fullname="System.Net.SocketAddress" />
<type fullname="System.Net.Sockets.LingerOption" />
<type fullname="System.Net.Sockets.Socket" />
<type fullname="System.Net.Sockets.MulticastOption" preserve="fields" />
<type fullname="System.Net.Sockets.Socket/SocketAsyncResult" preserve="fields" />
<type fullname="System.Net.Sockets.SocketException" />
</assembly>

View File

@@ -269,11 +269,32 @@ namespace Mono.Linker.Steps {
void MarkIfType (CustomAttributeArgument argument)
{
if (argument.Type.FullName != "System.Type")
return;
var at = argument.Type;
if (at.IsArray) {
var et = at.GetElementType ();
if (et.Namespace != "System" || et.Name != "Type")
return;
MarkType (argument.Type);
MarkType ((TypeReference) argument.Value);
MarkType (et);
foreach (var cac in (CustomAttributeArgument[]) argument.Value)
MarkWithResolvedScope ((TypeReference) cac.Value);
} else if (at.Namespace == "System" && at.Name == "Type") {
MarkType (argument.Type);
MarkWithResolvedScope ((TypeReference) argument.Value);
}
}
// custom attributes encoding means it's possible to have a scope that will point into a PCL facade
// 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))
return;
var td = type.Resolve ();
if (td != null)
type.Scope = td.Scope;
MarkType (type);
}
protected bool CheckProcessed (IMetadataTokenProvider provider)