Imported Upstream version 5.10.0.47

Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-24 17:04:36 +00:00
parent 88ff76fe28
commit e46a49ecf1
5927 changed files with 226314 additions and 129848 deletions

View File

@ -156,7 +156,6 @@ namespace Mono.Cecil {
this.module.Read (this.module, (module, reader) => {
ReadModuleManifest (reader);
ReadModule (module, resolve_attributes: true);
return module;
});
}
@ -422,10 +421,7 @@ namespace Mono.Cecil {
protected override void ReadModule ()
{
this.module.Read (this.module, (module, reader) => {
ReadModuleManifest (reader);
return module;
});
this.module.Read (this.module, (_, reader) => ReadModuleManifest (reader));
}
public override void ReadSymbols (ModuleDefinition module)
@ -1680,23 +1676,19 @@ namespace Mono.Cecil {
}
}
public PropertyDefinition ReadMethods (PropertyDefinition property)
public void ReadMethods (PropertyDefinition property)
{
ReadAllSemantics (property.DeclaringType);
return property;
}
public EventDefinition ReadMethods (EventDefinition @event)
public void ReadMethods (EventDefinition @event)
{
ReadAllSemantics (@event.DeclaringType);
return @event;
}
public MethodSemanticsAttributes ReadAllSemantics (MethodDefinition method)
public void ReadAllSemantics (MethodDefinition method)
{
ReadAllSemantics (method.DeclaringType);
return method.SemanticsAttributes;
}
void ReadAllSemantics (TypeDefinition type)
@ -2099,6 +2091,11 @@ namespace Mono.Cecil {
return code.ReadMethodBody (method);
}
public int ReadCodeSize (MethodDefinition method)
{
return code.ReadCodeSize (method);
}
public CallSite ReadCallSite (MetadataToken token)
{
if (!MoveTo (Table.StandAloneSig, token.RID))
@ -2365,8 +2362,8 @@ namespace Mono.Cecil {
var type_system = module.TypeSystem;
var context = new MethodReference (string.Empty, type_system.Void);
context.DeclaringType = new TypeReference (string.Empty, string.Empty, module, type_system.CoreLibrary);
var context = new MethodDefinition (string.Empty, MethodAttributes.Static, type_system.Void);
context.DeclaringType = new TypeDefinition (string.Empty, string.Empty, TypeAttributes.Public);
var member_references = new MemberReference [length];
@ -3161,25 +3158,36 @@ namespace Mono.Cecil {
for (int i = 0; i < rows.Length; i++) {
if (rows [i].Col1 == StateMachineScopeDebugInformation.KindIdentifier) {
var signature = ReadSignature (rows [i].Col2);
infos.Add (new StateMachineScopeDebugInformation (signature.ReadInt32 (), signature.ReadInt32 ()));
var scopes = new Collection<StateMachineScope> ();
while (signature.CanReadMore ()) {
var start = signature.ReadInt32 ();
var end = start + signature.ReadInt32 ();
scopes.Add (new StateMachineScope (start, end));
}
var state_machine = new StateMachineScopeDebugInformation ();
state_machine.scopes = scopes;
infos.Add (state_machine);
} else if (rows [i].Col1 == AsyncMethodBodyDebugInformation.KindIdentifier) {
var signature = ReadSignature (rows [i].Col2);
var catch_offset = signature.ReadInt32 () - 1;
var yields = new Collection<InstructionOffset> ();
var resumes = new Collection<InstructionOffset> ();
uint move_next_rid = 0;
var resume_methods = new Collection<MethodDefinition> ();
while (signature.CanReadMore ()) {
yields.Add (new InstructionOffset (signature.ReadInt32 ()));
resumes.Add (new InstructionOffset (signature.ReadInt32 ()));
move_next_rid = signature.ReadCompressedUInt32 ();
resume_methods.Add (GetMethodDefinition (signature.ReadCompressedUInt32 ()));
}
var async_body = new AsyncMethodBodyDebugInformation (catch_offset);
async_body.yields = yields;
async_body.resumes = resumes;
async_body.move_next = GetMethodDefinition (move_next_rid);
async_body.resume_methods = resume_methods;
infos.Add (async_body);
} else if (rows [i].Col1 == EmbeddedSourceDebugInformation.KindIdentifier) {
@ -3348,7 +3356,7 @@ namespace Mono.Cecil {
switch (etype) {
case ElementType.ValueType: {
var value_type = GetTypeDefOrRef (ReadTypeTokenSignature ());
value_type.IsValueType = true;
value_type.KnownValueType ();
return value_type;
}
case ElementType.Class:
@ -3388,8 +3396,8 @@ namespace Mono.Cecil {
ReadGenericInstanceSignature (element_type, generic_instance);
if (is_value_type) {
generic_instance.IsValueType = true;
element_type.GetElementType ().IsValueType = true;
generic_instance.KnownValueType ();
element_type.GetElementType ().KnownValueType ();
}
return generic_instance;