You've already forked linux-packaging-mono
Imported Upstream version 6.12.0.86
Former-commit-id: 7a84ce7d08c42c458ac8e74b27186ca863315d79
This commit is contained in:
parent
92747312ea
commit
0b380204a4
1
external/cecil/.github/FUNDING.yml
vendored
Normal file
1
external/cecil/.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
github: jbevain
|
||||
6
external/cecil/Directory.Build.props
vendored
6
external/cecil/Directory.Build.props
vendored
@@ -12,10 +12,10 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
|
||||
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
|
||||
<FrameworkPathOverride Condition=" '$(net40FrameworkPathOverride)' != '' ">$(net40FrameworkPathOverride)</FrameworkPathOverride>
|
||||
<FrameworkPathOverride Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true' AND '$(net40FrameworkPathOverride)' == '' ">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.0-api/</FrameworkPathOverride>
|
||||
<FrameworkPathOverride Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true' AND '$(net40FrameworkPathOverride)' == '' ">/usr/lib/mono/4.0-api/</FrameworkPathOverride>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net40" Version="1.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
||||
27
external/cecil/Mono.Cecil.Cil/ILProcessor.cs
vendored
27
external/cecil/Mono.Cecil.Cil/ILProcessor.cs
vendored
@@ -229,6 +229,16 @@ namespace Mono.Cecil.Cil {
|
||||
instructions.Insert (index + 1, instruction);
|
||||
}
|
||||
|
||||
public void InsertAfter (int index, Instruction instruction)
|
||||
{
|
||||
if (index < 0 || index >= instructions.Count)
|
||||
throw new ArgumentOutOfRangeException ("index");
|
||||
if (instruction == null)
|
||||
throw new ArgumentNullException ("instruction");
|
||||
|
||||
instructions.Insert (index + 1, instruction);
|
||||
}
|
||||
|
||||
public void Append (Instruction instruction)
|
||||
{
|
||||
if (instruction == null)
|
||||
@@ -248,6 +258,15 @@ namespace Mono.Cecil.Cil {
|
||||
Remove (target);
|
||||
}
|
||||
|
||||
public void Replace (int index, Instruction instruction)
|
||||
{
|
||||
if (instruction == null)
|
||||
throw new ArgumentNullException ("instruction");
|
||||
|
||||
InsertAfter (index, instruction);
|
||||
RemoveAt (index);
|
||||
}
|
||||
|
||||
public void Remove (Instruction instruction)
|
||||
{
|
||||
if (instruction == null)
|
||||
@@ -256,5 +275,13 @@ namespace Mono.Cecil.Cil {
|
||||
if (!instructions.Remove (instruction))
|
||||
throw new ArgumentOutOfRangeException ("instruction");
|
||||
}
|
||||
|
||||
public void RemoveAt (int index)
|
||||
{
|
||||
if (index < 0 || index >= instructions.Count)
|
||||
throw new ArgumentOutOfRangeException ("index");
|
||||
|
||||
instructions.RemoveAt (index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
external/cecil/Mono.Cecil.Cil/MethodBody.cs
vendored
2
external/cecil/Mono.Cecil.Cil/MethodBody.cs
vendored
@@ -92,7 +92,7 @@ namespace Mono.Cecil.Cil {
|
||||
var parameter_type = method.DeclaringType as TypeReference;
|
||||
|
||||
if (parameter_type.HasGenericParameters) {
|
||||
var instance = new GenericInstanceType (parameter_type);
|
||||
var instance = new GenericInstanceType (parameter_type, parameter_type.GenericParameters.Count);
|
||||
for (int i = 0; i < parameter_type.GenericParameters.Count; i++)
|
||||
instance.GenericArguments.Add (parameter_type.GenericParameters [i]);
|
||||
|
||||
|
||||
2
external/cecil/Mono.Cecil.nuspec
vendored
2
external/cecil/Mono.Cecil.nuspec
vendored
@@ -2,7 +2,7 @@
|
||||
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<id>Mono.Cecil</id>
|
||||
<version>0.11.0.0</version>
|
||||
<version>0.11.1.0</version>
|
||||
<title>Mono.Cecil</title>
|
||||
<authors>Jb Evain</authors>
|
||||
<owners>Jb Evain</owners>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1728338c6228125c82803b552e530972592837b2
|
||||
b64846368fef5b8e0e61dc51c6e0b8226ec59ad4
|
||||
@@ -63,5 +63,11 @@ namespace Mono.Cecil {
|
||||
: base (method)
|
||||
{
|
||||
}
|
||||
|
||||
internal GenericInstanceMethod (MethodReference method, int arity)
|
||||
: this (method)
|
||||
{
|
||||
this.arguments = new Collection<TypeReference> (arity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,5 +61,11 @@ namespace Mono.Cecil {
|
||||
base.IsValueType = type.IsValueType;
|
||||
this.etype = MD.ElementType.GenericInst;
|
||||
}
|
||||
|
||||
internal GenericInstanceType (TypeReference type, int arity)
|
||||
: this (type)
|
||||
{
|
||||
this.arguments = new Collection<TypeReference> (arity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
5
external/cecil/Mono.Cecil/Import.cs
vendored
5
external/cecil/Mono.Cecil/Import.cs
vendored
@@ -259,8 +259,8 @@ namespace Mono.Cecil {
|
||||
TypeReference ImportGenericInstance (Type type, ImportGenericContext context)
|
||||
{
|
||||
var element_type = ImportType (type.GetGenericTypeDefinition (), context, ImportGenericKind.Definition);
|
||||
var instance = new GenericInstanceType (element_type);
|
||||
var arguments = type.GetGenericArguments ();
|
||||
var instance = new GenericInstanceType (element_type, arguments.Length);
|
||||
var instance_arguments = instance.GenericArguments;
|
||||
|
||||
context.Push (element_type);
|
||||
@@ -633,9 +633,8 @@ namespace Mono.Cecil {
|
||||
case ElementType.GenericInst:
|
||||
var instance = (GenericInstanceType) type;
|
||||
var element_type = ImportType (instance.ElementType, context);
|
||||
var imported_instance = new GenericInstanceType (element_type);
|
||||
|
||||
var arguments = instance.GenericArguments;
|
||||
var imported_instance = new GenericInstanceType (element_type, arguments.Count);
|
||||
var imported_arguments = imported_instance.GenericArguments;
|
||||
|
||||
for (int i = 0; i < arguments.Count; i++)
|
||||
|
||||
2
external/cecil/Mono.Cecil/TypeParser.cs
vendored
2
external/cecil/Mono.Cecil/TypeParser.cs
vendored
@@ -296,7 +296,7 @@ namespace Mono.Cecil {
|
||||
if (generic_arguments.IsNullOrEmpty ())
|
||||
return type;
|
||||
|
||||
var instance = new GenericInstanceType (type);
|
||||
var instance = new GenericInstanceType (type, generic_arguments.Length);
|
||||
var instance_arguments = instance.GenericArguments;
|
||||
|
||||
for (int i = 0; i < generic_arguments.Length; i++)
|
||||
|
||||
@@ -104,7 +104,9 @@ namespace Mono.Collections.Generic {
|
||||
if (capacity < 0)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
|
||||
items = new T [capacity];
|
||||
items = capacity == 0
|
||||
? Empty<T>.Array
|
||||
: new T [capacity];
|
||||
}
|
||||
|
||||
public Collection (ICollection<T> items)
|
||||
|
||||
6
external/cecil/ProjectInfo.cs
vendored
6
external/cecil/ProjectInfo.cs
vendored
@@ -15,6 +15,6 @@ using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: ComVisible (false)]
|
||||
|
||||
[assembly: AssemblyVersion ("0.11.0.0")]
|
||||
[assembly: AssemblyFileVersion ("0.11.0.0")]
|
||||
[assembly: AssemblyInformationalVersion ("0.11.0.0")]
|
||||
[assembly: AssemblyVersion ("0.11.1.0")]
|
||||
[assembly: AssemblyFileVersion ("0.11.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("0.11.1.0")]
|
||||
|
||||
1
external/cecil/README.md
vendored
1
external/cecil/README.md
vendored
@@ -2,3 +2,4 @@ Cecil
|
||||
=====
|
||||
|
||||
This is a fork of [Cecil](https://github.com/jbevain/cecil) library. Please do any pull requests in the original repository before they are merged into Mono fork.
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Mono.Cecil.Tests {
|
||||
if (self.GenericParameters.Count != arguments.Length)
|
||||
throw new ArgumentException ();
|
||||
|
||||
var instance = new GenericInstanceType (self);
|
||||
var instance = new GenericInstanceType (self, arguments.Length);
|
||||
foreach (var argument in arguments)
|
||||
instance.GenericArguments.Add (argument);
|
||||
|
||||
|
||||
@@ -53,6 +53,30 @@ namespace Mono.Cecil.Tests {
|
||||
AssertOpCodeSequence (new [] { OpCodes.Ldloc_0, OpCodes.Ldloc_1, OpCodes.Ldloc_2, OpCodes.Ldloc_3 }, method);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InsertAfterUsingIndex ()
|
||||
{
|
||||
var method = CreateTestMethod (OpCodes.Ldloc_0, OpCodes.Ldloc_2, OpCodes.Ldloc_3);
|
||||
var il = method.GetILProcessor ();
|
||||
|
||||
il.InsertAfter (
|
||||
0,
|
||||
il.Create (OpCodes.Ldloc_1));
|
||||
|
||||
AssertOpCodeSequence (new [] { OpCodes.Ldloc_0, OpCodes.Ldloc_1, OpCodes.Ldloc_2, OpCodes.Ldloc_3 }, method);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ReplaceUsingIndex ()
|
||||
{
|
||||
var method = CreateTestMethod (OpCodes.Ldloc_0, OpCodes.Ldloc_2, OpCodes.Ldloc_3);
|
||||
var il = method.GetILProcessor ();
|
||||
|
||||
il.Replace (1, il.Create (OpCodes.Nop));
|
||||
|
||||
AssertOpCodeSequence (new [] { OpCodes.Ldloc_0, OpCodes.Nop, OpCodes.Ldloc_3 }, method);
|
||||
}
|
||||
|
||||
static void AssertOpCodeSequence (OpCode [] expected, MethodBody body)
|
||||
{
|
||||
var opcodes = body.Instructions.Select (i => i.OpCode).ToArray ();
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Mono.Cecil.Rocks {
|
||||
if (self.GenericParameters.Count != arguments.Length)
|
||||
throw new ArgumentException ();
|
||||
|
||||
var instance = new GenericInstanceType (self);
|
||||
var instance = new GenericInstanceType (self, arguments.Length);
|
||||
|
||||
foreach (var argument in arguments)
|
||||
instance.GenericArguments.Add (argument);
|
||||
|
||||
Reference in New Issue
Block a user