Imported Upstream version 5.16.0.100

Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-08-07 15:19:03 +00:00
parent 0a9828183b
commit 7d7f676260
4419 changed files with 170950 additions and 90273 deletions

View File

@@ -554,7 +554,8 @@ namespace Mono.CSharp
if (prop != null) {
AttributeEncoder encoder = new AttributeEncoder ();
encoder.EncodeNamedPropertyArgument (prop, new BoolLiteral (Compiler.BuiltinTypes, true, Location.Null));
SetCustomAttribute (pa.Constructor, encoder.ToArray ());
SetCustomAttribute (pa.Constructor, encoder.ToArray (out var references));
module.AddAssemblyReferences (references);
}
}
}

View File

@@ -1064,8 +1064,10 @@ namespace Mono.CSharp {
}
byte[] cdata;
List<Assembly> references;
if (pos_args == null && named_values == null) {
cdata = AttributeEncoder.Empty;
references = null;
} else {
AttributeEncoder encoder = new AttributeEncoder ();
@@ -1138,7 +1140,7 @@ namespace Mono.CSharp {
encoder.EncodeEmptyNamedArguments ();
}
cdata = encoder.ToArray ();
cdata = encoder.ToArray (out references);
}
if (!IsConditionallyExcluded (ctor.DeclaringType)) {
@@ -1157,6 +1159,8 @@ namespace Mono.CSharp {
Error_AttributeEmitError (e.Message);
return;
}
context.Module.AddAssemblyReferences (references);
}
if (!usage_attr.AllowMultiple && allEmitted != null) {
@@ -1415,6 +1419,7 @@ namespace Mono.CSharp {
byte[] buffer;
int pos;
const ushort Version = 1;
List<Assembly> imports;
static AttributeEncoder ()
{
@@ -1594,7 +1599,15 @@ namespace Mono.CSharp {
public void EncodeTypeName (TypeSpec type)
{
var old_type = type.GetMetaInfo ();
Encode (type.MemberDefinition.IsImported ? old_type.AssemblyQualifiedName : old_type.FullName);
if (type.MemberDefinition.IsImported) {
if (imports == null)
imports = new List<Assembly> ();
imports.Add (old_type.Assembly);
Encode (old_type.AssemblyQualifiedName);
} else {
Encode (old_type.FullName);
}
}
public void EncodeTypeName (TypeContainer type)
@@ -1675,8 +1688,10 @@ namespace Mono.CSharp {
Encode (value);
}
public byte[] ToArray ()
public byte[] ToArray (out List<Assembly> assemblyReferences)
{
assemblyReferences = imports;
byte[] buf = new byte[pos];
Array.Copy (buffer, buf, pos);
return buf;
@@ -1990,7 +2005,8 @@ namespace Mono.CSharp {
encoder.Encode ((int) state);
encoder.EncodeEmptyNamedArguments ();
builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());
builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray (out var references));
module.AddAssemblyReferences (references);
}
}
@@ -2024,7 +2040,8 @@ namespace Mono.CSharp {
encoder.Encode ((int) modes);
encoder.EncodeEmptyNamedArguments ();
builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());
builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray (out var references));
module.AddAssemblyReferences (references);
}
}
@@ -2050,7 +2067,8 @@ namespace Mono.CSharp {
encoder.Encode ((uint) bits[0]);
encoder.EncodeEmptyNamedArguments ();
builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());
builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray (out var references));
module.AddAssemblyReferences (references);
}
public void EmitAttribute (FieldBuilder builder, decimal value, Location loc)
@@ -2068,7 +2086,8 @@ namespace Mono.CSharp {
encoder.Encode ((uint) bits[0]);
encoder.EncodeEmptyNamedArguments ();
builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());
builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray (out var references));
module.AddAssemblyReferences (references);
}
}
@@ -2092,7 +2111,8 @@ namespace Mono.CSharp {
encoder.EncodeTypeName (type);
encoder.EncodeEmptyNamedArguments ();
builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());
builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray (out var references));
module.AddAssemblyReferences (references);
}
}

View File

@@ -1 +1 @@
6b1adc297a3831c9f1efbe0d0eb0b1af7230f911
8092280f046fc006f88cc26a3c16879eb284f87d

View File

@@ -1 +1 @@
29e041bd715e98996e4bfcea2ef89ec0acb0c466
7ccbcd2d97409ccff196f83c413c6f42579df9e3

View File

@@ -1 +1 @@
7b3cb46f2b8083c2b0c64084235e9d355426449a
a746fd067a0c412f9d3e0f61b1ae4d71968cd1e0

View File

@@ -1 +1 @@
dbbd59d35a37f994500804a0be64e0f2198832ea
23e4b108880464b2667c55b4d1b718af3f25e67a

View File

@@ -542,7 +542,7 @@ namespace Mono.CSharp
}
);
fixed_buffer_type.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());
fixed_buffer_type.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray (out _));
#endif
//
// Don't emit FixedBufferAttribute attribute for private types
@@ -559,7 +559,8 @@ namespace Mono.CSharp
encoder.Encode (buffer_size);
encoder.EncodeEmptyNamedArguments ();
FieldBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());
FieldBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray (out var references));
Module.AddAssemblyReferences (references);
}
}

View File

@@ -3,6 +3,7 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">net_4_x</Platform>
<ProjectGuid>{D4A01C5B-A1B5-48F5-BB5B-D2E1BD236E56}</ProjectGuid>
<OutputType>Exe</OutputType>
<NoWarn>1699</NoWarn>
@@ -25,7 +26,7 @@
<PropertyGroup Condition=" '$(Platform)' == 'net_4_x' ">
<OutputPath>./../class/lib/net_4_x-$(HostPlatform)</OutputPath>
<IntermediateOutputPath>./../class/obj/$(AssemblyName)-net_4_x-$(HostPlatform)</IntermediateOutputPath>
<DefineConstants>STATIC;NO_SYMBOL_WRITER;NO_AUTHENTICODE;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_PROCESS_START;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>
<DefineConstants>STATIC;NO_SYMBOL_WRITER;NO_AUTHENTICODE;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_PROCESS_START;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM</DefineConstants>
</PropertyGroup>
<!-- @ALL_PROFILE_PROPERTIES@ -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">

View File

@@ -480,6 +480,18 @@ namespace Mono.CSharp
attributes.AddAttribute (attr);
}
public void AddAssemblyReferences (List<Assembly> names)
{
if (names == null)
return;
#if STATIC
foreach (var name in names) {
Builder.__GetAssemblyToken (name);
}
#endif
}
public override void AddTypeContainer (TypeContainer tc)
{
AddTypeContainerMember (tc);

View File

@@ -221,12 +221,13 @@ namespace Mono.CSharp {
REF = 1 << 1,
OUT = 1 << 2,
This = 1 << 3,
CallerMemberName = 1 << 4,
CallerLineNumber = 1 << 5,
CallerFilePath = 1 << 6,
ReadOnly = 1 << 4,
CallerMemberName = 1 << 5,
CallerLineNumber = 1 << 6,
CallerFilePath = 1 << 7,
RefOutMask = REF | OUT,
ModifierMask = PARAMS | REF | OUT | This,
ModifierMask = PARAMS | REF | OUT | This | ReadOnly,
CallerMask = CallerMemberName | CallerLineNumber | CallerFilePath
}