Просмотр исходного кода

更新ILRuntime,支持Unity编译的Hotfix dll

tanghai 6 лет назад
Родитель
Сommit
fde616a62a
100 измененных файлов с 82 добавлено и 12903 удалено
  1. 1 1
      Server/Model/Module/Demo/Config/UnitConfig.cs
  2. 4 4
      Unity/Assets/Editor/ExcelExporterEditor/ExcelExporterEditor.cs
  3. 1 1
      Unity/Assets/Hotfix/Module/Demo/Config.meta
  4. 1 1
      Unity/Assets/Hotfix/Module/Demo/Config/UnitConfig.cs
  5. 0 0
      Unity/Assets/Hotfix/Module/Demo/Config/UnitConfig.cs.meta
  6. 9 7
      Unity/Assets/Model/Entity/Hotfix.cs
  7. 2 2
      Unity/Assets/Model/Module/Config/ConfigAttribute.cs
  8. 1 1
      Unity/Assets/Model/Module/Demo/Config.meta
  9. 1 1
      Unity/Assets/Model/Module/Demo/Config/UnitConfig.cs
  10. 1 1
      Unity/Assets/Model/Module/Demo/Config/UnitConfig.cs.meta
  11. 14 13
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/Method/ILMethod.cs
  12. 11 4
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/TypeSystem/ILType.cs
  13. 1 1
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/Utils/Extensions.cs
  14. 7 0
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeType.cs
  15. 5 0
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeWrapperType.cs
  16. 17 10
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Debugger/DebugService.cs
  17. 3 17
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/AppDomain.cs
  18. 1 1
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/InvocationContext.cs
  19. 1 1
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Intepreter/ILIntepreter.cs
  20. 1 1
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Intepreter/ILRuntimeException.cs
  21. 0 394
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/CodeReader.cs
  22. 0 38
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/CodeWriter.cs
  23. 0 112
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/Document.cs
  24. 0 267
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/MethodBody.cs
  25. 0 70
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/SequencePoint.cs
  26. 0 243
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/Symbols.cs
  27. 0 52
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/VariableDefinition.cs
  28. 0 75
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/VariableReference.cs
  29. 0 61
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/BlobHeap.cs
  30. 0 36
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/Buffers.cs
  31. 0 46
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/CodedIndex.cs
  32. 0 59
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/GuidHeap.cs
  33. 0 48
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/Heap.cs
  34. 0 81
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/StringHeap.cs
  35. 0 56
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/TokenType.cs
  36. 0 61
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/UserStringHeap.cs
  37. 0 354
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/Utilities.cs
  38. 0 51
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/BinaryStreamReader.cs
  39. 0 31
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/BinaryStreamWriter.cs
  40. 0 184
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/ByteBuffer.cs
  41. 0 78
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/ByteBufferEqualityComparer.cs
  42. 0 50
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/DataDirectory.cs
  43. 0 166
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/Image.cs
  44. 0 694
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/ImageReader.cs
  45. 0 0
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/ImageWriter.cs
  46. 0 43
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/Section.cs
  47. 0 0
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/TextMap.cs
  48. 0 163
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyDefinition.cs
  49. 0 42
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyFlags.cs
  50. 0 36
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyHashAlgorithm.cs
  51. 0 57
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyLinkedResource.cs
  52. 0 50
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyNameDefinition.cs
  53. 0 296
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyNameReference.cs
  54. 0 3342
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyReader.cs
  55. 0 47
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyWriter.cs
  56. 0 172
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/BaseAssemblyResolver.cs
  57. 0 70
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/DefaultAssemblyResolver.cs
  58. 0 105
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/EmbeddedResource.cs
  59. 0 39
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/EventAttributes.cs
  60. 0 57
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/EventReference.cs
  61. 0 249
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ExportedType.cs
  62. 0 271
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/FieldDefinition.cs
  63. 0 83
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/FieldReference.cs
  64. 0 35
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/FileAttributes.cs
  65. 0 95
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/GenericInstanceMethod.cs
  66. 0 93
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/GenericInstanceType.cs
  67. 0 45
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/GenericParameterAttributes.cs
  68. 0 57
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IConstantProvider.cs
  69. 0 63
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ICustomAttributeProvider.cs
  70. 0 66
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IGenericInstance.cs
  71. 0 79
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IGenericParameterProvider.cs
  72. 0 59
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IMarshalInfoProvider.cs
  73. 0 105
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IMemberDefinition.cs
  74. 0 41
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IMetadataScope.cs
  75. 0 35
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IMetadataTokenProvider.cs
  76. 0 75
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IMethodSignature.cs
  77. 0 286
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/Import.cs
  78. 0 60
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/LinkedResource.cs
  79. 0 39
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ManifestResourceAttributes.cs
  80. 0 92
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MemberDefinitionCollection.cs
  81. 0 370
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MetadataResolver.cs
  82. 0 40
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MethodCallingConvention.cs
  83. 0 570
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MethodDefinition.cs
  84. 0 53
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MethodImplAttributes.cs
  85. 0 247
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MethodReference.cs
  86. 0 43
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MethodSemanticsAttributes.cs
  87. 0 755
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ModuleDefinition.cs
  88. 0 64
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ModuleKind.cs
  89. 0 67
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ModuleReference.cs
  90. 0 73
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/NativeType.cs
  91. 0 62
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PInvokeAttributes.cs
  92. 0 138
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PInvokeInfo.cs
  93. 0 45
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ParameterAttributes.cs
  94. 0 186
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ParameterDefinition.cs
  95. 0 80
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ParameterDefinitionCollection.cs
  96. 0 75
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ParameterReference.cs
  97. 0 53
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PinnedType.cs
  98. 0 61
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PointerType.cs
  99. 0 41
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PropertyAttributes.cs
  100. 0 59
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PropertyReference.cs

+ 1 - 1
Server/Model/Module/Demo/UnitConfig.cs → Server/Model/Module/Demo/Config/UnitConfig.cs

@@ -1,6 +1,6 @@
 namespace ETModel
 {
-	[Config(AppType.ClientH |  AppType.ClientM | AppType.Gate | AppType.Map)]
+	[Config((int)(AppType.ClientH |  AppType.ClientM | AppType.Gate | AppType.Map))]
 	public partial class UnitConfigCategory : ACategory<UnitConfig>
 	{
 	}

+ 4 - 4
Unity/Assets/Editor/ExcelExporterEditor/ExcelExporterEditor.cs

@@ -61,8 +61,8 @@ public class ExcelExporterEditor : EditorWindow
 				
 				ExportAll(clientPath);
 				
-				ExportAllClass(@"./Assets/Model/Entity/Config", "namespace ETModel\n{\n");
-				ExportAllClass(@"./Assets/Hotfix/Entity/Config", "using ETModel;\n\nnamespace ETHotfix\n{\n");
+				ExportAllClass(@"./Assets/Model/Module/Demo/Config", "namespace ETModel\n{\n");
+				ExportAllClass(@"./Assets/Hotfix/Module/Demo/Config", "using ETModel;\n\nnamespace ETHotfix\n{\n");
 				
 				Log.Info($"导出客户端配置完成!");
 			}
@@ -73,7 +73,7 @@ public class ExcelExporterEditor : EditorWindow
 				
 				ExportAll(ServerConfigPath);
 				
-				ExportAllClass(@"../Server/Model/Entity/Config", "namespace ETModel\n{\n");
+				ExportAllClass(@"../Server/Model/Module/Demo/Config", "namespace ETModel\n{\n");
 				
 				Log.Info($"导出服务端配置完成!");
 			}
@@ -121,7 +121,7 @@ public class ExcelExporterEditor : EditorWindow
 			ISheet sheet = xssfWorkbook.GetSheetAt(0);
 			sb.Append(csHead);
 
-			sb.Append($"\t[Config({GetCellString(sheet, 0, 0)})]\n");
+			sb.Append($"\t[Config((int)({GetCellString(sheet, 0, 0)}))]\n");
 			sb.Append($"\tpublic partial class {protoName}Category : ACategory<{protoName}>\n");
 			sb.Append("\t{\n");
 			sb.Append("\t}\n\n");

+ 1 - 1
Unity/Assets/Hotfix/Entity/Config.meta → Unity/Assets/Hotfix/Module/Demo/Config.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: ccf31d544df569945bd2d44bf8481e1e
+guid: 1b15620647f4932428faeaaca0893b53
 folderAsset: yes
 DefaultImporter:
   externalObjects: {}

+ 1 - 1
Unity/Assets/Hotfix/Entity/Config/UnitConfig.cs → Unity/Assets/Hotfix/Module/Demo/Config/UnitConfig.cs

@@ -2,7 +2,7 @@ using ETModel;
 
 namespace ETHotfix
 {
-	[Config(AppType.ClientH |  AppType.ClientM | AppType.Gate | AppType.Map)]
+	[Config((int)(AppType.ClientH |  AppType.ClientM | AppType.Gate | AppType.Map))]
 	public partial class UnitConfigCategory : ACategory<UnitConfig>
 	{
 	}

+ 0 - 0
Unity/Assets/Hotfix/Entity/Config/UnitConfig.cs.meta → Unity/Assets/Hotfix/Module/Demo/Config/UnitConfig.cs.meta


+ 9 - 7
Unity/Assets/Model/Entity/Hotfix.cs

@@ -2,15 +2,19 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
-using System.Reflection;
 using UnityEngine;
+#if ILRuntime
+using System.Reflection;
+#endif
 
 namespace ETModel
 {
-	public sealed class Hotfix : Object
+	public sealed class Hotfix: Object
 	{
 #if ILRuntime
 		private ILRuntime.Runtime.Enviorment.AppDomain appDomain;
+		private MemoryStream dllStream;
+		private MemoryStream pdbStream;
 #else
 		private Assembly assembly;
 #endif
@@ -47,11 +51,9 @@ namespace ETModel
 			Log.Debug($"当前使用的是ILRuntime模式");
 			this.appDomain = new ILRuntime.Runtime.Enviorment.AppDomain();
 
-			using (MemoryStream fs = new MemoryStream(assBytes))
-			using (MemoryStream p = new MemoryStream(pdbBytes))
-			{
-				this.appDomain.LoadAssembly(fs, p, new Mono.Cecil.Pdb.PdbReaderProvider());
-			}
+			this.dllStream = new MemoryStream(assBytes);
+			this.pdbStream = new MemoryStream(pdbBytes);
+			this.appDomain.LoadAssembly(this.dllStream, this.pdbStream, new Mono.Cecil.Pdb.PdbReaderProvider());
 
 			this.start = new ILStaticMethod(this.appDomain, "ETHotfix.Init", "Start", 0);
 			

+ 2 - 2
Unity/Assets/Model/Module/Config/ConfigAttribute.cs

@@ -7,9 +7,9 @@ namespace ETModel
 	{
 		public AppType Type { get; }
 
-		public ConfigAttribute(AppType type)
+		public ConfigAttribute(int type)
 		{
-			this.Type = type;
+			this.Type = (AppType)type;
 		}
 	}
 }

+ 1 - 1
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20.meta → Unity/Assets/Model/Module/Demo/Config.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 3fc7b998c1246164aac5aa55cf027d33
+guid: 8a82f0ca01428384a8af557ca93127cb
 folderAsset: yes
 DefaultImporter:
   externalObjects: {}

+ 1 - 1
Unity/Assets/Model/Module/Demo/UnitConfig.cs → Unity/Assets/Model/Module/Demo/Config/UnitConfig.cs

@@ -1,6 +1,6 @@
 namespace ETModel
 {
-	[Config(AppType.ClientH |  AppType.ClientM | AppType.Gate | AppType.Map)]
+	[Config((int)(AppType.ClientH |  AppType.ClientM | AppType.Gate | AppType.Map))]
 	public partial class UnitConfigCategory : ACategory<UnitConfig>
 	{
 	}

+ 1 - 1
Unity/Assets/Model/Module/Demo/UnitConfig.cs.meta → Unity/Assets/Model/Module/Demo/Config/UnitConfig.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 3c9acb9184f1f0749862cd59e64ce703
+guid: ef7492d2262be6e49ae8dc6278356e49
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 14 - 13
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/Method/ILMethod.cs

@@ -158,13 +158,14 @@ namespace ILRuntime.CLR.Method
 
         Mono.Cecil.Cil.SequencePoint GetValidSequence(int startIdx, int dir)
         {
-            var cur = DebugService.FindSequencePoint(def.Body.Instructions[startIdx]);
+            var seqMapping = def.DebugInformation.GetSequencePointMapping();
+            var cur = DebugService.FindSequencePoint(def.Body.Instructions[startIdx], seqMapping);
             while (cur != null && cur.StartLine == 0x0feefee)
             {
                 startIdx += dir;
                 if (startIdx >= 0 && startIdx < def.Body.Instructions.Count)
                 {
-                    cur = DebugService.FindSequencePoint(def.Body.Instructions[startIdx]);
+                    cur = DebugService.FindSequencePoint(def.Body.Instructions[startIdx], seqMapping);
                 }
                 else
                     break;
@@ -528,7 +529,7 @@ namespace ILRuntime.CLR.Method
             {
                 TypeReference _ref = ((TypeReference)token);
                 if (_ref.IsArray)
-                    return CheckHasGenericParamter(_ref.GetElementType());
+                    return CheckHasGenericParamter(((ArrayType)_ref).ElementType);
                 if (_ref.IsGenericParameter)
                     return true;
                 if (_ref.IsGenericInstance)
@@ -576,16 +577,16 @@ namespace ILRuntime.CLR.Method
                 bool isArray = false;
                 int rank = 1;
                 TypeReference pt = i.ParameterType;
-                if (i.ParameterType.IsByReference)
+                if (pt.IsByReference)
                 {
                     isByRef = true;
-                    pt = pt.GetElementType();
+                    pt = ((ByReferenceType)pt).ElementType;
                 }
-                if (i.ParameterType.IsArray)
+                if (pt.IsArray)
                 {
                     isArray = true;
                     rank = ((ArrayType)pt).Rank;
-                    pt = pt.GetElementType();
+                    pt = ((ArrayType)pt).ElementType;
                 }
                 if (pt.IsGenericParameter)
                 {
@@ -608,14 +609,14 @@ namespace ILRuntime.CLR.Method
                         else
                             throw new NotSupportedException("Cannot find Generic Parameter " + pt.Name + " in " + def.FullName);
                     }
-
-                    if (isByRef)
-                        type = type.MakeByRefType();
-                    if (isArray)
-                        type = type.MakeArrayType(rank);
                 }
                 else
-                    type = appdomain.GetType(i.ParameterType, declaringType, this);
+                    type = appdomain.GetType(pt, declaringType, this);
+
+                if (isByRef)
+                    type = type.MakeByRefType();
+                if (isArray)
+                    type = type.MakeArrayType(rank);
                 parameters.Add(type);
             }
         }

+ 11 - 4
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/TypeSystem/ILType.cs

@@ -39,6 +39,7 @@ namespace ILRuntime.CLR.TypeSystem
         List<ILType> genericInstances;
         bool isDelegate;
         ILRuntimeType reflectionType;
+        ILType genericDefinition;
         IType firstCLRBaseType, firstCLRInterface;
         int hashCode = -1;
         static int instance_id = 0x10000000;
@@ -286,7 +287,7 @@ namespace ILRuntime.CLR.TypeSystem
                         definition = null;
                     }
                     else
-                        RetriveDefinitino(def.GetElementType());
+                        RetriveDefinitino(((TypeSpecification)def).ElementType);
                 }
                 else
                     definition = def as TypeDefinition;
@@ -300,6 +301,11 @@ namespace ILRuntime.CLR.TypeSystem
                 return genericArguments != null;
             }
         }
+
+        public ILType GetGenericDefinition()
+        {
+            return genericDefinition;
+        }
         public KeyValuePair<string, IType>[] GenericArguments
         {
             get
@@ -490,7 +496,7 @@ namespace ILRuntime.CLR.TypeSystem
                 interfaces = new IType[definition.Interfaces.Count];
                 for (int i = 0; i < interfaces.Length; i++)
                 {
-                    interfaces[i] = appdomain.GetType(definition.Interfaces[i], this, null);
+                    interfaces[i] = appdomain.GetType(definition.Interfaces[i].InterfaceType, this, null);
                     //only one clrInterface is valid
                     if (interfaces[i] is CLRType && firstCLRInterface == null)
                     {
@@ -517,7 +523,7 @@ namespace ILRuntime.CLR.TypeSystem
                 if (definition.BaseType.IsGenericInstance)
                 {
                     GenericInstanceType git = definition.BaseType as GenericInstanceType;
-                    var elementType = appdomain.GetType(definition.BaseType.GetElementType(), this, null);
+                    var elementType = appdomain.GetType(git.ElementType, this, null);
                     if (elementType is CLRType)
                     {
                         for (int i = 0; i < git.GenericArguments.Count; i++)
@@ -536,7 +542,7 @@ namespace ILRuntime.CLR.TypeSystem
                 if (specialProcess)
                 {
                     //如果泛型参数是自身,则必须要特殊处理,否则会StackOverflow
-                    var elementType = appdomain.GetType(definition.BaseType.GetElementType(), this, null);
+                    var elementType = appdomain.GetType(((GenericInstanceType)definition.BaseType).ElementType, this, null);
                     foreach (var i in appdomain.CrossBindingAdaptors)
                     {
                         if (i.Key.IsGenericType && !i.Key.IsGenericTypeDefinition)
@@ -1117,6 +1123,7 @@ namespace ILRuntime.CLR.TypeSystem
                     return i;
             }
             var res = new ILType(definition, appdomain);
+            res.genericDefinition = this;
             res.genericArguments = genericArguments;
 
             genericInstances.Add(res);

+ 1 - 1
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/Utils/Extensions.cs

@@ -30,7 +30,7 @@ namespace ILRuntime.CLR.Utils
                     if ((t == null && def.IsGenericInstance) || (t != null && t.HasGenericParameter))
                     {
                         GenericInstanceMethod gim = (GenericInstanceMethod)def;
-                        string name = i.ParameterType.IsByReference ? i.ParameterType.GetElementType().FullName : i.ParameterType.FullName;
+                        string name = i.ParameterType.IsByReference ? ((ByReferenceType)i.ParameterType).ElementType.FullName : i.ParameterType.FullName;
                         
                         for (int j = 0; j < gim.GenericArguments.Count; j++)
                         {

+ 7 - 0
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeType.cs

@@ -568,6 +568,13 @@ namespace ILRuntime.Reflection
             }
         }
 
+        public override Type GetGenericTypeDefinition()
+        {
+            var def = type.GetGenericDefinition();
+
+            return def != null ? def.ReflectionType : null;
+        }
+
         public override bool IsGenericTypeDefinition
         {
             get

+ 5 - 0
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeWrapperType.cs

@@ -245,6 +245,11 @@ namespace ILRuntime.Reflection
             }
         }
 
+        public override Type GetGenericTypeDefinition()
+        {
+            return et.GetGenericTypeDefinition();
+        }
+
         public override bool IsGenericParameter
         {
             get

+ 17 - 10
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Debugger/DebugService.cs

@@ -94,7 +94,7 @@ namespace ILRuntime.Runtime.Debugger
             return false;
         }
 
-        public string GetStackTrance(ILIntepreter intepreper)
+        public string GetStackTrace(ILIntepreter intepreper)
         {
             StringBuilder sb = new StringBuilder();
             ILRuntime.CLR.Method.ILMethod m;
@@ -113,7 +113,8 @@ namespace ILRuntime.Runtime.Debugger
                 if (f.Address != null)
                 {
                     ins = m.Definition.Body.Instructions[f.Address.Value];
-                    var seq = FindSequencePoint(ins);
+                    
+                    var seq = FindSequencePoint(ins, m.Definition.DebugInformation.GetSequencePointMapping());
                     if (seq != null)
                     {
                         document = string.Format("{0}:Line {1}", seq.Document.Url, seq.StartLine);
@@ -183,7 +184,9 @@ namespace ILRuntime.Runtime.Debugger
                     var v = StackObject.ToObject(val, intepreter.AppDomain, intepreter.Stack.ManagedStack);
                     if (v == null)
                         v = "null";
-                    string name = string.IsNullOrEmpty(lv.Name) ? "v" + lv.Index : lv.Name;
+                    string vName = null;
+                    m.Definition.DebugInformation.TryGetName(lv, out vName);                    
+                    string name = string.IsNullOrEmpty(vName) ? "v" + lv.Index : vName;
                     sb.AppendFormat("{0} {1} = {2}", lv.VariableType.Name, name, v);
                     if ((i % 3 == 0 && i != 0) || i == m.LocalVariableCount - 1)
                         sb.AppendLine();
@@ -198,13 +201,14 @@ namespace ILRuntime.Runtime.Debugger
             return sb.ToString();
         }
 
-        internal static Mono.Cecil.Cil.SequencePoint FindSequencePoint(Mono.Cecil.Cil.Instruction ins)
+        internal static Mono.Cecil.Cil.SequencePoint FindSequencePoint(Mono.Cecil.Cil.Instruction ins, IDictionary<Mono.Cecil.Cil.Instruction, Mono.Cecil.Cil.SequencePoint> seqMapping)
         {
             Mono.Cecil.Cil.Instruction cur = ins;
-            while (cur.SequencePoint == null && cur.Previous != null)
+            Mono.Cecil.Cil.SequencePoint sp;
+            while (!seqMapping.TryGetValue(cur, out sp) && cur.Previous != null)
                 cur = cur.Previous;
 
-            return cur.SequencePoint;
+            return sp;
         }
 
         unsafe StackObject* Add(StackObject* a, int b)
@@ -308,7 +312,7 @@ namespace ILRuntime.Runtime.Debugger
 
                 if (lst != null)
                 {
-                    var sp = method.Definition.Body.Instructions[ip].SequencePoint;
+                    var sp = method.Definition.DebugInformation.GetSequencePoint(method.Definition.Body.Instructions[ip]);
                     if (sp != null)
                     {
                         foreach (var i in lst)
@@ -325,7 +329,7 @@ namespace ILRuntime.Runtime.Debugger
 
                 if (!bpHit)
                 {
-                    var sp = method.Definition.Body.Instructions[ip].SequencePoint;
+                    var sp = method.Definition.DebugInformation.GetSequencePoint(method.Definition.Body.Instructions[ip]);//.SequencePoint;
                     if (sp != null && IsSequenceValid(sp))
                     {
                         switch (intp.CurrentStepType)
@@ -403,7 +407,8 @@ namespace ILRuntime.Runtime.Debugger
                 if (f.Address != null)
                 {
                     ins = m.Definition.Body.Instructions[f.Address.Value];
-                    var seq = FindSequencePoint(ins);
+
+                    var seq = FindSequencePoint(ins, m.Definition.DebugInformation.GetSequencePointMapping());
                     if (seq != null)
                     {
                         info.DocumentName = seq.Document.Url;
@@ -457,7 +462,9 @@ namespace ILRuntime.Runtime.Debugger
                     var val = Add(topFrame.LocalVarPointer, locIdx);
                     var v = StackObject.ToObject(val, intp.AppDomain, intp.Stack.ManagedStack);
                     var type = intp.AppDomain.GetType(lv.VariableType, m.DeclearingType, m);
-                    string name = string.IsNullOrEmpty(lv.Name) ? "v" + lv.Index : lv.Name;
+                    string vName = null;
+                    m.Definition.DebugInformation.TryGetName(lv, out vName);
+                    string name = string.IsNullOrEmpty(vName) ? "v" + lv.Index : vName;
                     VariableInfo vinfo = VariableInfo.FromObject(v);
                     vinfo.Address = (long)val;
                     vinfo.Name = name;

+ 3 - 17
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/AppDomain.cs

@@ -368,6 +368,7 @@ namespace ILRuntime.Runtime.Enviorment
         /// <param name="stream">Assembly Stream</param>
         /// <param name="symbol">symbol Stream</param>
         /// <param name="symbolReader">symbol 读取器</param>
+        /// <param name="inMemory">是否完整读入内存</param>
         public void LoadAssembly(System.IO.Stream stream, System.IO.Stream symbol, ISymbolReaderProvider symbolReader)
         {
             var module = ModuleDefinition.ReadModule(stream); //从MONO中加载模块
@@ -413,7 +414,6 @@ namespace ILRuntime.Runtime.Enviorment
                 doubleType = GetType("System.Double");
                 objectType = GetType("System.Object");
             }
-            module.AssemblyResolver.ResolveFailure += AssemblyResolver_ResolveFailure;
 #if DEBUG && !DISABLE_ILRUNTIME_DEBUG
             debugService.NotifyModuleLoaded(module.Name);
 #endif
@@ -429,20 +429,6 @@ namespace ILRuntime.Runtime.Enviorment
             references[name] = content;
         }
 
-        private AssemblyDefinition AssemblyResolver_ResolveFailure(object sender, AssemblyNameReference reference)
-        {
-            byte[] content;
-            if (references.TryGetValue(reference.Name, out content))
-            {
-                using (System.IO.MemoryStream ms = new System.IO.MemoryStream(content))
-                {
-                    return AssemblyDefinition.ReadAssembly(ms);
-                }
-            }
-            else
-                return null;
-        }
-
         public void RegisterCLRMethodRedirection(MethodBase mi, CLRRedirectionDelegate func)
         {
             if (mi == null)
@@ -740,7 +726,7 @@ namespace ILRuntime.Runtime.Enviorment
                 }
                 if (_ref.IsByReference)
                 {
-                    var et = _ref.GetElementType();
+                    var et = ((ByReferenceType)_ref).ElementType;
                     bool valid = !et.ContainsGenericParameter;
                     var t = GetType(et, contextType, contextMethod);
                     if (t != null)
@@ -764,7 +750,7 @@ namespace ILRuntime.Runtime.Enviorment
                 if (_ref.IsArray)
                 {
                     ArrayType at = (ArrayType)_ref;
-                    var t = GetType(_ref.GetElementType(), contextType, contextMethod);
+                    var t = GetType(at.ElementType, contextType, contextMethod);
                     if (t != null)
                     {
                         res = t.MakeArrayType(at.Rank);

+ 1 - 1
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/InvocationContext.cs

@@ -196,7 +196,7 @@ namespace ILRuntime.Runtime.Enviorment
 
         public void PushDouble<T>(T val)
         {
-            PushFloat(PrimitiveConverter<T>.CheckAndInvokeToFloat(val));
+            PushDouble(PrimitiveConverter<T>.CheckAndInvokeToDouble(val));
         }
 
         public void PushDouble(double val)

+ 1 - 1
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Intepreter/ILIntepreter.cs

@@ -4127,7 +4127,7 @@ namespace ILRuntime.Runtime.Intepreter
                                         ex.Data["ThisInfo"] = debugger.GetThisInfo(this);
                                     else
                                         ex.Data["ThisInfo"] = "";
-                                    ex.Data["StackTrace"] = debugger.GetStackTrance(this);
+                                    ex.Data["StackTrace"] = debugger.GetStackTrace(this);
                                     ex.Data["LocalInfo"] = debugger.GetLocalVariableInfo(this);
                                 }
                                 //Clear call stack

+ 1 - 1
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Intepreter/ILRuntimeException.cs

@@ -25,7 +25,7 @@ namespace ILRuntime.Runtime.Intepreter
             }
             else
             {
-                stackTrace = ds.GetStackTrance(intepreter);
+                stackTrace = ds.GetStackTrace(intepreter);
                 if (method.HasThis)
                     thisInfo = ds.GetThisInfo(intepreter);
                 else

+ 0 - 394
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/CodeReader.cs

@@ -1,394 +0,0 @@
-//
-// CodeReader.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Cecil.PE;
-using Mono.Collections.Generic;
-
-using RVA = System.UInt32;
-
-namespace Mono.Cecil.Cil
-{
-
-    sealed class CodeReader : ByteBuffer
-    {
-
-        readonly internal MetadataReader reader;
-
-        int start;
-        Section code_section;
-
-        MethodDefinition method;
-        MethodBody body;
-
-        int Offset
-        {
-            get { return base.position - start; }
-        }
-
-        public CodeReader(Section section, MetadataReader reader)
-            : base(section.Data)
-        {
-            this.code_section = section;
-            this.reader = reader;
-        }
-
-        public MethodBody ReadMethodBody(MethodDefinition method)
-        {
-            this.method = method;
-            this.body = new MethodBody(method);
-
-            reader.context = method;
-
-            ReadMethodBody();
-
-            return this.body;
-        }
-
-        public void MoveTo(int rva)
-        {
-            if (!IsInSection(rva))
-            {
-                code_section = reader.image.GetSectionAtVirtualAddress((uint)rva);
-                Reset(code_section.Data);
-            }
-
-            base.position = rva - (int)code_section.VirtualAddress;
-        }
-
-        bool IsInSection(int rva)
-        {
-            return code_section.VirtualAddress <= rva && rva < code_section.VirtualAddress + code_section.SizeOfRawData;
-        }
-
-        void ReadMethodBody()
-        {
-            MoveTo(method.RVA);
-
-            var flags = ReadByte();
-            switch (flags & 0x3)
-            {
-                case 0x2: // tiny
-                    body.code_size = flags >> 2;
-                    body.MaxStackSize = 8;
-                    ReadCode();
-                    break;
-                case 0x3: // fat
-                    base.position--;
-                    ReadFatMethod();
-                    break;
-                default:
-                    throw new InvalidOperationException();
-            }
-
-            var symbol_reader = reader.module.symbol_reader;
-
-            if (symbol_reader != null)
-            {
-                var instructions = body.Instructions;
-                symbol_reader.Read(body, offset => GetInstruction(instructions, offset));
-            }
-        }
-
-        void ReadFatMethod()
-        {
-            var flags = ReadUInt16();
-            body.max_stack_size = ReadUInt16();
-            body.code_size = (int)ReadUInt32();
-            body.local_var_token = new MetadataToken(ReadUInt32());
-            body.init_locals = (flags & 0x10) != 0;
-
-            if (body.local_var_token.RID != 0)
-                body.variables = ReadVariables(body.local_var_token);
-
-            ReadCode();
-
-            if ((flags & 0x8) != 0)
-                ReadSection();
-        }
-
-        public VariableDefinitionCollection ReadVariables(MetadataToken local_var_token)
-        {
-            var position = reader.position;
-            var variables = reader.ReadVariables(local_var_token);
-            reader.position = position;
-
-            return variables;
-        }
-
-        void ReadCode()
-        {
-            start = position;
-            var code_size = body.code_size;
-
-            if (code_size < 0 || buffer.Length <= (uint)(code_size + position))
-                code_size = 0;
-
-            var end = start + code_size;
-            var instructions = body.instructions = new InstructionCollection((code_size + 1) / 2);
-
-            while (position < end)
-            {
-                var offset = base.position - start;
-                var opcode = ReadOpCode();
-                var current = new Instruction(offset, opcode);
-
-                if (opcode.OperandType != OperandType.InlineNone)
-                    current.operand = ReadOperand(current);
-
-                instructions.Add(current);
-            }
-
-            ResolveBranches(instructions);
-        }
-
-        OpCode ReadOpCode()
-        {
-            var il_opcode = ReadByte();
-            return il_opcode != 0xfe
-                ? OpCodes.OneByteOpCode[il_opcode]
-                : OpCodes.TwoBytesOpCode[ReadByte()];
-        }
-
-        object ReadOperand(Instruction instruction)
-        {
-            switch (instruction.opcode.OperandType)
-            {
-                case OperandType.InlineSwitch:
-                    var length = ReadInt32();
-                    var base_offset = Offset + (4 * length);
-                    var branches = new int[length];
-                    for (int i = 0; i < length; i++)
-                        branches[i] = base_offset + ReadInt32();
-                    return branches;
-                case OperandType.ShortInlineBrTarget:
-                    return ReadSByte() + Offset;
-                case OperandType.InlineBrTarget:
-                    return ReadInt32() + Offset;
-                case OperandType.ShortInlineI:
-                    if (instruction.opcode == OpCodes.Ldc_I4_S)
-                        return ReadSByte();
-
-                    return ReadByte();
-                case OperandType.InlineI:
-                    return ReadInt32();
-                case OperandType.ShortInlineR:
-                    return ReadSingle();
-                case OperandType.InlineR:
-                    return ReadDouble();
-                case OperandType.InlineI8:
-                    return ReadInt64();
-                case OperandType.ShortInlineVar:
-                    return GetVariable(ReadByte());
-                case OperandType.InlineVar:
-                    return GetVariable(ReadUInt16());
-                case OperandType.ShortInlineArg:
-                    return GetParameter(ReadByte());
-                case OperandType.InlineArg:
-                    return GetParameter(ReadUInt16());
-                case OperandType.InlineSig:
-                    return GetCallSite(ReadToken());
-                case OperandType.InlineString:
-                    return GetString(ReadToken());
-                case OperandType.InlineTok:
-                case OperandType.InlineType:
-                case OperandType.InlineMethod:
-                case OperandType.InlineField:
-                    return reader.LookupToken(ReadToken());
-                default:
-                    throw new NotSupportedException();
-            }
-        }
-
-        public string GetString(MetadataToken token)
-        {
-            return reader.image.UserStringHeap.Read(token.RID);
-        }
-
-        public ParameterDefinition GetParameter(int index)
-        {
-            return Mixin.GetParameter(body, index);
-        }
-
-        public VariableDefinition GetVariable(int index)
-        {
-            return Mixin.GetVariable(body, index);
-        }
-
-        public CallSite GetCallSite(MetadataToken token)
-        {
-            return reader.ReadCallSite(token);
-        }
-
-        void ResolveBranches(Collection<Instruction> instructions)
-        {
-            var items = instructions.items;
-            var size = instructions.size;
-
-            for (int i = 0; i < size; i++)
-            {
-                var instruction = items[i];
-                switch (instruction.opcode.OperandType)
-                {
-                    case OperandType.ShortInlineBrTarget:
-                    case OperandType.InlineBrTarget:
-                        instruction.operand = GetInstruction((int)instruction.operand);
-                        break;
-                    case OperandType.InlineSwitch:
-                        var offsets = (int[])instruction.operand;
-                        var branches = new Instruction[offsets.Length];
-                        for (int j = 0; j < offsets.Length; j++)
-                            branches[j] = GetInstruction(offsets[j]);
-
-                        instruction.operand = branches;
-                        break;
-                }
-            }
-        }
-
-        Instruction GetInstruction(int offset)
-        {
-            return GetInstruction(body.Instructions, offset);
-        }
-
-        static Instruction GetInstruction(Collection<Instruction> instructions, int offset)
-        {
-            var size = instructions.size;
-            var items = instructions.items;
-            if (offset < 0 || offset > items[size - 1].offset)
-                return null;
-
-            int min = 0;
-            int max = size - 1;
-            while (min <= max)
-            {
-                int mid = min + ((max - min) / 2);
-                var instruction = items[mid];
-                var instruction_offset = instruction.offset;
-
-                if (offset == instruction_offset)
-                    return instruction;
-
-                if (offset < instruction_offset)
-                    max = mid - 1;
-                else
-                    min = mid + 1;
-            }
-
-            return null;
-        }
-
-        void ReadSection()
-        {
-            Align(4);
-
-            const byte fat_format = 0x40;
-            const byte more_sects = 0x80;
-
-            var flags = ReadByte();
-            if ((flags & fat_format) == 0)
-                ReadSmallSection();
-            else
-                ReadFatSection();
-
-            if ((flags & more_sects) != 0)
-                ReadSection();
-        }
-
-        void ReadSmallSection()
-        {
-            var count = ReadByte() / 12;
-            Advance(2);
-
-            ReadExceptionHandlers(
-                count,
-                () => (int)ReadUInt16(),
-                () => (int)ReadByte());
-        }
-
-        void ReadFatSection()
-        {
-            position--;
-            var count = (ReadInt32() >> 8) / 24;
-
-            ReadExceptionHandlers(
-                count,
-                ReadInt32,
-                ReadInt32);
-        }
-
-        // inline ?
-        void ReadExceptionHandlers(int count, Func<int> read_entry, Func<int> read_length)
-        {
-            for (int i = 0; i < count; i++)
-            {
-                var handler = new ExceptionHandler(
-                    (ExceptionHandlerType)(read_entry() & 0x7));
-
-                handler.TryStart = GetInstruction(read_entry());
-                handler.TryEnd = GetInstruction(handler.TryStart.Offset + read_length());
-
-                handler.HandlerStart = GetInstruction(read_entry());
-                handler.HandlerEnd = GetInstruction(handler.HandlerStart.Offset + read_length());
-
-                ReadExceptionHandlerSpecific(handler);
-
-                this.body.ExceptionHandlers.Add(handler);
-            }
-        }
-
-        void ReadExceptionHandlerSpecific(ExceptionHandler handler)
-        {
-            switch (handler.HandlerType)
-            {
-                case ExceptionHandlerType.Catch:
-                    handler.CatchType = (TypeReference)reader.LookupToken(ReadToken());
-                    break;
-                case ExceptionHandlerType.Filter:
-                    handler.FilterStart = GetInstruction(ReadInt32());
-                    break;
-                default:
-                    Advance(4);
-                    break;
-            }
-        }
-
-        void Align(int align)
-        {
-            align--;
-            Advance(((position + align) & ~align) - position);
-        }
-
-        public MetadataToken ReadToken()
-        {
-            return new MetadataToken(ReadUInt32());
-        }
-
-    }
-}

+ 0 - 38
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/CodeWriter.cs

@@ -1,38 +0,0 @@
-//
-// CodeWriter.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-
-using Mono.Collections.Generic;
-
-using Mono.Cecil.Metadata;
-using Mono.Cecil.PE;
-
-using RVA = System.UInt32;
-

+ 0 - 112
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/Document.cs

@@ -1,112 +0,0 @@
-//
-// Document.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil.Cil {
-
-	public enum DocumentType {
-		Other,
-		Text,
-	}
-
-	public enum DocumentHashAlgorithm {
-		None,
-		MD5,
-		SHA1,
-	}
-
-	public enum DocumentLanguage {
-		Other,
-		C,
-		Cpp,
-		CSharp,
-		Basic,
-		Java,
-		Cobol,
-		Pascal,
-		Cil,
-		JScript,
-		Smc,
-		MCpp,
-		FSharp,
-	}
-
-	public enum DocumentLanguageVendor {
-		Other,
-		Microsoft,
-	}
-
-	public sealed class Document {
-
-		string url;
-
-		byte type;
-		byte hash_algorithm;
-		byte language;
-		byte language_vendor;
-
-		byte [] hash;
-
-		public string Url {
-			get { return url; }
-			set { url = value; }
-		}
-
-		public DocumentType Type {
-			get { return (DocumentType) type; }
-			set { type = (byte) value; }
-		}
-
-		public DocumentHashAlgorithm HashAlgorithm {
-			get { return (DocumentHashAlgorithm) hash_algorithm; }
-			set { hash_algorithm = (byte) value; }
-		}
-
-		public DocumentLanguage Language {
-			get { return (DocumentLanguage) language; }
-			set { language = (byte) value; }
-		}
-
-		public DocumentLanguageVendor LanguageVendor {
-			get { return (DocumentLanguageVendor) language_vendor; }
-			set { language_vendor = (byte) value; }
-		}
-
-		public byte [] Hash {
-			get { return hash; }
-			set { hash = value; }
-		}
-
-		public Document (string url)
-		{
-			this.url = url;
-			this.hash = Empty<byte>.Array;
-		}
-	}
-}

+ 0 - 267
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/MethodBody.cs

@@ -1,267 +0,0 @@
-//
-// MethodBody.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Threading;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil.Cil
-{
-
-    public sealed class MethodBody : IVariableDefinitionProvider
-    {
-
-        readonly internal MethodDefinition method;
-
-        internal ParameterDefinition this_parameter;
-        internal int max_stack_size;
-        internal int code_size;
-        internal bool init_locals;
-        internal MetadataToken local_var_token;
-
-        internal Collection<Instruction> instructions;
-        internal Collection<ExceptionHandler> exceptions;
-        internal Collection<VariableDefinition> variables;
-        Scope scope;
-
-        public MethodDefinition Method
-        {
-            get { return method; }
-        }
-
-        public int MaxStackSize
-        {
-            get { return max_stack_size; }
-            set { max_stack_size = value; }
-        }
-
-        public int CodeSize
-        {
-            get { return code_size; }
-        }
-
-        public bool InitLocals
-        {
-            get { return init_locals; }
-            set { init_locals = value; }
-        }
-
-        public MetadataToken LocalVarToken
-        {
-            get { return local_var_token; }
-            set { local_var_token = value; }
-        }
-
-        public Collection<Instruction> Instructions
-        {
-            get { return instructions ?? (instructions = new InstructionCollection()); }
-        }
-
-        public bool HasExceptionHandlers
-        {
-            get { return !Mixin.IsNullOrEmpty(exceptions); }
-        }
-
-        public Collection<ExceptionHandler> ExceptionHandlers
-        {
-            get { return exceptions ?? (exceptions = new Collection<ExceptionHandler>()); }
-        }
-
-        public bool HasVariables
-        {
-            get { return !Mixin.IsNullOrEmpty(variables); }
-        }
-
-        public Collection<VariableDefinition> Variables
-        {
-            get { return variables ?? (variables = new VariableDefinitionCollection()); }
-        }
-
-        public Scope Scope
-        {
-            get { return scope; }
-            set { scope = value; }
-        }
-
-        public ParameterDefinition ThisParameter
-        {
-            get
-            {
-                if (method == null || method.DeclaringType == null)
-                    throw new NotSupportedException();
-
-                if (!method.HasThis)
-                    return null;
-
-                if (this_parameter == null)
-                    this_parameter = ThisParameterFor(method);
-
-                return this_parameter;
-            }
-        }
-
-        static ParameterDefinition ThisParameterFor(MethodDefinition method)
-        {
-            var declaring_type = method.DeclaringType;
-            var type = declaring_type.IsValueType || declaring_type.IsPrimitive
-                ? new PointerType(declaring_type)
-                : declaring_type as TypeReference;
-
-            return new ParameterDefinition(type, method);
-        }
-
-        public MethodBody(MethodDefinition method)
-        {
-            this.method = method;
-        }
-
-        public ILProcessor GetILProcessor()
-        {
-            return new ILProcessor(this);
-        }
-    }
-
-    public interface IVariableDefinitionProvider
-    {
-        bool HasVariables { get; }
-        Collection<VariableDefinition> Variables { get; }
-    }
-
-    class VariableDefinitionCollection : Collection<VariableDefinition>
-    {
-
-        internal VariableDefinitionCollection()
-        {
-        }
-
-        internal VariableDefinitionCollection(int capacity)
-            : base(capacity)
-        {
-        }
-
-        protected override void OnAdd(VariableDefinition item, int index)
-        {
-            item.index = index;
-        }
-
-        protected override void OnInsert(VariableDefinition item, int index)
-        {
-            item.index = index;
-
-            for (int i = index; i < size; i++)
-                items[i].index = i + 1;
-        }
-
-        protected override void OnSet(VariableDefinition item, int index)
-        {
-            item.index = index;
-        }
-
-        protected override void OnRemove(VariableDefinition item, int index)
-        {
-            item.index = -1;
-
-            for (int i = index + 1; i < size; i++)
-                items[i].index = i - 1;
-        }
-    }
-
-    class InstructionCollection : Collection<Instruction>
-    {
-
-        internal InstructionCollection()
-        {
-        }
-
-        internal InstructionCollection(int capacity)
-            : base(capacity)
-        {
-        }
-
-        protected override void OnAdd(Instruction item, int index)
-        {
-            if (index == 0)
-                return;
-
-            var previous = items[index - 1];
-            previous.next = item;
-            item.previous = previous;
-        }
-
-        protected override void OnInsert(Instruction item, int index)
-        {
-            if (size == 0)
-                return;
-
-            var current = items[index];
-            if (current == null)
-            {
-                var last = items[index - 1];
-                last.next = item;
-                item.previous = last;
-                return;
-            }
-
-            var previous = current.previous;
-            if (previous != null)
-            {
-                previous.next = item;
-                item.previous = previous;
-            }
-
-            current.previous = item;
-            item.next = current;
-        }
-
-        protected override void OnSet(Instruction item, int index)
-        {
-            var current = items[index];
-
-            item.previous = current.previous;
-            item.next = current.next;
-
-            current.previous = null;
-            current.next = null;
-        }
-
-        protected override void OnRemove(Instruction item, int index)
-        {
-            var previous = item.previous;
-            if (previous != null)
-                previous.next = item.next;
-
-            var next = item.next;
-            if (next != null)
-                next.previous = item.previous;
-
-            item.previous = null;
-            item.next = null;
-        }
-    }
-}

+ 0 - 70
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/SequencePoint.cs

@@ -1,70 +0,0 @@
-//
-// SequencePoint.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil.Cil {
-
-	public sealed class SequencePoint {
-
-		Document document;
-
-		int start_line;
-		int start_column;
-		int end_line;
-		int end_column;
-
-		public int StartLine {
-			get { return start_line; }
-			set { start_line = value; }
-		}
-
-		public int StartColumn {
-			get { return start_column; }
-			set { start_column = value; }
-		}
-
-		public int EndLine {
-			get { return end_line; }
-			set { end_line = value; }
-		}
-
-		public int EndColumn {
-			get { return end_column; }
-			set { end_column = value; }
-		}
-
-		public Document Document {
-			get { return document; }
-			set { document = value; }
-		}
-
-		public SequencePoint (Document document)
-		{
-			this.document = document;
-		}
-	}
-}

+ 0 - 243
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/Symbols.cs

@@ -1,243 +0,0 @@
-//
-// Symbols.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-using SR = System.Reflection;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil.Cil {
-
-	[StructLayout (LayoutKind.Sequential)]
-	public struct ImageDebugDirectory {
-		public int Characteristics;
-		public int TimeDateStamp;
-		public short MajorVersion;
-		public short MinorVersion;
-		public int Type;
-		public int SizeOfData;
-		public int AddressOfRawData;
-		public int PointerToRawData;
-	}
-
-	public sealed class Scope : IVariableDefinitionProvider {
-
-		Instruction start;
-		Instruction end;
-
-		Collection<Scope> scopes;
-		Collection<VariableDefinition> variables;
-
-		public Instruction Start {
-			get { return start; }
-			set { start = value; }
-		}
-
-		public Instruction End {
-			get { return end; }
-			set { end = value; }
-		}
-
-		public bool HasScopes {
-			get { return !Mixin.IsNullOrEmpty (scopes); }
-		}
-
-		public Collection<Scope> Scopes {
-			get {
-				if (scopes == null)
-					scopes = new Collection<Scope> ();
-
-				return scopes;
-			}
-		}
-
-		public bool HasVariables {
-			get { return !Mixin.IsNullOrEmpty (variables); }
-		}
-
-		public Collection<VariableDefinition> Variables {
-			get {
-				if (variables == null)
-					variables = new Collection<VariableDefinition> ();
-
-				return variables;
-			}
-		}
-	}
-
-	public struct InstructionSymbol {
-
-		public readonly int Offset;
-		public readonly SequencePoint SequencePoint;
-
-		public InstructionSymbol (int offset, SequencePoint sequencePoint)
-		{
-			this.Offset = offset;
-			this.SequencePoint = sequencePoint;
-		}
-	}
-
-	public sealed class MethodSymbols {
-
-		internal int code_size;
-		internal string method_name;
-		internal MetadataToken method_token;
-		internal MetadataToken local_var_token;
-		internal Collection<VariableDefinition> variables;
-		public Collection<InstructionSymbol> instructions;
-
-		public bool HasVariables {
-			get { return !Mixin.IsNullOrEmpty (variables); }
-		}
-
-		public Collection<VariableDefinition> Variables {
-			get {
-				if (variables == null)
-					variables = new Collection<VariableDefinition> ();
-
-				return variables;
-			}
-		}
-
-		public Collection<InstructionSymbol> Instructions {
-			get {
-				if (instructions == null)
-					instructions = new Collection<InstructionSymbol> ();
-
-				return instructions;
-			}
-		}
-
-		public int CodeSize {
-			get { return code_size; }
-		}
-
-		public string MethodName {
-			get { return method_name; }
-		}
-
-		public MetadataToken MethodToken {
-			get { return method_token; }
-		}
-
-		public MetadataToken LocalVarToken {
-			get { return local_var_token; }
-		}
-
-		internal MethodSymbols (string methodName)
-		{
-			this.method_name = methodName;
-		}
-
-		public MethodSymbols (MetadataToken methodToken)
-		{
-			this.method_token = methodToken;
-		}
-	}
-
-	public delegate Instruction InstructionMapper (int offset);
-
-	public interface ISymbolReader : IDisposable {
-
-		bool ProcessDebugHeader (ImageDebugDirectory directory, byte [] header);
-		void Read (MethodBody body, InstructionMapper mapper);
-		void Read (MethodSymbols symbols);
-	}
-
-	public interface ISymbolReaderProvider {
-
-		ISymbolReader GetSymbolReader (ModuleDefinition module, string fileName);
-		ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream);
-	}
-
-	static class SymbolProvider {
-
-		static readonly string symbol_kind = Type.GetType ("Mono.Runtime") != null ? "Mdb" : "Pdb";
-
-		static SR.AssemblyName GetPlatformSymbolAssemblyName ()
-		{
-			var cecil_name = typeof (SymbolProvider).Assembly.GetName ();
-
-			var name = new SR.AssemblyName {
-				Name = "Mono.Cecil." + symbol_kind,
-				Version = cecil_name.Version,
-			};
-
-			name.SetPublicKeyToken (cecil_name.GetPublicKeyToken ());
-
-			return name;
-		}
-
-		static Type GetPlatformType (string fullname)
-		{
-			var type = Type.GetType (fullname);
-			if (type != null)
-				return type;
-
-			var assembly_name = GetPlatformSymbolAssemblyName ();
-
-			type = Type.GetType (fullname + ", " + assembly_name.FullName);
-			if (type != null)
-				return type;
-
-			try {
-				var assembly = SR.Assembly.Load (assembly_name);
-				if (assembly != null)
-					return assembly.GetType (fullname);
-			} catch (FileNotFoundException) {
-
-			}
-
-			return null;
-		}
-
-		static ISymbolReaderProvider reader_provider;
-
-		public static ISymbolReaderProvider GetPlatformReaderProvider ()
-		{
-			if (reader_provider != null)
-				return reader_provider;
-
-			var type = GetPlatformType (GetProviderTypeName ("ReaderProvider"));
-			if (type == null)
-				return null;
-
-			return reader_provider = (ISymbolReaderProvider) Activator.CreateInstance (type);
-		}
-
-		static string GetProviderTypeName (string name)
-		{
-			return "Mono.Cecil." + symbol_kind + "." + symbol_kind + name;
-		}
-
-
-	}
-
-}

+ 0 - 52
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/VariableDefinition.cs

@@ -1,52 +0,0 @@
-//
-// VariableDefinition.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil.Cil {
-
-	public sealed class VariableDefinition : VariableReference {
-
-		public bool IsPinned {
-			get { return variable_type.IsPinned; }
-		}
-
-		public VariableDefinition (TypeReference variableType)
-			: base (variableType)
-		{
-		}
-
-		public VariableDefinition (string name, TypeReference variableType)
-			: base (name, variableType)
-		{
-		}
-
-		public override VariableDefinition Resolve ()
-		{
-			return this;
-		}
-	}
-}

+ 0 - 75
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Cil/VariableReference.cs

@@ -1,75 +0,0 @@
-//
-// VariableReference.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil.Cil {
-
-	public abstract class VariableReference {
-
-		string name;
-		internal int index = -1;
-		protected TypeReference variable_type;
-
-		public string Name {
-			get { return name; }
-			set { name = value; }
-		}
-
-		public TypeReference VariableType {
-			get { return variable_type; }
-			set { variable_type = value; }
-		}
-
-		public int Index {
-			get { return index; }
-		}
-
-		internal VariableReference (TypeReference variable_type)
-			: this (string.Empty, variable_type)
-		{
-		}
-
-		internal VariableReference (string name, TypeReference variable_type)
-		{
-			this.name = name;
-			this.variable_type = variable_type;
-		}
-
-		public abstract VariableDefinition Resolve ();
-
-		public override string ToString ()
-		{
-			if (!string.IsNullOrEmpty (name))
-				return name;
-
-			if (index >= 0)
-				return "V_" + index;
-
-			return string.Empty;
-		}
-	}
-}

+ 0 - 61
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/BlobHeap.cs

@@ -1,61 +0,0 @@
-//
-// BlobHeap.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Cecil.PE;
-
-namespace Mono.Cecil.Metadata
-{
-
-    sealed class BlobHeap : Heap
-    {
-
-        public BlobHeap(Section section, uint start, uint size)
-            : base(section, start, size)
-        {
-        }
-
-        public byte[] Read(uint index)
-        {
-            if (index == 0 || index > Size - 1)
-                return Empty<byte>.Array;
-
-            var data = Section.Data;
-
-            int position = (int)(index + Offset);
-            int length = (int)Mixin.ReadCompressedUInt32(data, ref position);
-
-            var buffer = new byte[length];
-
-            Buffer.BlockCopy(data, position, buffer, 0, length);
-
-            return buffer;
-        }
-    }
-}

+ 0 - 36
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/Buffers.cs

@@ -1,36 +0,0 @@
-//
-// TableHeapBuffer.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-using Mono.Cecil.PE;
-
-using RVA = System.UInt32;
-

+ 0 - 46
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/CodedIndex.cs

@@ -1,46 +0,0 @@
-//
-// CodedIndex.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil.Metadata {
-
-	enum CodedIndex {
-		TypeDefOrRef,
-		HasConstant,
-		HasCustomAttribute,
-		HasFieldMarshal,
-		HasDeclSecurity,
-		MemberRefParent,
-		HasSemantics,
-		MethodDefOrRef,
-		MemberForwarded,
-		Implementation,
-		CustomAttributeType,
-		ResolutionScope,
-		TypeOrMethodDef
-	}
-}

+ 0 - 59
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/GuidHeap.cs

@@ -1,59 +0,0 @@
-//
-// GuidHeap.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Cecil.PE;
-
-namespace Mono.Cecil.Metadata {
-
-	sealed class GuidHeap : Heap {
-
-		public GuidHeap (Section section, uint start, uint size)
-			: base (section, start, size)
-		{
-		}
-
-		public Guid Read (uint index)
-		{
-			if (index == 0)
-				return new Guid ();
-
-			const int guid_size = 16;
-
-			var buffer = new byte [guid_size];
-
-			index--;
-
-			Buffer.BlockCopy (Section.Data, (int) (Offset + index), buffer, 0, guid_size);
-
-			return new Guid (buffer);
-
-		}
-	}
-}

+ 0 - 48
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/Heap.cs

@@ -1,48 +0,0 @@
-//
-// Heap.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using Mono.Cecil.PE;
-
-namespace Mono.Cecil.Metadata {
-
-	abstract class Heap {
-
-		public int IndexSize;
-
-		public readonly Section Section;
-		public readonly uint Offset;
-		public readonly uint Size;
-
-		protected Heap (Section section, uint offset, uint size)
-		{
-			this.Section = section;
-			this.Offset = offset;
-			this.Size = size;
-		}
-	}
-}

+ 0 - 81
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/StringHeap.cs

@@ -1,81 +0,0 @@
-//
-// StringHeap.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-using Mono.Cecil.PE;
-
-namespace Mono.Cecil.Metadata {
-
-	class StringHeap : Heap {
-
-		readonly Dictionary<uint, string> strings = new Dictionary<uint, string> ();
-
-		public StringHeap (Section section, uint start, uint size)
-			: base (section, start, size)
-		{
-		}
-
-		public string Read (uint index)
-		{
-			if (index == 0)
-				return string.Empty;
-
-			string @string;
-			if (strings.TryGetValue (index, out @string))
-				return @string;
-
-			if (index > Size - 1)
-				return string.Empty;
-
-			@string = ReadStringAt (index);
-			if (@string.Length != 0)
-				strings.Add (index, @string);
-
-			return @string;
-		}
-
-		protected virtual string ReadStringAt (uint index)
-		{
-			int length = 0;
-			byte [] data = Section.Data;
-			int start = (int) (index + Offset);
-
-			for (int i = start; ; i++) {
-				if (data [i] == 0)
-					break;
-
-				length++;
-			}
-
-			return Encoding.UTF8.GetString (data, start, length);
-		}
-	}
-}

+ 0 - 56
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/TokenType.cs

@@ -1,56 +0,0 @@
-//
-// TokenType.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-	public enum TokenType : uint {
-		Module = 0x00000000,
-		TypeRef = 0x01000000,
-		TypeDef = 0x02000000,
-		Field = 0x04000000,
-		Method = 0x06000000,
-		Param = 0x08000000,
-		InterfaceImpl = 0x09000000,
-		MemberRef = 0x0a000000,
-		CustomAttribute = 0x0c000000,
-		Permission = 0x0e000000,
-		Signature = 0x11000000,
-		Event = 0x14000000,
-		Property = 0x17000000,
-		ModuleRef = 0x1a000000,
-		TypeSpec = 0x1b000000,
-		Assembly = 0x20000000,
-		AssemblyRef = 0x23000000,
-		File = 0x26000000,
-		ExportedType = 0x27000000,
-		ManifestResource = 0x28000000,
-		GenericParam = 0x2a000000,
-		MethodSpec = 0x2b000000,
-		String = 0x70000000,
-	}
-}

+ 0 - 61
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/UserStringHeap.cs

@@ -1,61 +0,0 @@
-//
-// UserStringHeap.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Cecil.PE;
-
-namespace Mono.Cecil.Metadata
-{
-
-    sealed class UserStringHeap : StringHeap
-    {
-
-        public UserStringHeap(Section section, uint start, uint size)
-            : base(section, start, size)
-        {
-        }
-
-        protected override string ReadStringAt(uint index)
-        {
-            byte[] data = Section.Data;
-            int start = (int)(index + Offset);
-
-            uint length = (uint)(Mixin.ReadCompressedUInt32(data, ref start) & ~1);
-            if (length < 1)
-                return string.Empty;
-
-            var chars = new char[length / 2];
-
-            for (int i = start, j = 0; i < start + length; i += 2)
-                chars[j++] = (char)(data[i] | (data[i + 1] << 8));
-
-            return new string(chars);
-        }
-    }
-}

+ 0 - 354
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.Metadata/Utilities.cs

@@ -1,354 +0,0 @@
-//
-// Utilities.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Cecil.Metadata;
-
-namespace Mono.Cecil
-{
-
-    static partial class Mixin
-    {
-
-        public static uint ReadCompressedUInt32(byte[] data, ref int position)
-        {
-            uint integer;
-            if ((data[position] & 0x80) == 0)
-            {
-                integer = data[position];
-                position++;
-            }
-            else if ((data[position] & 0x40) == 0)
-            {
-                integer = (uint)(data[position] & ~0x80) << 8;
-                integer |= data[position + 1];
-                position += 2;
-            }
-            else
-            {
-                integer = (uint)(data[position] & ~0xc0) << 24;
-                integer |= (uint)data[position + 1] << 16;
-                integer |= (uint)data[position + 2] << 8;
-                integer |= (uint)data[position + 3];
-                position += 4;
-            }
-            return integer;
-        }
-
-        public static MetadataToken GetMetadataToken(CodedIndex self, uint data)
-        {
-            uint rid;
-            TokenType token_type;
-            switch (self)
-            {
-                case CodedIndex.TypeDefOrRef:
-                    rid = data >> 2;
-                    switch (data & 3)
-                    {
-                        case 0:
-                            token_type = TokenType.TypeDef; goto ret;
-                        case 1:
-                            token_type = TokenType.TypeRef; goto ret;
-                        case 2:
-                            token_type = TokenType.TypeSpec; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.HasConstant:
-                    rid = data >> 2;
-                    switch (data & 3)
-                    {
-                        case 0:
-                            token_type = TokenType.Field; goto ret;
-                        case 1:
-                            token_type = TokenType.Param; goto ret;
-                        case 2:
-                            token_type = TokenType.Property; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.HasCustomAttribute:
-                    rid = data >> 5;
-                    switch (data & 31)
-                    {
-                        case 0:
-                            token_type = TokenType.Method; goto ret;
-                        case 1:
-                            token_type = TokenType.Field; goto ret;
-                        case 2:
-                            token_type = TokenType.TypeRef; goto ret;
-                        case 3:
-                            token_type = TokenType.TypeDef; goto ret;
-                        case 4:
-                            token_type = TokenType.Param; goto ret;
-                        case 5:
-                            token_type = TokenType.InterfaceImpl; goto ret;
-                        case 6:
-                            token_type = TokenType.MemberRef; goto ret;
-                        case 7:
-                            token_type = TokenType.Module; goto ret;
-                        case 8:
-                            token_type = TokenType.Permission; goto ret;
-                        case 9:
-                            token_type = TokenType.Property; goto ret;
-                        case 10:
-                            token_type = TokenType.Event; goto ret;
-                        case 11:
-                            token_type = TokenType.Signature; goto ret;
-                        case 12:
-                            token_type = TokenType.ModuleRef; goto ret;
-                        case 13:
-                            token_type = TokenType.TypeSpec; goto ret;
-                        case 14:
-                            token_type = TokenType.Assembly; goto ret;
-                        case 15:
-                            token_type = TokenType.AssemblyRef; goto ret;
-                        case 16:
-                            token_type = TokenType.File; goto ret;
-                        case 17:
-                            token_type = TokenType.ExportedType; goto ret;
-                        case 18:
-                            token_type = TokenType.ManifestResource; goto ret;
-                        case 19:
-                            token_type = TokenType.GenericParam; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.HasFieldMarshal:
-                    rid = data >> 1;
-                    switch (data & 1)
-                    {
-                        case 0:
-                            token_type = TokenType.Field; goto ret;
-                        case 1:
-                            token_type = TokenType.Param; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.HasDeclSecurity:
-                    rid = data >> 2;
-                    switch (data & 3)
-                    {
-                        case 0:
-                            token_type = TokenType.TypeDef; goto ret;
-                        case 1:
-                            token_type = TokenType.Method; goto ret;
-                        case 2:
-                            token_type = TokenType.Assembly; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.MemberRefParent:
-                    rid = data >> 3;
-                    switch (data & 7)
-                    {
-                        case 0:
-                            token_type = TokenType.TypeDef; goto ret;
-                        case 1:
-                            token_type = TokenType.TypeRef; goto ret;
-                        case 2:
-                            token_type = TokenType.ModuleRef; goto ret;
-                        case 3:
-                            token_type = TokenType.Method; goto ret;
-                        case 4:
-                            token_type = TokenType.TypeSpec; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.HasSemantics:
-                    rid = data >> 1;
-                    switch (data & 1)
-                    {
-                        case 0:
-                            token_type = TokenType.Event; goto ret;
-                        case 1:
-                            token_type = TokenType.Property; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.MethodDefOrRef:
-                    rid = data >> 1;
-                    switch (data & 1)
-                    {
-                        case 0:
-                            token_type = TokenType.Method; goto ret;
-                        case 1:
-                            token_type = TokenType.MemberRef; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.MemberForwarded:
-                    rid = data >> 1;
-                    switch (data & 1)
-                    {
-                        case 0:
-                            token_type = TokenType.Field; goto ret;
-                        case 1:
-                            token_type = TokenType.Method; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.Implementation:
-                    rid = data >> 2;
-                    switch (data & 3)
-                    {
-                        case 0:
-                            token_type = TokenType.File; goto ret;
-                        case 1:
-                            token_type = TokenType.AssemblyRef; goto ret;
-                        case 2:
-                            token_type = TokenType.ExportedType; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.CustomAttributeType:
-                    rid = data >> 3;
-                    switch (data & 7)
-                    {
-                        case 2:
-                            token_type = TokenType.Method; goto ret;
-                        case 3:
-                            token_type = TokenType.MemberRef; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.ResolutionScope:
-                    rid = data >> 2;
-                    switch (data & 3)
-                    {
-                        case 0:
-                            token_type = TokenType.Module; goto ret;
-                        case 1:
-                            token_type = TokenType.ModuleRef; goto ret;
-                        case 2:
-                            token_type = TokenType.AssemblyRef; goto ret;
-                        case 3:
-                            token_type = TokenType.TypeRef; goto ret;
-                        default:
-                            goto exit;
-                    }
-                case CodedIndex.TypeOrMethodDef:
-                    rid = data >> 1;
-                    switch (data & 1)
-                    {
-                        case 0:
-                            token_type = TokenType.TypeDef; goto ret;
-                        case 1:
-                            token_type = TokenType.Method; goto ret;
-                        default: goto exit;
-                    }
-                default:
-                    goto exit;
-            }
-        ret:
-            return new MetadataToken(token_type, rid);
-        exit:
-            return MetadataToken.Zero;
-        }
-
-
-        public static int GetSize(CodedIndex self, Func<Table, int> counter)
-        {
-            int bits;
-            Table[] tables;
-
-            switch (self)
-            {
-                case CodedIndex.TypeDefOrRef:
-                    bits = 2;
-                    tables = new[] { Table.TypeDef, Table.TypeRef, Table.TypeSpec };
-                    break;
-                case CodedIndex.HasConstant:
-                    bits = 2;
-                    tables = new[] { Table.Field, Table.Param, Table.Property };
-                    break;
-                case CodedIndex.HasCustomAttribute:
-                    bits = 5;
-                    tables = new[] {
-					Table.Method, Table.Field, Table.TypeRef, Table.TypeDef, Table.Param, Table.InterfaceImpl, Table.MemberRef,
-					Table.Module, Table.DeclSecurity, Table.Property, Table.Event, Table.StandAloneSig, Table.ModuleRef,
-					Table.TypeSpec, Table.Assembly, Table.AssemblyRef, Table.File, Table.ExportedType,
-					Table.ManifestResource, Table.GenericParam
-				};
-                    break;
-                case CodedIndex.HasFieldMarshal:
-                    bits = 1;
-                    tables = new[] { Table.Field, Table.Param };
-                    break;
-                case CodedIndex.HasDeclSecurity:
-                    bits = 2;
-                    tables = new[] { Table.TypeDef, Table.Method, Table.Assembly };
-                    break;
-                case CodedIndex.MemberRefParent:
-                    bits = 3;
-                    tables = new[] { Table.TypeDef, Table.TypeRef, Table.ModuleRef, Table.Method, Table.TypeSpec };
-                    break;
-                case CodedIndex.HasSemantics:
-                    bits = 1;
-                    tables = new[] { Table.Event, Table.Property };
-                    break;
-                case CodedIndex.MethodDefOrRef:
-                    bits = 1;
-                    tables = new[] { Table.Method, Table.MemberRef };
-                    break;
-                case CodedIndex.MemberForwarded:
-                    bits = 1;
-                    tables = new[] { Table.Field, Table.Method };
-                    break;
-                case CodedIndex.Implementation:
-                    bits = 2;
-                    tables = new[] { Table.File, Table.AssemblyRef, Table.ExportedType };
-                    break;
-                case CodedIndex.CustomAttributeType:
-                    bits = 3;
-                    tables = new[] { Table.Method, Table.MemberRef };
-                    break;
-                case CodedIndex.ResolutionScope:
-                    bits = 2;
-                    tables = new[] { Table.Module, Table.ModuleRef, Table.AssemblyRef, Table.TypeRef };
-                    break;
-                case CodedIndex.TypeOrMethodDef:
-                    bits = 1;
-                    tables = new[] { Table.TypeDef, Table.Method };
-                    break;
-                default:
-                    throw new ArgumentException();
-            }
-
-            int max = 0;
-
-            for (int i = 0; i < tables.Length; i++)
-            {
-                max = System.Math.Max(counter(tables[i]), max);
-            }
-
-            return max < (1 << (16 - bits)) ? 2 : 4;
-        }
-    }
-}

+ 0 - 51
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/BinaryStreamReader.cs

@@ -1,51 +0,0 @@
-//
-// BinaryStreamReader.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-namespace Mono.Cecil.PE {
-
-	class BinaryStreamReader : BinaryReader {
-
-		public BinaryStreamReader (Stream stream)
-			: base (stream)
-		{
-		}
-
-		protected void Advance (int bytes)
-		{
-			BaseStream.Seek (bytes, SeekOrigin.Current);
-		}
-
-		protected DataDirectory ReadDataDirectory ()
-		{
-			return new DataDirectory (ReadUInt32 (), ReadUInt32 ());
-		}
-	}
-}

+ 0 - 31
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/BinaryStreamWriter.cs

@@ -1,31 +0,0 @@
-//
-// BinaryStreamWriter.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-

+ 0 - 184
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/ByteBuffer.cs

@@ -1,184 +0,0 @@
-//
-// ByteBuffer.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil.PE {
-
-	class ByteBuffer {
-
-		internal byte [] buffer;
-		internal int length;
-		internal int position;
-
-		public ByteBuffer ()
-		{
-			this.buffer = Empty<byte>.Array;
-		}
-
-		public ByteBuffer (int length)
-		{
-			this.buffer = new byte [length];
-		}
-
-		public ByteBuffer (byte [] buffer)
-		{
-			this.buffer = buffer ?? Empty<byte>.Array;
-			this.length = this.buffer.Length;
-		}
-
-		public void Reset (byte [] buffer)
-		{
-			this.buffer = buffer ?? Empty<byte>.Array;
-			this.length = this.buffer.Length;
-		}
-
-		public void Advance (int length)
-		{
-			position += length;
-		}
-
-		public byte ReadByte ()
-		{
-			return buffer [position++];
-		}
-
-		public sbyte ReadSByte ()
-		{
-			return (sbyte) ReadByte ();
-		}
-
-		public byte [] ReadBytes (int length)
-		{
-			var bytes = new byte [length];
-			Buffer.BlockCopy (buffer, position, bytes, 0, length);
-			position += length;
-			return bytes;
-		}
-
-		public ushort ReadUInt16 ()
-		{
-			ushort value = (ushort) (buffer [position]
-				| (buffer [position + 1] << 8));
-			position += 2;
-			return value;
-		}
-
-		public short ReadInt16 ()
-		{
-			return (short) ReadUInt16 ();
-		}
-
-		public uint ReadUInt32 ()
-		{
-			uint value = (uint) (buffer [position]
-				| (buffer [position + 1] << 8)
-				| (buffer [position + 2] << 16)
-				| (buffer [position + 3] << 24));
-			position += 4;
-			return value;
-		}
-
-		public int ReadInt32 ()
-		{
-			return (int) ReadUInt32 ();
-		}
-
-		public ulong ReadUInt64 ()
-		{
-			uint low = ReadUInt32 ();
-			uint high = ReadUInt32 ();
-
-			return (((ulong) high) << 32) | low;
-		}
-
-		public long ReadInt64 ()
-		{
-			return (long) ReadUInt64 ();
-		}
-
-		public uint ReadCompressedUInt32 ()
-		{
-			byte first = ReadByte ();
-			if ((first & 0x80) == 0)
-				return first;
-
-			if ((first & 0x40) == 0)
-				return ((uint) (first & ~0x80) << 8)
-					| ReadByte ();
-
-			return ((uint) (first & ~0xc0) << 24)
-				| (uint) ReadByte () << 16
-				| (uint) ReadByte () << 8
-				| ReadByte ();
-		}
-
-		public int ReadCompressedInt32 ()
-		{
-			var value = (int) (ReadCompressedUInt32 () >> 1);
-			if ((value & 1) == 0)
-				return value;
-			if (value < 0x40)
-				return value - 0x40;
-			if (value < 0x2000)
-				return value - 0x2000;
-			if (value < 0x10000000)
-				return value - 0x10000000;
-			return value - 0x20000000;
-		}
-
-		public float ReadSingle ()
-		{
-			if (!BitConverter.IsLittleEndian) {
-				var bytes = ReadBytes (4);
-				Array.Reverse (bytes);
-				return BitConverter.ToSingle (bytes, 0);
-			}
-
-			float value = BitConverter.ToSingle (buffer, position);
-			position += 4;
-			return value;
-		}
-
-		public double ReadDouble ()
-		{
-			if (!BitConverter.IsLittleEndian) {
-				var bytes = ReadBytes (8);
-				Array.Reverse (bytes);
-				return BitConverter.ToDouble (bytes, 0);
-			}
-
-			double value = BitConverter.ToDouble (buffer, position);
-			position += 8;
-			return value;
-		}
-
-
-
-	}
-}

+ 0 - 78
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/ByteBufferEqualityComparer.cs

@@ -1,78 +0,0 @@
-//
-// ByteBufferEqualityComparer.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-
-namespace Mono.Cecil.PE {
-
-	sealed class ByteBufferEqualityComparer : IEqualityComparer<ByteBuffer> {
-
-		public bool Equals (ByteBuffer x, ByteBuffer y)
-		{
-			if (x.length != y.length)
-				return false;
-
-			var x_buffer = x.buffer;
-			var y_buffer = y.buffer;
-
-			for (int i = 0; i < x.length; i++)
-				if (x_buffer [i] != y_buffer [i])
-					return false;
-
-			return true;
-		}
-
-		public int GetHashCode (ByteBuffer buffer)
-		{
-#if !BYTE_BUFFER_WELL_DISTRIBUTED_HASH
-			var hash = 0;
-			var bytes = buffer.buffer;
-			for (int i = 0; i < buffer.length; i++)
-				hash = (hash * 37) ^ bytes [i];
-
-			return hash;
-#else
-			const uint p = 16777619;
-			uint hash = 2166136261;
-
-			var bytes = buffer.buffer;
-			for (int i = 0; i < buffer.length; i++)
-			    hash = (hash ^ bytes [i]) * p;
-
-			hash += hash << 13;
-			hash ^= hash >> 7;
-			hash += hash << 3;
-			hash ^= hash >> 17;
-			hash += hash << 5;
-
-			return (int) hash;
-#endif
-		}
-	}
-}

+ 0 - 50
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/DataDirectory.cs

@@ -1,50 +0,0 @@
-//
-// DataDirectory.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using RVA = System.UInt32;
-
-namespace Mono.Cecil.PE {
-
-	struct DataDirectory {
-
-		public readonly RVA VirtualAddress;
-		public readonly uint Size;
-
-		public bool IsZero {
-			get { return VirtualAddress == 0 && Size == 0; }
-		}
-
-		public DataDirectory (RVA rva, uint size)
-		{
-			this.VirtualAddress = rva;
-			this.Size = size;
-		}
-	}
-}

+ 0 - 166
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/Image.cs

@@ -1,166 +0,0 @@
-//
-// Image.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono;
-using Mono.Cecil.Cil;
-using Mono.Cecil.Metadata;
-
-using RVA = System.UInt32;
-
-namespace Mono.Cecil.PE
-{
-
-    sealed class Image
-    {
-
-        public ModuleKind Kind;
-        public TargetRuntime Runtime;
-        public TargetArchitecture Architecture;
-        public ModuleCharacteristics Characteristics;
-        public string FileName;
-
-        public Section[] Sections;
-
-        public Section MetadataSection;
-
-        public uint EntryPointToken;
-        public ModuleAttributes Attributes;
-
-        public DataDirectory Debug;
-        public DataDirectory Resources;
-        public DataDirectory StrongName;
-
-        public StringHeap StringHeap;
-        public BlobHeap BlobHeap;
-        public UserStringHeap UserStringHeap;
-        public GuidHeap GuidHeap;
-        public TableHeap TableHeap;
-
-        readonly int[] coded_index_sizes = new int[13];
-
-        readonly Func<Table, int> counter;
-
-        public Image()
-        {
-            counter = GetTableLength;
-        }
-
-        public bool HasTable(Table table)
-        {
-            return GetTableLength(table) > 0;
-        }
-
-        public int GetTableLength(Table table)
-        {
-            return (int)TableHeap[table].Length;
-        }
-
-        public int GetTableIndexSize(Table table)
-        {
-            return GetTableLength(table) < 65536 ? 2 : 4;
-        }
-
-        public int GetCodedIndexSize(CodedIndex coded_index)
-        {
-            var index = (int)coded_index;
-            var size = coded_index_sizes[index];
-            if (size != 0)
-                return size;
-
-            return coded_index_sizes[index] = Mixin.GetSize(coded_index, counter);
-        }
-
-        public uint ResolveVirtualAddress(RVA rva)
-        {
-            var section = GetSectionAtVirtualAddress(rva);
-            if (section == null)
-                throw new ArgumentOutOfRangeException();
-
-            return ResolveVirtualAddressInSection(rva, section);
-        }
-
-        public uint ResolveVirtualAddressInSection(RVA rva, Section section)
-        {
-            return rva + section.PointerToRawData - section.VirtualAddress;
-        }
-
-        public Section GetSection(string name)
-        {
-            var sections = this.Sections;
-            for (int i = 0; i < sections.Length; i++)
-            {
-                var section = sections[i];
-                if (section.Name == name)
-                    return section;
-            }
-
-            return null;
-        }
-
-        public Section GetSectionAtVirtualAddress(RVA rva)
-        {
-            var sections = this.Sections;
-            for (int i = 0; i < sections.Length; i++)
-            {
-                var section = sections[i];
-                if (rva >= section.VirtualAddress && rva < section.VirtualAddress + section.SizeOfRawData)
-                    return section;
-            }
-
-            return null;
-        }
-
-        public ImageDebugDirectory GetDebugHeader(out byte[] header)
-        {
-            var section = GetSectionAtVirtualAddress(Debug.VirtualAddress);
-            var buffer = new ByteBuffer(section.Data);
-            buffer.position = (int)(Debug.VirtualAddress - section.VirtualAddress);
-
-            var directory = new ImageDebugDirectory
-            {
-                Characteristics = buffer.ReadInt32(),
-                TimeDateStamp = buffer.ReadInt32(),
-                MajorVersion = buffer.ReadInt16(),
-                MinorVersion = buffer.ReadInt16(),
-                Type = buffer.ReadInt32(),
-                SizeOfData = buffer.ReadInt32(),
-                AddressOfRawData = buffer.ReadInt32(),
-                PointerToRawData = buffer.ReadInt32(),
-            };
-
-            buffer.position = (int)(directory.PointerToRawData - section.PointerToRawData);
-
-            header = new byte[directory.SizeOfData];
-            Buffer.BlockCopy(buffer.buffer, buffer.position, header, 0, header.Length);
-
-            return directory;
-        }
-    }
-}

+ 0 - 694
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/ImageReader.cs

@@ -1,694 +0,0 @@
-//
-// ImageReader.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using Mono.Cecil.Metadata;
-
-using RVA = System.UInt32;
-
-namespace Mono.Cecil.PE
-{
-
-    sealed class ImageReader : BinaryStreamReader
-    {
-
-        readonly Image image;
-
-        DataDirectory cli;
-        DataDirectory metadata;
-
-        public ImageReader(Stream stream)
-            : base(stream)
-        {
-            image = new Image();
-
-            image.FileName = Mixin.GetFullyQualifiedName(stream);
-        }
-
-        void MoveTo(DataDirectory directory)
-        {
-            BaseStream.Position = image.ResolveVirtualAddress(directory.VirtualAddress);
-        }
-
-        void MoveTo(uint position)
-        {
-            BaseStream.Position = position;
-        }
-
-        void ReadImage()
-        {
-            if (BaseStream.Length < 128)
-                throw new BadImageFormatException();
-
-            // - DOSHeader
-
-            // PE					2
-            // Start				58
-            // Lfanew				4
-            // End					64
-
-            if (ReadUInt16() != 0x5a4d)
-                throw new BadImageFormatException();
-
-            Advance(58);
-
-            MoveTo(ReadUInt32());
-
-            if (ReadUInt32() != 0x00004550)
-                throw new BadImageFormatException();
-
-            // - PEFileHeader
-
-            // Machine				2
-            image.Architecture = ReadArchitecture();
-
-            // NumberOfSections		2
-            ushort sections = ReadUInt16();
-
-            // TimeDateStamp		4
-            // PointerToSymbolTable	4
-            // NumberOfSymbols		4
-            // OptionalHeaderSize	2
-            Advance(14);
-
-            // Characteristics		2
-            ushort characteristics = ReadUInt16();
-
-            ushort subsystem, dll_characteristics;
-            ReadOptionalHeaders(out subsystem, out dll_characteristics);
-            ReadSections(sections);
-            ReadCLIHeader();
-            ReadMetadata();
-
-            image.Kind = GetModuleKind(characteristics, subsystem);
-            image.Characteristics = (ModuleCharacteristics)dll_characteristics;
-        }
-
-        TargetArchitecture ReadArchitecture()
-        {
-            var machine = ReadUInt16();
-            switch (machine)
-            {
-                case 0x014c:
-                    return TargetArchitecture.I386;
-                case 0x8664:
-                    return TargetArchitecture.AMD64;
-                case 0x0200:
-                    return TargetArchitecture.IA64;
-                case 0x01c4:
-                    return TargetArchitecture.ARMv7;
-            }
-
-            throw new NotSupportedException();
-        }
-
-        static ModuleKind GetModuleKind(ushort characteristics, ushort subsystem)
-        {
-            if ((characteristics & 0x2000) != 0) // ImageCharacteristics.Dll
-                return ModuleKind.Dll;
-
-            if (subsystem == 0x2 || subsystem == 0x9) // SubSystem.WindowsGui || SubSystem.WindowsCeGui
-                return ModuleKind.Windows;
-
-            return ModuleKind.Console;
-        }
-
-        void ReadOptionalHeaders(out ushort subsystem, out ushort dll_characteristics)
-        {
-            // - PEOptionalHeader
-            //   - StandardFieldsHeader
-
-            // Magic				2
-            bool pe64 = ReadUInt16() == 0x20b;
-
-            //						pe32 || pe64
-
-            // LMajor				1
-            // LMinor				1
-            // CodeSize				4
-            // InitializedDataSize	4
-            // UninitializedDataSize4
-            // EntryPointRVA		4
-            // BaseOfCode			4
-            // BaseOfData			4 || 0
-
-            //   - NTSpecificFieldsHeader
-
-            // ImageBase			4 || 8
-            // SectionAlignment		4
-            // FileAlignement		4
-            // OSMajor				2
-            // OSMinor				2
-            // UserMajor			2
-            // UserMinor			2
-            // SubSysMajor			2
-            // SubSysMinor			2
-            // Reserved				4
-            // ImageSize			4
-            // HeaderSize			4
-            // FileChecksum			4
-            Advance(66);
-
-            // SubSystem			2
-            subsystem = ReadUInt16();
-
-            // DLLFlags				2
-            dll_characteristics = ReadUInt16();
-            // StackReserveSize		4 || 8
-            // StackCommitSize		4 || 8
-            // HeapReserveSize		4 || 8
-            // HeapCommitSize		4 || 8
-            // LoaderFlags			4
-            // NumberOfDataDir		4
-
-            //   - DataDirectoriesHeader
-
-            // ExportTable			8
-            // ImportTable			8
-            // ResourceTable		8
-            // ExceptionTable		8
-            // CertificateTable		8
-            // BaseRelocationTable	8
-
-            Advance(pe64 ? 88 : 72);
-
-            // Debug				8
-            image.Debug = ReadDataDirectory();
-
-            // Copyright			8
-            // GlobalPtr			8
-            // TLSTable				8
-            // LoadConfigTable		8
-            // BoundImport			8
-            // IAT					8
-            // DelayImportDescriptor8
-            Advance(56);
-
-            // CLIHeader			8
-            cli = ReadDataDirectory();
-
-            if (cli.IsZero)
-                throw new BadImageFormatException();
-
-            // Reserved				8
-            Advance(8);
-        }
-
-        string ReadAlignedString(int length)
-        {
-            int read = 0;
-            var buffer = new char[length];
-            while (read < length)
-            {
-                var current = ReadByte();
-                if (current == 0)
-                    break;
-
-                buffer[read++] = (char)current;
-            }
-
-            Advance(-1 + ((read + 4) & ~3) - read);
-
-            return new string(buffer, 0, read);
-        }
-
-        string ReadZeroTerminatedString(int length)
-        {
-            int read = 0;
-            var buffer = new char[length];
-            var bytes = ReadBytes(length);
-            while (read < length)
-            {
-                var current = bytes[read];
-                if (current == 0)
-                    break;
-
-                buffer[read++] = (char)current;
-            }
-
-            return new string(buffer, 0, read);
-        }
-
-        void ReadSections(ushort count)
-        {
-            var sections = new Section[count];
-
-            for (int i = 0; i < count; i++)
-            {
-                var section = new Section();
-
-                // Name
-                section.Name = ReadZeroTerminatedString(8);
-
-                // VirtualSize		4
-                Advance(4);
-
-                // VirtualAddress	4
-                section.VirtualAddress = ReadUInt32();
-                // SizeOfRawData	4
-                section.SizeOfRawData = ReadUInt32();
-                // PointerToRawData	4
-                section.PointerToRawData = ReadUInt32();
-
-                // PointerToRelocations		4
-                // PointerToLineNumbers		4
-                // NumberOfRelocations		2
-                // NumberOfLineNumbers		2
-                // Characteristics			4
-                Advance(16);
-
-                sections[i] = section;
-
-                ReadSectionData(section);
-            }
-
-            image.Sections = sections;
-        }
-
-        void ReadSectionData(Section section)
-        {
-            var position = BaseStream.Position;
-
-            MoveTo(section.PointerToRawData);
-
-            var length = (int)section.SizeOfRawData;
-            var data = new byte[length];
-            int offset = 0, read;
-
-            while ((read = Read(data, offset, length - offset)) > 0)
-                offset += read;
-
-            section.Data = data;
-
-            BaseStream.Position = position;
-        }
-
-        void ReadCLIHeader()
-        {
-            MoveTo(cli);
-
-            // - CLIHeader
-
-            // Cb						4
-            // MajorRuntimeVersion		2
-            // MinorRuntimeVersion		2
-            Advance(8);
-
-            // Metadata					8
-            metadata = ReadDataDirectory();
-            // Flags					4
-            image.Attributes = (ModuleAttributes)ReadUInt32();
-            // EntryPointToken			4
-            image.EntryPointToken = ReadUInt32();
-            // Resources				8
-            image.Resources = ReadDataDirectory();
-            // StrongNameSignature		8
-            image.StrongName = ReadDataDirectory();
-            // CodeManagerTable			8
-            // VTableFixups				8
-            // ExportAddressTableJumps	8
-            // ManagedNativeHeader		8
-        }
-
-        void ReadMetadata()
-        {
-            MoveTo(metadata);
-
-            if (ReadUInt32() != 0x424a5342)
-                throw new BadImageFormatException();
-
-            // MajorVersion			2
-            // MinorVersion			2
-            // Reserved				4
-            Advance(8);
-
-            var version = ReadZeroTerminatedString(ReadInt32());
-            image.Runtime = Mixin.ParseRuntime(version);
-
-            // Flags		2
-            Advance(2);
-
-            var streams = ReadUInt16();
-
-            var section = image.GetSectionAtVirtualAddress(metadata.VirtualAddress);
-            if (section == null)
-                throw new BadImageFormatException();
-
-            image.MetadataSection = section;
-
-            for (int i = 0; i < streams; i++)
-                ReadMetadataStream(section);
-
-            if (image.TableHeap != null)
-                ReadTableHeap();
-        }
-
-        void ReadMetadataStream(Section section)
-        {
-            // Offset		4
-            uint start = metadata.VirtualAddress - section.VirtualAddress + ReadUInt32(); // relative to the section start
-
-            // Size			4
-            uint size = ReadUInt32();
-
-            var name = ReadAlignedString(16);
-            switch (name)
-            {
-                case "#~":
-                case "#-":
-                    image.TableHeap = new TableHeap(section, start, size);
-                    break;
-                case "#Strings":
-                    image.StringHeap = new StringHeap(section, start, size);
-                    break;
-                case "#Blob":
-                    image.BlobHeap = new BlobHeap(section, start, size);
-                    break;
-                case "#GUID":
-                    image.GuidHeap = new GuidHeap(section, start, size);
-                    break;
-                case "#US":
-                    image.UserStringHeap = new UserStringHeap(section, start, size);
-                    break;
-            }
-        }
-
-        void ReadTableHeap()
-        {
-            var heap = image.TableHeap;
-
-            uint start = heap.Section.PointerToRawData;
-
-            MoveTo(heap.Offset + start);
-
-            // Reserved			4
-            // MajorVersion		1
-            // MinorVersion		1
-            Advance(6);
-
-            // HeapSizes		1
-            var sizes = ReadByte();
-
-            // Reserved2		1
-            Advance(1);
-
-            // Valid			8
-            heap.Valid = ReadInt64();
-
-            // Sorted			8
-            heap.Sorted = ReadInt64();
-
-            for (int i = 0; i < TableHeap.TableCount; i++)
-            {
-                if (!heap.HasTable((Table)i))
-                    continue;
-
-                heap.Tables[i].Length = ReadUInt32();
-            }
-
-            SetIndexSize(image.StringHeap, sizes, 0x1);
-            SetIndexSize(image.GuidHeap, sizes, 0x2);
-            SetIndexSize(image.BlobHeap, sizes, 0x4);
-
-            ComputeTableInformations();
-        }
-
-        static void SetIndexSize(Heap heap, uint sizes, byte flag)
-        {
-            if (heap == null)
-                return;
-
-            heap.IndexSize = (sizes & flag) > 0 ? 4 : 2;
-        }
-
-        int GetTableIndexSize(Table table)
-        {
-            return image.GetTableIndexSize(table);
-        }
-
-        int GetCodedIndexSize(CodedIndex index)
-        {
-            return image.GetCodedIndexSize(index);
-        }
-
-        void ComputeTableInformations()
-        {
-            uint offset = (uint)BaseStream.Position - image.MetadataSection.PointerToRawData; // header
-
-            int stridx_size = image.StringHeap.IndexSize;
-            int blobidx_size = image.BlobHeap != null ? image.BlobHeap.IndexSize : 2;
-
-            var heap = image.TableHeap;
-            var tables = heap.Tables;
-
-            for (int i = 0; i < TableHeap.TableCount; i++)
-            {
-                var table = (Table)i;
-                if (!heap.HasTable(table))
-                    continue;
-
-                int size;
-                switch (table)
-                {
-                    case Table.Module:
-                        size = 2	// Generation
-                            + stridx_size	// Name
-                            + (image.GuidHeap.IndexSize * 3);	// Mvid, EncId, EncBaseId
-                        break;
-                    case Table.TypeRef:
-                        size = GetCodedIndexSize(CodedIndex.ResolutionScope)	// ResolutionScope
-                            + (stridx_size * 2);	// Name, Namespace
-                        break;
-                    case Table.TypeDef:
-                        size = 4	// Flags
-                            + (stridx_size * 2)	// Name, Namespace
-                            + GetCodedIndexSize(CodedIndex.TypeDefOrRef)	// BaseType
-                            + GetTableIndexSize(Table.Field)	// FieldList
-                            + GetTableIndexSize(Table.Method);	// MethodList
-                        break;
-                    case Table.FieldPtr:
-                        size = GetTableIndexSize(Table.Field);	// Field
-                        break;
-                    case Table.Field:
-                        size = 2	// Flags
-                            + stridx_size	// Name
-                            + blobidx_size;	// Signature
-                        break;
-                    case Table.MethodPtr:
-                        size = GetTableIndexSize(Table.Method);	// Method
-                        break;
-                    case Table.Method:
-                        size = 8	// Rva 4, ImplFlags 2, Flags 2
-                            + stridx_size	// Name
-                            + blobidx_size	// Signature
-                            + GetTableIndexSize(Table.Param); // ParamList
-                        break;
-                    case Table.ParamPtr:
-                        size = GetTableIndexSize(Table.Param); // Param
-                        break;
-                    case Table.Param:
-                        size = 4	// Flags 2, Sequence 2
-                            + stridx_size;	// Name
-                        break;
-                    case Table.InterfaceImpl:
-                        size = GetTableIndexSize(Table.TypeDef)	// Class
-                            + GetCodedIndexSize(CodedIndex.TypeDefOrRef);	// Interface
-                        break;
-                    case Table.MemberRef:
-                        size = GetCodedIndexSize(CodedIndex.MemberRefParent)	// Class
-                            + stridx_size	// Name
-                            + blobidx_size;	// Signature
-                        break;
-                    case Table.Constant:
-                        size = 2	// Type
-                            + GetCodedIndexSize(CodedIndex.HasConstant)	// Parent
-                            + blobidx_size;	// Value
-                        break;
-                    case Table.CustomAttribute:
-                        size = GetCodedIndexSize(CodedIndex.HasCustomAttribute)	// Parent
-                            + GetCodedIndexSize(CodedIndex.CustomAttributeType)	// Type
-                            + blobidx_size;	// Value
-                        break;
-                    case Table.FieldMarshal:
-                        size = GetCodedIndexSize(CodedIndex.HasFieldMarshal)	// Parent
-                            + blobidx_size;	// NativeType
-                        break;
-                    case Table.DeclSecurity:
-                        size = 2	// Action
-                            + GetCodedIndexSize(CodedIndex.HasDeclSecurity)	// Parent
-                            + blobidx_size;	// PermissionSet
-                        break;
-                    case Table.ClassLayout:
-                        size = 6	// PackingSize 2, ClassSize 4
-                            + GetTableIndexSize(Table.TypeDef);	// Parent
-                        break;
-                    case Table.FieldLayout:
-                        size = 4	// Offset
-                            + GetTableIndexSize(Table.Field);	// Field
-                        break;
-                    case Table.StandAloneSig:
-                        size = blobidx_size;	// Signature
-                        break;
-                    case Table.EventMap:
-                        size = GetTableIndexSize(Table.TypeDef)	// Parent
-                            + GetTableIndexSize(Table.Event);	// EventList
-                        break;
-                    case Table.EventPtr:
-                        size = GetTableIndexSize(Table.Event);	// Event
-                        break;
-                    case Table.Event:
-                        size = 2	// Flags
-                            + stridx_size // Name
-                            + GetCodedIndexSize(CodedIndex.TypeDefOrRef);	// EventType
-                        break;
-                    case Table.PropertyMap:
-                        size = GetTableIndexSize(Table.TypeDef)	// Parent
-                            + GetTableIndexSize(Table.Property);	// PropertyList
-                        break;
-                    case Table.PropertyPtr:
-                        size = GetTableIndexSize(Table.Property);	// Property
-                        break;
-                    case Table.Property:
-                        size = 2	// Flags
-                            + stridx_size	// Name
-                            + blobidx_size;	// Type
-                        break;
-                    case Table.MethodSemantics:
-                        size = 2	// Semantics
-                            + GetTableIndexSize(Table.Method)	// Method
-                            + GetCodedIndexSize(CodedIndex.HasSemantics);	// Association
-                        break;
-                    case Table.MethodImpl:
-                        size = GetTableIndexSize(Table.TypeDef)	// Class
-                            + GetCodedIndexSize(CodedIndex.MethodDefOrRef)	// MethodBody
-                            + GetCodedIndexSize(CodedIndex.MethodDefOrRef);	// MethodDeclaration
-                        break;
-                    case Table.ModuleRef:
-                        size = stridx_size;	// Name
-                        break;
-                    case Table.TypeSpec:
-                        size = blobidx_size;	// Signature
-                        break;
-                    case Table.ImplMap:
-                        size = 2	// MappingFlags
-                            + GetCodedIndexSize(CodedIndex.MemberForwarded)	// MemberForwarded
-                            + stridx_size	// ImportName
-                            + GetTableIndexSize(Table.ModuleRef);	// ImportScope
-                        break;
-                    case Table.FieldRVA:
-                        size = 4	// RVA
-                            + GetTableIndexSize(Table.Field);	// Field
-                        break;
-                    case Table.EncLog:
-                    case Table.EncMap:
-                        size = 4;
-                        break;
-                    case Table.Assembly:
-                        size = 16 // HashAlgId 4, Version 4 * 2, Flags 4
-                            + blobidx_size	// PublicKey
-                            + (stridx_size * 2);	// Name, Culture
-                        break;
-                    case Table.AssemblyProcessor:
-                        size = 4;	// Processor
-                        break;
-                    case Table.AssemblyOS:
-                        size = 12;	// Platform 4, Version 2 * 4
-                        break;
-                    case Table.AssemblyRef:
-                        size = 12	// Version 2 * 4 + Flags 4
-                            + (blobidx_size * 2)	// PublicKeyOrToken, HashValue
-                            + (stridx_size * 2);	// Name, Culture
-                        break;
-                    case Table.AssemblyRefProcessor:
-                        size = 4	// Processor
-                            + GetTableIndexSize(Table.AssemblyRef);	// AssemblyRef
-                        break;
-                    case Table.AssemblyRefOS:
-                        size = 12	// Platform 4, Version 2 * 4
-                            + GetTableIndexSize(Table.AssemblyRef);	// AssemblyRef
-                        break;
-                    case Table.File:
-                        size = 4	// Flags
-                            + stridx_size	// Name
-                            + blobidx_size;	// HashValue
-                        break;
-                    case Table.ExportedType:
-                        size = 8	// Flags 4, TypeDefId 4
-                            + (stridx_size * 2)	// Name, Namespace
-                            + GetCodedIndexSize(CodedIndex.Implementation);	// Implementation
-                        break;
-                    case Table.ManifestResource:
-                        size = 8	// Offset, Flags
-                            + stridx_size	// Name
-                            + GetCodedIndexSize(CodedIndex.Implementation);	// Implementation
-                        break;
-                    case Table.NestedClass:
-                        size = GetTableIndexSize(Table.TypeDef)	// NestedClass
-                            + GetTableIndexSize(Table.TypeDef);	// EnclosingClass
-                        break;
-                    case Table.GenericParam:
-                        size = 4	// Number, Flags
-                            + GetCodedIndexSize(CodedIndex.TypeOrMethodDef)	// Owner
-                            + stridx_size;	// Name
-                        break;
-                    case Table.MethodSpec:
-                        size = GetCodedIndexSize(CodedIndex.MethodDefOrRef)	// Method
-                            + blobidx_size;	// Instantiation
-                        break;
-                    case Table.GenericParamConstraint:
-                        size = GetTableIndexSize(Table.GenericParam)	// Owner
-                            + GetCodedIndexSize(CodedIndex.TypeDefOrRef);	// Constraint
-                        break;
-                    default:
-                        throw new NotSupportedException();
-                }
-
-                tables[i].RowSize = (uint)size;
-                tables[i].Offset = offset;
-
-                offset += (uint)size * tables[i].Length;
-            }
-        }
-
-        public static Image ReadImageFrom(Stream stream)
-        {
-            try
-            {
-                var reader = new ImageReader(stream);
-                reader.ReadImage();
-                return reader.image;
-            }
-            catch (EndOfStreamException e)
-            {
-                throw new BadImageFormatException(Mixin.GetFullyQualifiedName(stream), e);
-            }
-        }
-    }
-}

+ 0 - 0
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/ImageWriter.cs


+ 0 - 43
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/Section.cs

@@ -1,43 +0,0 @@
-//
-// Section.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using RVA = System.UInt32;
-
-namespace Mono.Cecil.PE {
-
-	sealed class Section {
-		public string Name;
-		public RVA VirtualAddress;
-		public uint VirtualSize;
-		public uint SizeOfRawData;
-		public uint PointerToRawData;
-		public byte [] Data;
-	}
-}

+ 0 - 0
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil.PE/TextMap.cs


+ 0 - 163
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyDefinition.cs

@@ -1,163 +0,0 @@
-//
-// AssemblyDefinition.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil
-{
-
-    public sealed class AssemblyDefinition : ICustomAttributeProvider, ISecurityDeclarationProvider
-    {
-
-        AssemblyNameDefinition name;
-
-        internal ModuleDefinition main_module;
-        Collection<ModuleDefinition> modules;
-        Collection<CustomAttribute> custom_attributes;
-        Collection<SecurityDeclaration> security_declarations;
-
-        public AssemblyNameDefinition Name
-        {
-            get { return name; }
-            set { name = value; }
-        }
-
-        public string FullName
-        {
-            get { return name != null ? name.FullName : string.Empty; }
-        }
-
-        public MetadataToken MetadataToken
-        {
-            get { return new MetadataToken(TokenType.Assembly, 1); }
-            set { }
-        }
-
-        public Collection<ModuleDefinition> Modules
-        {
-            get
-            {
-                if (modules != null)
-                    return modules;
-
-                if (main_module.HasImage)
-                    return main_module.Read(ref modules, this, (_, reader) => reader.ReadModules());
-
-                return modules = new Collection<ModuleDefinition>(1) { main_module };
-            }
-        }
-
-        public ModuleDefinition MainModule
-        {
-            get { return main_module; }
-        }
-
-        public MethodDefinition EntryPoint
-        {
-            get { return main_module.EntryPoint; }
-            set { main_module.EntryPoint = value; }
-        }
-
-        public bool HasCustomAttributes
-        {
-            get
-            {
-                if (custom_attributes != null)
-                    return custom_attributes.Count > 0;
-
-                return Mixin.GetHasCustomAttributes(this, main_module);
-            }
-        }
-
-        public Collection<CustomAttribute> CustomAttributes
-        {
-            get { return custom_attributes ?? (Mixin.GetCustomAttributes(this, ref custom_attributes, main_module)); }
-        }
-
-        public bool HasSecurityDeclarations
-        {
-            get
-            {
-                if (security_declarations != null)
-                    return security_declarations.Count > 0;
-
-                return Mixin.GetHasSecurityDeclarations(this, main_module);
-            }
-        }
-
-        public Collection<SecurityDeclaration> SecurityDeclarations
-        {
-            get { return security_declarations ?? (Mixin.GetSecurityDeclarations(this, ref security_declarations, main_module)); }
-        }
-
-        internal AssemblyDefinition()
-        {
-        }
-
-
-
-        public static AssemblyDefinition ReadAssembly(string fileName)
-        {
-            return ReadAssembly(ModuleDefinition.ReadModule(fileName));
-        }
-
-        public static AssemblyDefinition ReadAssembly(string fileName, ReaderParameters parameters)
-        {
-            return ReadAssembly(ModuleDefinition.ReadModule(fileName, parameters));
-        }
-
-        public static AssemblyDefinition ReadAssembly(Stream stream)
-        {
-            return ReadAssembly(ModuleDefinition.ReadModule(stream));
-        }
-
-        public static AssemblyDefinition ReadAssembly(Stream stream, ReaderParameters parameters)
-        {
-            return ReadAssembly(ModuleDefinition.ReadModule(stream, parameters));
-        }
-
-        static AssemblyDefinition ReadAssembly(ModuleDefinition module)
-        {
-            var assembly = module.Assembly;
-            if (assembly == null)
-                throw new ArgumentException();
-
-            return assembly;
-        }
-
-
-
-        public override string ToString()
-        {
-            return this.FullName;
-        }
-    }
-}

+ 0 - 42
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyFlags.cs

@@ -1,42 +0,0 @@
-//
-// AssemblyFlags.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	[Flags]
-	public enum AssemblyAttributes : uint {
-		PublicKey					 	= 0x0001,
-		SideBySideCompatible			= 0x0000,
-		Retargetable					= 0x0100,
-		WindowsRuntime					= 0x0200,
-		DisableJITCompileOptimizer		= 0x4000,
-		EnableJITCompileTracking		= 0x8000,
-	}
-}

+ 0 - 36
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyHashAlgorithm.cs

@@ -1,36 +0,0 @@
-//
-// AssemblyHashAlgorithm.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-	public enum AssemblyHashAlgorithm : uint {
-		None		= 0x0000,
-		Reserved	= 0x8003,	// MD5
-		SHA1		= 0x8004
-	}
-}

+ 0 - 57
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyLinkedResource.cs

@@ -1,57 +0,0 @@
-//
-// AssemblyLinkedResource.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	public sealed class AssemblyLinkedResource : Resource {
-
-		AssemblyNameReference reference;
-
-		public AssemblyNameReference Assembly {
-			get { return reference; }
-			set { reference = value; }
-		}
-
-		public override ResourceType ResourceType {
-			get { return ResourceType.AssemblyLinked; }
-		}
-
-		public AssemblyLinkedResource (string name, ManifestResourceAttributes flags)
-			: base (name, flags)
-		{
-		}
-
-		public AssemblyLinkedResource (string name, ManifestResourceAttributes flags, AssemblyNameReference reference)
-			: base (name, flags)
-		{
-			this.reference = reference;
-		}
-	}
-}

+ 0 - 50
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyNameDefinition.cs

@@ -1,50 +0,0 @@
-//
-// AssemblyNameDefinition.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	public sealed class AssemblyNameDefinition : AssemblyNameReference {
-
-		public override byte [] Hash {
-			get { return Empty<byte>.Array; }
-		}
-
-		internal AssemblyNameDefinition ()
-		{
-			this.token = new MetadataToken (TokenType.Assembly, 1);
-		}
-
-		public AssemblyNameDefinition (string name, Version version)
-			: base (name, version)
-		{
-			this.token = new MetadataToken (TokenType.Assembly, 1);
-		}
-	}
-}

+ 0 - 296
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyNameReference.cs

@@ -1,296 +0,0 @@
-//
-// AssemblyNameReference.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Security.Cryptography;
-using System.Text;
-
-namespace Mono.Cecil
-{
-
-    public class AssemblyNameReference : IMetadataScope
-    {
-
-        string name;
-        string culture;
-        Version version;
-        uint attributes;
-        byte[] public_key;
-        byte[] public_key_token;
-        AssemblyHashAlgorithm hash_algorithm;
-        byte[] hash;
-
-        internal MetadataToken token;
-
-        string full_name;
-
-        public string Name
-        {
-            get { return name; }
-            set
-            {
-                name = value;
-                full_name = null;
-            }
-        }
-
-        public string Culture
-        {
-            get { return culture; }
-            set
-            {
-                culture = value;
-                full_name = null;
-            }
-        }
-
-        public Version Version
-        {
-            get { return version; }
-            set
-            {
-                version = value;
-                full_name = null;
-            }
-        }
-
-        public AssemblyAttributes Attributes
-        {
-            get { return (AssemblyAttributes)attributes; }
-            set { attributes = (uint)value; }
-        }
-
-        public bool HasPublicKey
-        {
-            get { return Mixin.GetAttributes(attributes,(uint)AssemblyAttributes.PublicKey); }
-            set { attributes =Mixin.SetAttributes(attributes,(uint)AssemblyAttributes.PublicKey, value); }
-        }
-
-        public bool IsSideBySideCompatible
-        {
-            get { return Mixin.GetAttributes(attributes,(uint)AssemblyAttributes.SideBySideCompatible); }
-            set { attributes =Mixin.SetAttributes(attributes,(uint)AssemblyAttributes.SideBySideCompatible, value); }
-        }
-
-        public bool IsRetargetable
-        {
-            get { return Mixin.GetAttributes(attributes,(uint)AssemblyAttributes.Retargetable); }
-            set { attributes =Mixin.SetAttributes(attributes,(uint)AssemblyAttributes.Retargetable, value); }
-        }
-
-        public bool IsWindowsRuntime
-        {
-            get { return Mixin.GetAttributes(attributes,(uint)AssemblyAttributes.WindowsRuntime); }
-            set { attributes =Mixin.SetAttributes(attributes,(uint)AssemblyAttributes.WindowsRuntime, value); }
-        }
-
-        public byte[] PublicKey
-        {
-            get { return public_key ?? Empty<byte>.Array; }
-            set
-            {
-                public_key = value;
-                HasPublicKey = !Mixin.IsNullOrEmpty(public_key);
-                public_key_token = Empty<byte>.Array;
-                full_name = null;
-            }
-        }
-
-        public byte[] PublicKeyToken
-        {
-            get
-            {
-                if (Mixin.IsNullOrEmpty(public_key_token) && !Mixin.IsNullOrEmpty(public_key))
-                {
-                    var hash = HashPublicKey();
-                    // we need the last 8 bytes in reverse order
-                    byte[] local_public_key_token = new byte[8];
-                    Array.Copy(hash, (hash.Length - 8), local_public_key_token, 0, 8);
-                    Array.Reverse(local_public_key_token, 0, 8);
-                    public_key_token = local_public_key_token; // publish only once finished (required for thread-safety)
-                }
-                return public_key_token ?? Empty<byte>.Array;
-            }
-            set
-            {
-                public_key_token = value;
-                full_name = null;
-            }
-        }
-
-        byte[] HashPublicKey()
-        {
-            HashAlgorithm algorithm;
-
-            switch (hash_algorithm)
-            {
-                case AssemblyHashAlgorithm.Reserved:
-
-                    throw new NotSupportedException();
-
-                default:
-                    // None default to SHA1
-                    algorithm = new SHA1Managed();
-                    break;
-
-            }
-
-            using (algorithm)
-                return algorithm.ComputeHash(public_key);
-        }
-
-        public virtual MetadataScopeType MetadataScopeType
-        {
-            get { return MetadataScopeType.AssemblyNameReference; }
-        }
-
-        public string FullName
-        {
-            get
-            {
-                if (full_name != null)
-                    return full_name;
-
-                const string sep = ", ";
-
-                var builder = new StringBuilder();
-                builder.Append(name);
-                if (version != null)
-                {
-                    builder.Append(sep);
-                    builder.Append("Version=");
-                    builder.Append(version.ToString());
-                }
-                builder.Append(sep);
-                builder.Append("Culture=");
-                builder.Append(string.IsNullOrEmpty(culture) ? "neutral" : culture);
-                builder.Append(sep);
-                builder.Append("PublicKeyToken=");
-
-                var pk_token = PublicKeyToken;
-                if (!Mixin.IsNullOrEmpty(pk_token) && pk_token.Length > 0)
-                {
-                    for (int i = 0; i < pk_token.Length; i++)
-                    {
-                        builder.Append(pk_token[i].ToString("x2"));
-                    }
-                }
-                else
-                    builder.Append("null");
-
-                return full_name = builder.ToString();
-            }
-        }
-
-        public static AssemblyNameReference Parse(string fullName)
-        {
-            if (fullName == null)
-                throw new ArgumentNullException("fullName");
-            if (fullName.Length == 0)
-                throw new ArgumentException("Name can not be empty");
-
-            var name = new AssemblyNameReference();
-            var tokens = fullName.Split(',');
-            for (int i = 0; i < tokens.Length; i++)
-            {
-                var token = tokens[i].Trim();
-
-                if (i == 0)
-                {
-                    name.Name = token;
-                    continue;
-                }
-
-                var parts = token.Split('=');
-                if (parts.Length != 2)
-                    throw new ArgumentException("Malformed name");
-
-                switch (parts[0].ToLowerInvariant())
-                {
-                    case "version":
-                        name.Version = new Version(parts[1]);
-                        break;
-                    case "culture":
-                        name.Culture = parts[1];
-                        break;
-                    case "publickeytoken":
-                        var pk_token = parts[1];
-                        if (pk_token == "null")
-                            break;
-
-                        name.PublicKeyToken = new byte[pk_token.Length / 2];
-                        for (int j = 0; j < name.PublicKeyToken.Length; j++)
-                            name.PublicKeyToken[j] = Byte.Parse(pk_token.Substring(j * 2, 2), NumberStyles.HexNumber);
-
-                        break;
-                }
-            }
-
-            return name;
-        }
-
-        public AssemblyHashAlgorithm HashAlgorithm
-        {
-            get { return hash_algorithm; }
-            set { hash_algorithm = value; }
-        }
-
-        public virtual byte[] Hash
-        {
-            get { return hash; }
-            set { hash = value; }
-        }
-
-        public MetadataToken MetadataToken
-        {
-            get { return token; }
-            set { token = value; }
-        }
-
-        internal AssemblyNameReference()
-        {
-        }
-
-        public AssemblyNameReference(string name, Version version)
-        {
-            if (name == null)
-                throw new ArgumentNullException("name");
-
-            this.name = name;
-            this.version = version;
-            this.hash_algorithm = AssemblyHashAlgorithm.None;
-            this.token = new MetadataToken(TokenType.AssemblyRef);
-        }
-
-        public override string ToString()
-        {
-            return this.FullName;
-        }
-    }
-}

+ 0 - 3342
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyReader.cs

@@ -1,3342 +0,0 @@
-//
-// AssemblyReader.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-
-using Mono.Collections.Generic;
-using Mono.Cecil.Cil;
-using Mono.Cecil.Metadata;
-using Mono.Cecil.PE;
-
-using RVA = System.UInt32;
-
-namespace Mono.Cecil
-{
-
-    abstract class ModuleReader
-    {
-
-        readonly protected Image image;
-        readonly protected ModuleDefinition module;
-
-        protected ModuleReader(Image image, ReadingMode mode)
-        {
-            this.image = image;
-            this.module = new ModuleDefinition(image);
-            this.module.ReadingMode = mode;
-        }
-
-        protected abstract void ReadModule();
-
-        protected void ReadModuleManifest(MetadataReader reader)
-        {
-            reader.Populate(module);
-
-            ReadAssembly(reader);
-        }
-
-        void ReadAssembly(MetadataReader reader)
-        {
-            var name = reader.ReadAssemblyNameDefinition();
-            if (name == null)
-            {
-                module.kind = ModuleKind.NetModule;
-                return;
-            }
-
-            var assembly = new AssemblyDefinition();
-            assembly.Name = name;
-
-            module.assembly = assembly;
-            assembly.main_module = module;
-        }
-
-        public static ModuleDefinition CreateModuleFrom(Image image, ReaderParameters parameters)
-        {
-            var module = ReadModule(image, parameters);
-
-            ReadSymbols(module, parameters);
-
-            if (parameters.AssemblyResolver != null)
-                module.assembly_resolver = parameters.AssemblyResolver;
-
-            if (parameters.MetadataResolver != null)
-                module.metadata_resolver = parameters.MetadataResolver;
-
-            return module;
-        }
-
-        static void ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
-        {
-            var symbol_reader_provider = parameters.SymbolReaderProvider;
-
-            if (symbol_reader_provider == null && parameters.ReadSymbols)
-                symbol_reader_provider = SymbolProvider.GetPlatformReaderProvider();
-
-            if (symbol_reader_provider != null)
-            {
-                module.SymbolReaderProvider = symbol_reader_provider;
-
-                var reader = parameters.SymbolStream != null
-                    ? symbol_reader_provider.GetSymbolReader(module, parameters.SymbolStream)
-                    : symbol_reader_provider.GetSymbolReader(module, module.FullyQualifiedName);
-
-                module.ReadSymbols(reader);
-            }
-        }
-
-        static ModuleDefinition ReadModule(Image image, ReaderParameters parameters)
-        {
-            var reader = CreateModuleReader(image, parameters.ReadingMode);
-            reader.ReadModule();
-            return reader.module;
-        }
-
-        static ModuleReader CreateModuleReader(Image image, ReadingMode mode)
-        {
-            switch (mode)
-            {
-                case ReadingMode.Immediate:
-                    return new ImmediateModuleReader(image);
-                case ReadingMode.Deferred:
-                    return new DeferredModuleReader(image);
-                default:
-                    throw new ArgumentException();
-            }
-        }
-    }
-
-    sealed class ImmediateModuleReader : ModuleReader
-    {
-
-        public ImmediateModuleReader(Image image)
-            : base(image, ReadingMode.Immediate)
-        {
-        }
-
-        protected override void ReadModule()
-        {
-            this.module.Read(this.module, (module, reader) =>
-            {
-                ReadModuleManifest(reader);
-                ReadModule(module);
-                return module;
-            });
-        }
-
-        public static void ReadModule(ModuleDefinition module)
-        {
-            if (module.HasAssemblyReferences)
-                Read(module.AssemblyReferences);
-            if (module.HasResources)
-                Read(module.Resources);
-            if (module.HasModuleReferences)
-                Read(module.ModuleReferences);
-            if (module.HasTypes)
-                ReadTypes(module.Types);
-            if (module.HasExportedTypes)
-                Read(module.ExportedTypes);
-            if (module.HasCustomAttributes)
-                Read(module.CustomAttributes);
-
-            var assembly = module.Assembly;
-            if (assembly == null)
-                return;
-
-            if (assembly.HasCustomAttributes)
-                Read(assembly.CustomAttributes);
-            if (assembly.HasSecurityDeclarations)
-                Read(assembly.SecurityDeclarations);
-        }
-
-        static void ReadTypes(Collection<TypeDefinition> types)
-        {
-            for (int i = 0; i < types.Count; i++)
-                ReadType(types[i]);
-        }
-
-        static void ReadType(TypeDefinition type)
-        {
-            ReadGenericParameters(type);
-
-            if (type.HasInterfaces)
-                Read(type.Interfaces);
-
-            if (type.HasNestedTypes)
-                ReadTypes(type.NestedTypes);
-
-            if (type.HasLayoutInfo)
-                Read(type.ClassSize);
-
-            if (type.HasFields)
-                ReadFields(type);
-
-            if (type.HasMethods)
-                ReadMethods(type);
-
-            if (type.HasProperties)
-                ReadProperties(type);
-
-            if (type.HasEvents)
-                ReadEvents(type);
-
-            ReadSecurityDeclarations(type);
-            ReadCustomAttributes(type);
-        }
-
-        static void ReadGenericParameters(IGenericParameterProvider provider)
-        {
-            if (!provider.HasGenericParameters)
-                return;
-
-            var parameters = provider.GenericParameters;
-
-            for (int i = 0; i < parameters.Count; i++)
-            {
-                var parameter = parameters[i];
-
-                if (parameter.HasConstraints)
-                    Read(parameter.Constraints);
-
-                if (parameter.HasCustomAttributes)
-                    Read(parameter.CustomAttributes);
-            }
-        }
-
-        static void ReadSecurityDeclarations(ISecurityDeclarationProvider provider)
-        {
-            if (provider.HasSecurityDeclarations)
-                Read(provider.SecurityDeclarations);
-        }
-
-        static void ReadCustomAttributes(ICustomAttributeProvider provider)
-        {
-            if (provider.HasCustomAttributes)
-                Read(provider.CustomAttributes);
-        }
-
-        static void ReadFields(TypeDefinition type)
-        {
-            var fields = type.Fields;
-
-            for (int i = 0; i < fields.Count; i++)
-            {
-                var field = fields[i];
-
-                if (field.HasConstant)
-                    Read(field.Constant);
-
-                if (field.HasLayoutInfo)
-                    Read(field.Offset);
-
-                if (field.RVA > 0)
-                    Read(field.InitialValue);
-
-                if (field.HasMarshalInfo)
-                    Read(field.MarshalInfo);
-
-                ReadCustomAttributes(field);
-            }
-        }
-
-        static void ReadMethods(TypeDefinition type)
-        {
-            var methods = type.Methods;
-
-            for (int i = 0; i < methods.Count; i++)
-            {
-                var method = methods[i];
-
-                ReadGenericParameters(method);
-
-                if (method.HasParameters)
-                    ReadParameters(method);
-
-                if (method.HasOverrides)
-                    Read(method.Overrides);
-
-                if (method.IsPInvokeImpl)
-                    Read(method.PInvokeInfo);
-
-                ReadSecurityDeclarations(method);
-                ReadCustomAttributes(method);
-
-                var return_type = method.MethodReturnType;
-                if (return_type.HasConstant)
-                    Read(return_type.Constant);
-
-                if (return_type.HasMarshalInfo)
-                    Read(return_type.MarshalInfo);
-
-                ReadCustomAttributes(return_type);
-            }
-        }
-
-        static void ReadParameters(MethodDefinition method)
-        {
-            var parameters = method.Parameters;
-
-            for (int i = 0; i < parameters.Count; i++)
-            {
-                var parameter = parameters[i];
-
-                if (parameter.HasConstant)
-                    Read(parameter.Constant);
-
-                if (parameter.HasMarshalInfo)
-                    Read(parameter.MarshalInfo);
-
-                ReadCustomAttributes(parameter);
-            }
-        }
-
-        static void ReadProperties(TypeDefinition type)
-        {
-            var properties = type.Properties;
-
-            for (int i = 0; i < properties.Count; i++)
-            {
-                var property = properties[i];
-
-                Read(property.GetMethod);
-
-                if (property.HasConstant)
-                    Read(property.Constant);
-
-                ReadCustomAttributes(property);
-            }
-        }
-
-        static void ReadEvents(TypeDefinition type)
-        {
-            var events = type.Events;
-
-            for (int i = 0; i < events.Count; i++)
-            {
-                var @event = events[i];
-
-                Read(@event.AddMethod);
-
-                ReadCustomAttributes(@event);
-            }
-        }
-
-        static void Read(object collection)
-        {
-        }
-    }
-
-    sealed class DeferredModuleReader : ModuleReader
-    {
-
-        public DeferredModuleReader(Image image)
-            : base(image, ReadingMode.Deferred)
-        {
-        }
-
-        protected override void ReadModule()
-        {
-            this.module.Read(this.module, (module, reader) =>
-            {
-                ReadModuleManifest(reader);
-                return module;
-            });
-        }
-    }
-
-    sealed class MetadataReader : ByteBuffer
-    {
-
-        readonly internal Image image;
-        readonly internal ModuleDefinition module;
-        readonly internal MetadataSystem metadata;
-
-        internal IGenericContext context;
-        internal CodeReader code;
-
-        uint Position
-        {
-            get { return (uint)base.position; }
-            set { base.position = (int)value; }
-        }
-
-        public MetadataReader(ModuleDefinition module)
-            : base(module.Image.MetadataSection.Data)
-        {
-            this.image = module.Image;
-            this.module = module;
-            this.metadata = module.MetadataSystem;
-            this.code = new CodeReader(image.MetadataSection, this);
-        }
-
-        int GetCodedIndexSize(CodedIndex index)
-        {
-            return image.GetCodedIndexSize(index);
-        }
-
-        uint ReadByIndexSize(int size)
-        {
-            if (size == 4)
-                return ReadUInt32();
-            else
-                return ReadUInt16();
-        }
-
-        byte[] ReadBlob()
-        {
-            var blob_heap = image.BlobHeap;
-            if (blob_heap == null)
-            {
-                position += 2;
-                return Empty<byte>.Array;
-            }
-
-            return blob_heap.Read(ReadBlobIndex());
-        }
-
-        byte[] ReadBlob(uint signature)
-        {
-            var blob_heap = image.BlobHeap;
-            if (blob_heap == null)
-                return Empty<byte>.Array;
-
-            return blob_heap.Read(signature);
-        }
-
-        uint ReadBlobIndex()
-        {
-            var blob_heap = image.BlobHeap;
-            return ReadByIndexSize(blob_heap != null ? blob_heap.IndexSize : 2);
-        }
-
-        string ReadString()
-        {
-            return image.StringHeap.Read(ReadByIndexSize(image.StringHeap.IndexSize));
-        }
-
-        uint ReadStringIndex()
-        {
-            return ReadByIndexSize(image.StringHeap.IndexSize);
-        }
-
-        uint ReadTableIndex(Table table)
-        {
-            return ReadByIndexSize(image.GetTableIndexSize(table));
-        }
-
-        MetadataToken ReadMetadataToken(CodedIndex index)
-        {
-            return Mixin.GetMetadataToken(index, ReadByIndexSize(GetCodedIndexSize(index)));
-        }
-
-        int MoveTo(Table table)
-        {
-            var info = image.TableHeap[table];
-            if (info.Length != 0)
-                Position = info.Offset;
-
-            return (int)info.Length;
-        }
-
-        bool MoveTo(Table table, uint row)
-        {
-            var info = image.TableHeap[table];
-            var length = info.Length;
-            if (length == 0 || row > length)
-                return false;
-
-            Position = info.Offset + (info.RowSize * (row - 1));
-            return true;
-        }
-
-        public AssemblyNameDefinition ReadAssemblyNameDefinition()
-        {
-            if (MoveTo(Table.Assembly) == 0)
-                return null;
-
-            var name = new AssemblyNameDefinition();
-
-            name.HashAlgorithm = (AssemblyHashAlgorithm)ReadUInt32();
-
-            PopulateVersionAndFlags(name);
-
-            name.PublicKey = ReadBlob();
-
-            PopulateNameAndCulture(name);
-
-            return name;
-        }
-
-        public ModuleDefinition Populate(ModuleDefinition module)
-        {
-            if (MoveTo(Table.Module) == 0)
-                return module;
-
-            Advance(2); // Generation
-
-            module.Name = ReadString();
-            module.Mvid = image.GuidHeap.Read(ReadByIndexSize(image.GuidHeap.IndexSize));
-
-            return module;
-        }
-
-        void InitializeAssemblyReferences()
-        {
-            if (metadata.AssemblyReferences != null)
-                return;
-
-            int length = MoveTo(Table.AssemblyRef);
-            var references = metadata.AssemblyReferences = new AssemblyNameReference[length];
-
-            for (uint i = 0; i < length; i++)
-            {
-                var reference = new AssemblyNameReference();
-                reference.token = new MetadataToken(TokenType.AssemblyRef, i + 1);
-
-                PopulateVersionAndFlags(reference);
-
-                var key_or_token = ReadBlob();
-
-                if (reference.HasPublicKey)
-                    reference.PublicKey = key_or_token;
-                else
-                    reference.PublicKeyToken = key_or_token;
-
-                PopulateNameAndCulture(reference);
-
-                reference.Hash = ReadBlob();
-
-                references[i] = reference;
-            }
-        }
-
-        public Collection<AssemblyNameReference> ReadAssemblyReferences()
-        {
-            InitializeAssemblyReferences();
-
-            return new Collection<AssemblyNameReference>(metadata.AssemblyReferences);
-        }
-
-        public MethodDefinition ReadEntryPoint()
-        {
-            if (module.Image.EntryPointToken == 0)
-                return null;
-
-            var token = new MetadataToken(module.Image.EntryPointToken);
-            return GetMethodDefinition(token.RID);
-        }
-
-        public Collection<ModuleDefinition> ReadModules()
-        {
-            var modules = new Collection<ModuleDefinition>(1);
-            modules.Add(this.module);
-
-            int length = MoveTo(Table.File);
-            for (uint i = 1; i <= length; i++)
-            {
-                var attributes = (FileAttributes)ReadUInt32();
-                var name = ReadString();
-                ReadBlobIndex();
-
-                if (attributes != FileAttributes.ContainsMetaData)
-                    continue;
-
-                var parameters = new ReaderParameters
-                {
-                    ReadingMode = module.ReadingMode,
-                    SymbolReaderProvider = module.SymbolReaderProvider,
-                };
-
-                modules.Add(ModuleDefinition.ReadModule(
-                    GetModuleFileName(name), parameters));
-            }
-
-            return modules;
-        }
-
-        string GetModuleFileName(string name)
-        {
-            if (module.FullyQualifiedName == null)
-                throw new NotSupportedException();
-
-            var path = Path.GetDirectoryName(module.FullyQualifiedName);
-            return Path.Combine(path, name);
-        }
-
-        void InitializeModuleReferences()
-        {
-            if (metadata.ModuleReferences != null)
-                return;
-
-            int length = MoveTo(Table.ModuleRef);
-            var references = metadata.ModuleReferences = new ModuleReference[length];
-
-            for (uint i = 0; i < length; i++)
-            {
-                var reference = new ModuleReference(ReadString());
-                reference.token = new MetadataToken(TokenType.ModuleRef, i + 1);
-
-                references[i] = reference;
-            }
-        }
-
-        public Collection<ModuleReference> ReadModuleReferences()
-        {
-            InitializeModuleReferences();
-
-            return new Collection<ModuleReference>(metadata.ModuleReferences);
-        }
-
-        public bool HasFileResource()
-        {
-            int length = MoveTo(Table.File);
-            if (length == 0)
-                return false;
-
-            for (uint i = 1; i <= length; i++)
-                if (ReadFileRecord(i).Col1 == FileAttributes.ContainsNoMetaData)
-                    return true;
-
-            return false;
-        }
-
-        public Collection<Resource> ReadResources()
-        {
-            int length = MoveTo(Table.ManifestResource);
-            var resources = new Collection<Resource>(length);
-
-            for (int i = 1; i <= length; i++)
-            {
-                var offset = ReadUInt32();
-                var flags = (ManifestResourceAttributes)ReadUInt32();
-                var name = ReadString();
-                var implementation = ReadMetadataToken(CodedIndex.Implementation);
-
-                Resource resource;
-
-                if (implementation.RID == 0)
-                {
-                    resource = new EmbeddedResource(name, flags, offset, this);
-                }
-                else if (implementation.TokenType == TokenType.AssemblyRef)
-                {
-                    resource = new AssemblyLinkedResource(name, flags)
-                    {
-                        Assembly = (AssemblyNameReference)GetTypeReferenceScope(implementation),
-                    };
-                }
-                else if (implementation.TokenType == TokenType.File)
-                {
-                    var file_record = ReadFileRecord(implementation.RID);
-
-                    resource = new LinkedResource(name, flags)
-                    {
-                        File = file_record.Col2,
-                        hash = ReadBlob(file_record.Col3)
-                    };
-                }
-                else
-                    throw new NotSupportedException();
-
-                resources.Add(resource);
-            }
-
-            return resources;
-        }
-
-        Row<FileAttributes, string, uint> ReadFileRecord(uint rid)
-        {
-            var position = this.position;
-
-            if (!MoveTo(Table.File, rid))
-                throw new ArgumentException();
-
-            var record = new Row<FileAttributes, string, uint>(
-                (FileAttributes)ReadUInt32(),
-                ReadString(),
-                ReadBlobIndex());
-
-            this.position = position;
-
-            return record;
-        }
-
-        public MemoryStream GetManagedResourceStream(uint offset)
-        {
-            var rva = image.Resources.VirtualAddress;
-            var section = image.GetSectionAtVirtualAddress(rva);
-            var position = (rva - section.VirtualAddress) + offset;
-            var buffer = section.Data;
-
-            var length = buffer[position]
-                | (buffer[position + 1] << 8)
-                | (buffer[position + 2] << 16)
-                | (buffer[position + 3] << 24);
-
-            return new MemoryStream(buffer, (int)position + 4, length);
-        }
-
-        void PopulateVersionAndFlags(AssemblyNameReference name)
-        {
-            name.Version = new Version(
-                ReadUInt16(),
-                ReadUInt16(),
-                ReadUInt16(),
-                ReadUInt16());
-
-            name.Attributes = (AssemblyAttributes)ReadUInt32();
-        }
-
-        void PopulateNameAndCulture(AssemblyNameReference name)
-        {
-            name.Name = ReadString();
-            name.Culture = ReadString();
-        }
-
-        public TypeDefinitionCollection ReadTypes()
-        {
-            InitializeTypeDefinitions();
-            var mtypes = metadata.Types;
-            var type_count = mtypes.Length - metadata.NestedTypes.Count;
-            var types = new TypeDefinitionCollection(module, type_count);
-
-            for (int i = 0; i < mtypes.Length; i++)
-            {
-                var type = mtypes[i];
-                if (IsNested(type.Attributes))
-                    continue;
-
-                types.Add(type);
-            }
-
-            if (image.HasTable(Table.MethodPtr) || image.HasTable(Table.FieldPtr))
-                CompleteTypes();
-
-            return types;
-        }
-
-        void CompleteTypes()
-        {
-            var types = metadata.Types;
-
-            for (int i = 0; i < types.Length; i++)
-            {
-                var type = types[i];
-
-                InitializeCollection(type.Fields);
-                InitializeCollection(type.Methods);
-            }
-        }
-
-        void InitializeTypeDefinitions()
-        {
-            if (metadata.Types != null)
-                return;
-
-            InitializeNestedTypes();
-            InitializeFields();
-            InitializeMethods();
-
-            int length = MoveTo(Table.TypeDef);
-            var types = metadata.Types = new TypeDefinition[length];
-
-            for (uint i = 0; i < length; i++)
-            {
-                if (types[i] != null)
-                    continue;
-
-                types[i] = ReadType(i + 1);
-            }
-        }
-
-        static bool IsNested(TypeAttributes attributes)
-        {
-            switch (attributes & TypeAttributes.VisibilityMask)
-            {
-                case TypeAttributes.NestedAssembly:
-                case TypeAttributes.NestedFamANDAssem:
-                case TypeAttributes.NestedFamily:
-                case TypeAttributes.NestedFamORAssem:
-                case TypeAttributes.NestedPrivate:
-                case TypeAttributes.NestedPublic:
-                    return true;
-                default:
-                    return false;
-            }
-        }
-
-        public bool HasNestedTypes(TypeDefinition type)
-        {
-            uint[] mapping;
-            InitializeNestedTypes();
-
-            if (!metadata.TryGetNestedTypeMapping(type, out mapping))
-                return false;
-
-            return mapping.Length > 0;
-        }
-
-        public Collection<TypeDefinition> ReadNestedTypes(TypeDefinition type)
-        {
-            InitializeNestedTypes();
-            uint[] mapping;
-            if (!metadata.TryGetNestedTypeMapping(type, out mapping))
-                return new MemberDefinitionCollection<TypeDefinition>(type);
-
-            var nested_types = new MemberDefinitionCollection<TypeDefinition>(type, mapping.Length);
-
-            for (int i = 0; i < mapping.Length; i++)
-            {
-                var nested_type = GetTypeDefinition(mapping[i]);
-
-                if (nested_type != null)
-                    nested_types.Add(nested_type);
-            }
-
-            metadata.RemoveNestedTypeMapping(type);
-
-            return nested_types;
-        }
-
-        void InitializeNestedTypes()
-        {
-            if (metadata.NestedTypes != null)
-                return;
-
-            var length = MoveTo(Table.NestedClass);
-
-            metadata.NestedTypes = new Dictionary<uint, uint[]>(length);
-            metadata.ReverseNestedTypes = new Dictionary<uint, uint>(length);
-
-            if (length == 0)
-                return;
-
-            for (int i = 1; i <= length; i++)
-            {
-                var nested = ReadTableIndex(Table.TypeDef);
-                var declaring = ReadTableIndex(Table.TypeDef);
-
-                AddNestedMapping(declaring, nested);
-            }
-        }
-
-        void AddNestedMapping(uint declaring, uint nested)
-        {
-            metadata.SetNestedTypeMapping(declaring, AddMapping(metadata.NestedTypes, declaring, nested));
-            metadata.SetReverseNestedTypeMapping(nested, declaring);
-        }
-
-        static TValue[] AddMapping<TKey, TValue>(Dictionary<TKey, TValue[]> cache, TKey key, TValue value)
-        {
-            TValue[] mapped;
-            if (!cache.TryGetValue(key, out mapped))
-            {
-                mapped = new[] { value };
-                return mapped;
-            }
-
-            var new_mapped = new TValue[mapped.Length + 1];
-            Array.Copy(mapped, new_mapped, mapped.Length);
-            new_mapped[mapped.Length] = value;
-            return new_mapped;
-        }
-
-        TypeDefinition ReadType(uint rid)
-        {
-            if (!MoveTo(Table.TypeDef, rid))
-                return null;
-
-            var attributes = (TypeAttributes)ReadUInt32();
-            var name = ReadString();
-            var @namespace = ReadString();
-            var type = new TypeDefinition(@namespace, name, attributes);
-            type.token = new MetadataToken(TokenType.TypeDef, rid);
-            type.scope = module;
-            type.module = module;
-
-            metadata.AddTypeDefinition(type);
-
-            this.context = type;
-
-            type.BaseType = GetTypeDefOrRef(ReadMetadataToken(CodedIndex.TypeDefOrRef));
-
-            type.fields_range = ReadFieldsRange(rid);
-            type.methods_range = ReadMethodsRange(rid);
-
-            if (IsNested(attributes))
-                type.DeclaringType = GetNestedTypeDeclaringType(type);
-
-            return type;
-        }
-
-        TypeDefinition GetNestedTypeDeclaringType(TypeDefinition type)
-        {
-            uint declaring_rid;
-            if (!metadata.TryGetReverseNestedTypeMapping(type, out declaring_rid))
-                return null;
-
-            metadata.RemoveReverseNestedTypeMapping(type);
-            return GetTypeDefinition(declaring_rid);
-        }
-
-        Range ReadFieldsRange(uint type_index)
-        {
-            return ReadListRange(type_index, Table.TypeDef, Table.Field);
-        }
-
-        Range ReadMethodsRange(uint type_index)
-        {
-            return ReadListRange(type_index, Table.TypeDef, Table.Method);
-        }
-
-        Range ReadListRange(uint current_index, Table current, Table target)
-        {
-            var list = new Range();
-
-            list.Start = ReadTableIndex(target);
-
-            uint next_index;
-            var current_table = image.TableHeap[current];
-
-            if (current_index == current_table.Length)
-                next_index = image.TableHeap[target].Length + 1;
-            else
-            {
-                var position = Position;
-                Position += (uint)(current_table.RowSize - image.GetTableIndexSize(target));
-                next_index = ReadTableIndex(target);
-                Position = position;
-            }
-
-            list.Length = next_index - list.Start;
-
-            return list;
-        }
-
-        public Row<short, int> ReadTypeLayout(TypeDefinition type)
-        {
-            InitializeTypeLayouts();
-            Row<ushort, uint> class_layout;
-            var rid = type.token.RID;
-            if (!metadata.ClassLayouts.TryGetValue(rid, out class_layout))
-                return new Row<short, int>(Mixin.NoDataMarker, Mixin.NoDataMarker);
-
-            type.PackingSize = (short)class_layout.Col1;
-            type.ClassSize = (int)class_layout.Col2;
-
-            metadata.ClassLayouts.Remove(rid);
-
-            return new Row<short, int>((short)class_layout.Col1, (int)class_layout.Col2);
-        }
-
-        void InitializeTypeLayouts()
-        {
-            if (metadata.ClassLayouts != null)
-                return;
-
-            int length = MoveTo(Table.ClassLayout);
-
-            var class_layouts = metadata.ClassLayouts = new Dictionary<uint, Row<ushort, uint>>(length);
-
-            for (uint i = 0; i < length; i++)
-            {
-                var packing_size = ReadUInt16();
-                var class_size = ReadUInt32();
-
-                var parent = ReadTableIndex(Table.TypeDef);
-
-                class_layouts.Add(parent, new Row<ushort, uint>(packing_size, class_size));
-            }
-        }
-
-        public TypeReference GetTypeDefOrRef(MetadataToken token)
-        {
-            return (TypeReference)LookupToken(token);
-        }
-
-        public TypeDefinition GetTypeDefinition(uint rid)
-        {
-            InitializeTypeDefinitions();
-
-            var type = metadata.GetTypeDefinition(rid);
-            if (type != null)
-                return type;
-
-            return ReadTypeDefinition(rid);
-        }
-
-        TypeDefinition ReadTypeDefinition(uint rid)
-        {
-            if (!MoveTo(Table.TypeDef, rid))
-                return null;
-
-            return ReadType(rid);
-        }
-
-        void InitializeTypeReferences()
-        {
-            if (metadata.TypeReferences != null)
-                return;
-
-            metadata.TypeReferences = new TypeReference[image.GetTableLength(Table.TypeRef)];
-        }
-
-        public TypeReference GetTypeReference(string scope, string full_name)
-        {
-            InitializeTypeReferences();
-
-            var length = metadata.TypeReferences.Length;
-
-            for (uint i = 1; i <= length; i++)
-            {
-                var type = GetTypeReference(i);
-
-                if (type.FullName != full_name)
-                    continue;
-
-                if (string.IsNullOrEmpty(scope))
-                    return type;
-
-                if (type.Scope.Name == scope)
-                    return type;
-            }
-
-            return null;
-        }
-
-        TypeReference GetTypeReference(uint rid)
-        {
-            InitializeTypeReferences();
-
-            var type = metadata.GetTypeReference(rid);
-            if (type != null)
-                return type;
-
-            return ReadTypeReference(rid);
-        }
-
-        TypeReference ReadTypeReference(uint rid)
-        {
-            if (!MoveTo(Table.TypeRef, rid))
-                return null;
-
-            TypeReference declaring_type = null;
-            IMetadataScope scope;
-
-            var scope_token = ReadMetadataToken(CodedIndex.ResolutionScope);
-
-            var name = ReadString();
-            var @namespace = ReadString();
-
-            var type = new TypeReference(
-                @namespace,
-                name,
-                module,
-                null);
-
-            type.token = new MetadataToken(TokenType.TypeRef, rid);
-
-            metadata.AddTypeReference(type);
-
-            if (scope_token.TokenType == TokenType.TypeRef)
-            {
-                declaring_type = GetTypeDefOrRef(scope_token);
-
-                scope = declaring_type != null
-                    ? declaring_type.Scope
-                    : module;
-            }
-            else
-                scope = GetTypeReferenceScope(scope_token);
-
-            type.scope = scope;
-            type.DeclaringType = declaring_type;
-
-            MetadataSystem.TryProcessPrimitiveTypeReference(type);
-
-            return type;
-        }
-
-        IMetadataScope GetTypeReferenceScope(MetadataToken scope)
-        {
-            switch (scope.TokenType)
-            {
-                case TokenType.AssemblyRef:
-                    InitializeAssemblyReferences();
-                    return metadata.AssemblyReferences[(int)scope.RID - 1];
-                case TokenType.ModuleRef:
-                    InitializeModuleReferences();
-                    return metadata.ModuleReferences[(int)scope.RID - 1];
-                case TokenType.Module:
-                    return module;
-                default:
-                    throw new NotSupportedException();
-            }
-        }
-
-        public IEnumerable<TypeReference> GetTypeReferences()
-        {
-            InitializeTypeReferences();
-
-            var length = image.GetTableLength(Table.TypeRef);
-
-            var type_references = new TypeReference[length];
-
-            for (uint i = 1; i <= length; i++)
-                type_references[i - 1] = GetTypeReference(i);
-
-            return type_references;
-        }
-
-        TypeReference GetTypeSpecification(uint rid)
-        {
-            if (!MoveTo(Table.TypeSpec, rid))
-                return null;
-
-            var reader = ReadSignature(ReadBlobIndex());
-            var type = reader.ReadTypeSignature();
-            if (type.token.RID == 0)
-                type.token = new MetadataToken(TokenType.TypeSpec, rid);
-
-            return type;
-        }
-
-        SignatureReader ReadSignature(uint signature)
-        {
-            return new SignatureReader(signature, this);
-        }
-
-        public bool HasInterfaces(TypeDefinition type)
-        {
-            InitializeInterfaces();
-            MetadataToken[] mapping;
-
-            return metadata.TryGetInterfaceMapping(type, out mapping);
-        }
-
-        public Collection<TypeReference> ReadInterfaces(TypeDefinition type)
-        {
-            InitializeInterfaces();
-            MetadataToken[] mapping;
-
-            if (!metadata.TryGetInterfaceMapping(type, out mapping))
-                return new Collection<TypeReference>();
-
-            var interfaces = new Collection<TypeReference>(mapping.Length);
-
-            this.context = type;
-
-            for (int i = 0; i < mapping.Length; i++)
-                interfaces.Add(GetTypeDefOrRef(mapping[i]));
-
-            metadata.RemoveInterfaceMapping(type);
-
-            return interfaces;
-        }
-
-        void InitializeInterfaces()
-        {
-            if (metadata.Interfaces != null)
-                return;
-
-            int length = MoveTo(Table.InterfaceImpl);
-
-            metadata.Interfaces = new Dictionary<uint, MetadataToken[]>(length);
-
-            for (int i = 0; i < length; i++)
-            {
-                var type = ReadTableIndex(Table.TypeDef);
-                var @interface = ReadMetadataToken(CodedIndex.TypeDefOrRef);
-
-                AddInterfaceMapping(type, @interface);
-            }
-        }
-
-        void AddInterfaceMapping(uint type, MetadataToken @interface)
-        {
-            metadata.SetInterfaceMapping(type, AddMapping(metadata.Interfaces, type, @interface));
-        }
-
-        public Collection<FieldDefinition> ReadFields(TypeDefinition type)
-        {
-            var fields_range = type.fields_range;
-            if (fields_range.Length == 0)
-                return new MemberDefinitionCollection<FieldDefinition>(type);
-
-            var fields = new MemberDefinitionCollection<FieldDefinition>(type, (int)fields_range.Length);
-            this.context = type;
-
-            if (!MoveTo(Table.FieldPtr, fields_range.Start))
-            {
-                if (!MoveTo(Table.Field, fields_range.Start))
-                    return fields;
-
-                for (uint i = 0; i < fields_range.Length; i++)
-                    ReadField(fields_range.Start + i, fields);
-            }
-            else
-                ReadPointers(Table.FieldPtr, Table.Field, fields_range, fields, ReadField);
-
-            return fields;
-        }
-
-        void ReadField(uint field_rid, Collection<FieldDefinition> fields)
-        {
-            var attributes = (FieldAttributes)ReadUInt16();
-            var name = ReadString();
-            var signature = ReadBlobIndex();
-
-            var field = new FieldDefinition(name, attributes, ReadFieldType(signature));
-            field.token = new MetadataToken(TokenType.Field, field_rid);
-            metadata.AddFieldDefinition(field);
-
-            if (IsDeleted(field))
-                return;
-
-            fields.Add(field);
-        }
-
-        void InitializeFields()
-        {
-            if (metadata.Fields != null)
-                return;
-
-            metadata.Fields = new FieldDefinition[image.GetTableLength(Table.Field)];
-        }
-
-        TypeReference ReadFieldType(uint signature)
-        {
-            var reader = ReadSignature(signature);
-
-            const byte field_sig = 0x6;
-
-            if (reader.ReadByte() != field_sig)
-                throw new NotSupportedException();
-
-            return reader.ReadTypeSignature();
-        }
-
-        public int ReadFieldRVA(FieldDefinition field)
-        {
-            InitializeFieldRVAs();
-            var rid = field.token.RID;
-
-            RVA rva;
-            if (!metadata.FieldRVAs.TryGetValue(rid, out rva))
-                return 0;
-
-            var size = GetFieldTypeSize(field.FieldType);
-
-            if (size == 0 || rva == 0)
-                return 0;
-
-            metadata.FieldRVAs.Remove(rid);
-
-            field.InitialValue = GetFieldInitializeValue(size, rva);
-
-            return (int)rva;
-        }
-
-        byte[] GetFieldInitializeValue(int size, RVA rva)
-        {
-            var section = image.GetSectionAtVirtualAddress(rva);
-            if (section == null)
-                return Empty<byte>.Array;
-
-            var value = new byte[size];
-            Buffer.BlockCopy(section.Data, (int)(rva - section.VirtualAddress), value, 0, size);
-            return value;
-        }
-
-        static int GetFieldTypeSize(TypeReference type)
-        {
-            int size = 0;
-
-            switch (type.etype)
-            {
-                case ElementType.Boolean:
-                case ElementType.U1:
-                case ElementType.I1:
-                    size = 1;
-                    break;
-                case ElementType.U2:
-                case ElementType.I2:
-                case ElementType.Char:
-                    size = 2;
-                    break;
-                case ElementType.U4:
-                case ElementType.I4:
-                case ElementType.R4:
-                    size = 4;
-                    break;
-                case ElementType.U8:
-                case ElementType.I8:
-                case ElementType.R8:
-                    size = 8;
-                    break;
-                case ElementType.Ptr:
-                case ElementType.FnPtr:
-                    size = IntPtr.Size;
-                    break;
-                case ElementType.CModOpt:
-                case ElementType.CModReqD:
-                    return GetFieldTypeSize(((IModifierType)type).ElementType);
-                default:
-                    var field_type = Mixin.CheckedResolve(type);
-                    if (field_type.HasLayoutInfo)
-                        size = field_type.ClassSize;
-
-                    break;
-            }
-
-            return size;
-        }
-
-        void InitializeFieldRVAs()
-        {
-            if (metadata.FieldRVAs != null)
-                return;
-
-            int length = MoveTo(Table.FieldRVA);
-
-            var field_rvas = metadata.FieldRVAs = new Dictionary<uint, uint>(length);
-
-            for (int i = 0; i < length; i++)
-            {
-                var rva = ReadUInt32();
-                var field = ReadTableIndex(Table.Field);
-
-                field_rvas.Add(field, rva);
-            }
-        }
-
-        public int ReadFieldLayout(FieldDefinition field)
-        {
-            InitializeFieldLayouts();
-            var rid = field.token.RID;
-            uint offset;
-            if (!metadata.FieldLayouts.TryGetValue(rid, out offset))
-                return Mixin.NoDataMarker;
-
-            metadata.FieldLayouts.Remove(rid);
-
-            return (int)offset;
-        }
-
-        void InitializeFieldLayouts()
-        {
-            if (metadata.FieldLayouts != null)
-                return;
-
-            int length = MoveTo(Table.FieldLayout);
-
-            var field_layouts = metadata.FieldLayouts = new Dictionary<uint, uint>(length);
-
-            for (int i = 0; i < length; i++)
-            {
-                var offset = ReadUInt32();
-                var field = ReadTableIndex(Table.Field);
-
-                field_layouts.Add(field, offset);
-            }
-        }
-
-        public bool HasEvents(TypeDefinition type)
-        {
-            InitializeEvents();
-
-            Range range;
-            if (!metadata.TryGetEventsRange(type, out range))
-                return false;
-
-            return range.Length > 0;
-        }
-
-        public Collection<EventDefinition> ReadEvents(TypeDefinition type)
-        {
-            InitializeEvents();
-            Range range;
-
-            if (!metadata.TryGetEventsRange(type, out range))
-                return new MemberDefinitionCollection<EventDefinition>(type);
-
-            var events = new MemberDefinitionCollection<EventDefinition>(type, (int)range.Length);
-
-            metadata.RemoveEventsRange(type);
-
-            if (range.Length == 0)
-                return events;
-
-            this.context = type;
-
-            if (!MoveTo(Table.EventPtr, range.Start))
-            {
-                if (!MoveTo(Table.Event, range.Start))
-                    return events;
-
-                for (uint i = 0; i < range.Length; i++)
-                    ReadEvent(range.Start + i, events);
-            }
-            else
-                ReadPointers(Table.EventPtr, Table.Event, range, events, ReadEvent);
-
-            return events;
-        }
-
-        void ReadEvent(uint event_rid, Collection<EventDefinition> events)
-        {
-            var attributes = (EventAttributes)ReadUInt16();
-            var name = ReadString();
-            var event_type = GetTypeDefOrRef(ReadMetadataToken(CodedIndex.TypeDefOrRef));
-
-            var @event = new EventDefinition(name, attributes, event_type);
-            @event.token = new MetadataToken(TokenType.Event, event_rid);
-
-            if (IsDeleted(@event))
-                return;
-
-            events.Add(@event);
-        }
-
-        void InitializeEvents()
-        {
-            if (metadata.Events != null)
-                return;
-
-            int length = MoveTo(Table.EventMap);
-
-            metadata.Events = new Dictionary<uint, Range>(length);
-
-            for (uint i = 1; i <= length; i++)
-            {
-                var type_rid = ReadTableIndex(Table.TypeDef);
-                Range events_range = ReadEventsRange(i);
-                metadata.AddEventsRange(type_rid, events_range);
-            }
-        }
-
-        Range ReadEventsRange(uint rid)
-        {
-            return ReadListRange(rid, Table.EventMap, Table.Event);
-        }
-
-        public bool HasProperties(TypeDefinition type)
-        {
-            InitializeProperties();
-
-            Range range;
-            if (!metadata.TryGetPropertiesRange(type, out range))
-                return false;
-
-            return range.Length > 0;
-        }
-
-        public Collection<PropertyDefinition> ReadProperties(TypeDefinition type)
-        {
-            InitializeProperties();
-
-            Range range;
-
-            if (!metadata.TryGetPropertiesRange(type, out range))
-                return new MemberDefinitionCollection<PropertyDefinition>(type);
-
-            metadata.RemovePropertiesRange(type);
-
-            var properties = new MemberDefinitionCollection<PropertyDefinition>(type, (int)range.Length);
-
-            if (range.Length == 0)
-                return properties;
-
-            this.context = type;
-
-            if (!MoveTo(Table.PropertyPtr, range.Start))
-            {
-                if (!MoveTo(Table.Property, range.Start))
-                    return properties;
-                for (uint i = 0; i < range.Length; i++)
-                    ReadProperty(range.Start + i, properties);
-            }
-            else
-                ReadPointers(Table.PropertyPtr, Table.Property, range, properties, ReadProperty);
-
-            return properties;
-        }
-
-        void ReadProperty(uint property_rid, Collection<PropertyDefinition> properties)
-        {
-            var attributes = (PropertyAttributes)ReadUInt16();
-            var name = ReadString();
-            var signature = ReadBlobIndex();
-
-            var reader = ReadSignature(signature);
-            const byte property_signature = 0x8;
-
-            var calling_convention = reader.ReadByte();
-
-            if ((calling_convention & property_signature) == 0)
-                throw new NotSupportedException();
-
-            var has_this = (calling_convention & 0x20) != 0;
-
-            reader.ReadCompressedUInt32(); // count
-
-            var property = new PropertyDefinition(name, attributes, reader.ReadTypeSignature());
-            property.HasThis = has_this;
-            property.token = new MetadataToken(TokenType.Property, property_rid);
-
-            if (IsDeleted(property))
-                return;
-
-            properties.Add(property);
-        }
-
-        void InitializeProperties()
-        {
-            if (metadata.Properties != null)
-                return;
-
-            int length = MoveTo(Table.PropertyMap);
-
-            metadata.Properties = new Dictionary<uint, Range>(length);
-
-            for (uint i = 1; i <= length; i++)
-            {
-                var type_rid = ReadTableIndex(Table.TypeDef);
-                var properties_range = ReadPropertiesRange(i);
-                metadata.AddPropertiesRange(type_rid, properties_range);
-            }
-        }
-
-        Range ReadPropertiesRange(uint rid)
-        {
-            return ReadListRange(rid, Table.PropertyMap, Table.Property);
-        }
-
-        MethodSemanticsAttributes ReadMethodSemantics(MethodDefinition method)
-        {
-            InitializeMethodSemantics();
-            Row<MethodSemanticsAttributes, MetadataToken> row;
-            if (!metadata.Semantics.TryGetValue(method.token.RID, out row))
-                return MethodSemanticsAttributes.None;
-
-            var type = method.DeclaringType;
-
-            switch (row.Col1)
-            {
-                case MethodSemanticsAttributes.AddOn:
-                    GetEvent(type, row.Col2).add_method = method;
-                    break;
-                case MethodSemanticsAttributes.Fire:
-                    GetEvent(type, row.Col2).invoke_method = method;
-                    break;
-                case MethodSemanticsAttributes.RemoveOn:
-                    GetEvent(type, row.Col2).remove_method = method;
-                    break;
-                case MethodSemanticsAttributes.Getter:
-                    GetProperty(type, row.Col2).get_method = method;
-                    break;
-                case MethodSemanticsAttributes.Setter:
-                    GetProperty(type, row.Col2).set_method = method;
-                    break;
-                case MethodSemanticsAttributes.Other:
-                    switch (row.Col2.TokenType)
-                    {
-                        case TokenType.Event:
-                            {
-                                var @event = GetEvent(type, row.Col2);
-                                if (@event.other_methods == null)
-                                    @event.other_methods = new Collection<MethodDefinition>();
-
-                                @event.other_methods.Add(method);
-                                break;
-                            }
-                        case TokenType.Property:
-                            {
-                                var property = GetProperty(type, row.Col2);
-                                if (property.other_methods == null)
-                                    property.other_methods = new Collection<MethodDefinition>();
-
-                                property.other_methods.Add(method);
-
-                                break;
-                            }
-                        default:
-                            throw new NotSupportedException();
-                    }
-                    break;
-                default:
-                    throw new NotSupportedException();
-            }
-
-            metadata.Semantics.Remove(method.token.RID);
-
-            return row.Col1;
-        }
-
-        static EventDefinition GetEvent(TypeDefinition type, MetadataToken token)
-        {
-            if (token.TokenType != TokenType.Event)
-                throw new ArgumentException();
-
-            return GetMember(type.Events, token);
-        }
-
-        static PropertyDefinition GetProperty(TypeDefinition type, MetadataToken token)
-        {
-            if (token.TokenType != TokenType.Property)
-                throw new ArgumentException();
-
-            return GetMember(type.Properties, token);
-        }
-
-        static TMember GetMember<TMember>(Collection<TMember> members, MetadataToken token) where TMember : IMemberDefinition
-        {
-            for (int i = 0; i < members.Count; i++)
-            {
-                var member = members[i];
-                if (member.MetadataToken == token)
-                    return member;
-            }
-
-            throw new ArgumentException();
-        }
-
-        void InitializeMethodSemantics()
-        {
-            if (metadata.Semantics != null)
-                return;
-
-            int length = MoveTo(Table.MethodSemantics);
-
-            var semantics = metadata.Semantics = new Dictionary<uint, Row<MethodSemanticsAttributes, MetadataToken>>(0);
-
-            for (uint i = 0; i < length; i++)
-            {
-                var attributes = (MethodSemanticsAttributes)ReadUInt16();
-                var method_rid = ReadTableIndex(Table.Method);
-                var association = ReadMetadataToken(CodedIndex.HasSemantics);
-
-                semantics[method_rid] = new Row<MethodSemanticsAttributes, MetadataToken>(attributes, association);
-            }
-        }
-
-        public PropertyDefinition ReadMethods(PropertyDefinition property)
-        {
-            ReadAllSemantics(property.DeclaringType);
-            return property;
-        }
-
-        public EventDefinition ReadMethods(EventDefinition @event)
-        {
-            ReadAllSemantics(@event.DeclaringType);
-            return @event;
-        }
-
-        public MethodSemanticsAttributes ReadAllSemantics(MethodDefinition method)
-        {
-            ReadAllSemantics(method.DeclaringType);
-
-            return method.SemanticsAttributes;
-        }
-
-        void ReadAllSemantics(TypeDefinition type)
-        {
-            var methods = type.Methods;
-            for (int i = 0; i < methods.Count; i++)
-            {
-                var method = methods[i];
-                if (method.sem_attrs_ready)
-                    continue;
-
-                method.sem_attrs = ReadMethodSemantics(method);
-                method.sem_attrs_ready = true;
-            }
-        }
-
-        Range ReadParametersRange(uint method_rid)
-        {
-            return ReadListRange(method_rid, Table.Method, Table.Param);
-        }
-
-        public Collection<MethodDefinition> ReadMethods(TypeDefinition type)
-        {
-            var methods_range = type.methods_range;
-            if (methods_range.Length == 0)
-                return new MemberDefinitionCollection<MethodDefinition>(type);
-
-            var methods = new MemberDefinitionCollection<MethodDefinition>(type, (int)methods_range.Length);
-            if (!MoveTo(Table.MethodPtr, methods_range.Start))
-            {
-                if (!MoveTo(Table.Method, methods_range.Start))
-                    return methods;
-
-                for (uint i = 0; i < methods_range.Length; i++)
-                    ReadMethod(methods_range.Start + i, methods);
-            }
-            else
-                ReadPointers(Table.MethodPtr, Table.Method, methods_range, methods, ReadMethod);
-
-            return methods;
-        }
-
-        void ReadPointers<TMember>(Table ptr, Table table, Range range, Collection<TMember> members, Action<uint, Collection<TMember>> reader)
-            where TMember : IMemberDefinition
-        {
-            for (uint i = 0; i < range.Length; i++)
-            {
-                MoveTo(ptr, range.Start + i);
-
-                var rid = ReadTableIndex(table);
-                MoveTo(table, rid);
-
-                reader(rid, members);
-            }
-        }
-
-        static bool IsDeleted(IMemberDefinition member)
-        {
-            return member.IsSpecialName && member.Name == "_Deleted";
-        }
-
-        void InitializeMethods()
-        {
-            if (metadata.Methods != null)
-                return;
-
-            metadata.Methods = new MethodDefinition[image.GetTableLength(Table.Method)];
-        }
-
-        void ReadMethod(uint method_rid, Collection<MethodDefinition> methods)
-        {
-            var method = new MethodDefinition();
-            method.rva = ReadUInt32();
-            method.ImplAttributes = (MethodImplAttributes)ReadUInt16();
-            method.Attributes = (MethodAttributes)ReadUInt16();
-            method.Name = ReadString();
-            method.token = new MetadataToken(TokenType.Method, method_rid);
-
-            if (IsDeleted(method))
-                return;
-
-            methods.Add(method); // attach method
-
-            var signature = ReadBlobIndex();
-            var param_range = ReadParametersRange(method_rid);
-
-            this.context = method;
-
-            ReadMethodSignature(signature, method);
-            metadata.AddMethodDefinition(method);
-
-            if (param_range.Length == 0)
-                return;
-
-            var position = base.position;
-            ReadParameters(method, param_range);
-            base.position = position;
-        }
-
-        void ReadParameters(MethodDefinition method, Range param_range)
-        {
-            if (!MoveTo(Table.ParamPtr, param_range.Start))
-            {
-                if (!MoveTo(Table.Param, param_range.Start))
-                    return;
-
-                for (uint i = 0; i < param_range.Length; i++)
-                    ReadParameter(param_range.Start + i, method);
-            }
-            else
-                ReadParameterPointers(method, param_range);
-        }
-
-        void ReadParameterPointers(MethodDefinition method, Range range)
-        {
-            for (uint i = 0; i < range.Length; i++)
-            {
-                MoveTo(Table.ParamPtr, range.Start + i);
-
-                var rid = ReadTableIndex(Table.Param);
-
-                MoveTo(Table.Param, rid);
-
-                ReadParameter(rid, method);
-            }
-        }
-
-        void ReadParameter(uint param_rid, MethodDefinition method)
-        {
-            var attributes = (ParameterAttributes)ReadUInt16();
-            var sequence = ReadUInt16();
-            var name = ReadString();
-
-            var parameter = sequence == 0
-                ? method.MethodReturnType.Parameter
-                : method.Parameters[sequence - 1];
-
-            parameter.token = new MetadataToken(TokenType.Param, param_rid);
-            parameter.Name = name;
-            parameter.Attributes = attributes;
-        }
-
-        void ReadMethodSignature(uint signature, IMethodSignature method)
-        {
-            var reader = ReadSignature(signature);
-            reader.ReadMethodSignature(method);
-        }
-
-        public PInvokeInfo ReadPInvokeInfo(MethodDefinition method)
-        {
-            InitializePInvokes();
-            Row<PInvokeAttributes, uint, uint> row;
-
-            var rid = method.token.RID;
-
-            if (!metadata.PInvokes.TryGetValue(rid, out row))
-                return null;
-
-            metadata.PInvokes.Remove(rid);
-
-            return new PInvokeInfo(
-                row.Col1,
-                image.StringHeap.Read(row.Col2),
-                module.ModuleReferences[(int)row.Col3 - 1]);
-        }
-
-        void InitializePInvokes()
-        {
-            if (metadata.PInvokes != null)
-                return;
-
-            int length = MoveTo(Table.ImplMap);
-
-            var pinvokes = metadata.PInvokes = new Dictionary<uint, Row<PInvokeAttributes, uint, uint>>(length);
-
-            for (int i = 1; i <= length; i++)
-            {
-                var attributes = (PInvokeAttributes)ReadUInt16();
-                var method = ReadMetadataToken(CodedIndex.MemberForwarded);
-                var name = ReadStringIndex();
-                var scope = ReadTableIndex(Table.File);
-
-                if (method.TokenType != TokenType.Method)
-                    continue;
-
-                pinvokes.Add(method.RID, new Row<PInvokeAttributes, uint, uint>(attributes, name, scope));
-            }
-        }
-
-        public bool HasGenericParameters(IGenericParameterProvider provider)
-        {
-            InitializeGenericParameters();
-
-            Range range;
-            if (!metadata.TryGetGenericParameterRange(provider, out range))
-                return false;
-
-            return range.Length > 0;
-        }
-
-        public Collection<GenericParameter> ReadGenericParameters(IGenericParameterProvider provider)
-        {
-            InitializeGenericParameters();
-
-            Range range;
-            if (!metadata.TryGetGenericParameterRange(provider, out range)
-                || !MoveTo(Table.GenericParam, range.Start))
-                return new GenericParameterCollection(provider);
-
-            metadata.RemoveGenericParameterRange(provider);
-
-            var generic_parameters = new GenericParameterCollection(provider, (int)range.Length);
-
-            for (uint i = 0; i < range.Length; i++)
-            {
-                ReadUInt16(); // index
-                var flags = (GenericParameterAttributes)ReadUInt16();
-                ReadMetadataToken(CodedIndex.TypeOrMethodDef);
-                var name = ReadString();
-
-                var parameter = new GenericParameter(name, provider);
-                parameter.token = new MetadataToken(TokenType.GenericParam, range.Start + i);
-                parameter.Attributes = flags;
-
-                generic_parameters.Add(parameter);
-            }
-
-            return generic_parameters;
-        }
-
-        void InitializeGenericParameters()
-        {
-            if (metadata.GenericParameters != null)
-                return;
-
-            metadata.GenericParameters = InitializeRanges(
-                Table.GenericParam, () =>
-                {
-                    Advance(4);
-                    var next = ReadMetadataToken(CodedIndex.TypeOrMethodDef);
-                    ReadStringIndex();
-                    return next;
-                });
-        }
-
-        Dictionary<MetadataToken, Range> InitializeRanges(Table table, Func<MetadataToken> get_next)
-        {
-            int length = MoveTo(table);
-            var ranges = new Dictionary<MetadataToken, Range>(length);
-
-            if (length == 0)
-                return ranges;
-
-            MetadataToken owner = MetadataToken.Zero;
-            Range range = new Range(1, 0);
-
-            for (uint i = 1; i <= length; i++)
-            {
-                var next = get_next();
-
-                if (i == 1)
-                {
-                    owner = next;
-                    range.Length++;
-                }
-                else if (next != owner)
-                {
-                    if (owner.RID != 0)
-                        ranges.Add(owner, range);
-                    range = new Range(i, 1);
-                    owner = next;
-                }
-                else
-                    range.Length++;
-            }
-
-            if (owner != MetadataToken.Zero && !ranges.ContainsKey(owner))
-                ranges.Add(owner, range);
-
-            return ranges;
-        }
-
-        public bool HasGenericConstraints(GenericParameter generic_parameter)
-        {
-            InitializeGenericConstraints();
-
-            MetadataToken[] mapping;
-            if (!metadata.TryGetGenericConstraintMapping(generic_parameter, out mapping))
-                return false;
-
-            return mapping.Length > 0;
-        }
-
-        public Collection<TypeReference> ReadGenericConstraints(GenericParameter generic_parameter)
-        {
-            InitializeGenericConstraints();
-
-            MetadataToken[] mapping;
-            if (!metadata.TryGetGenericConstraintMapping(generic_parameter, out mapping))
-                return new Collection<TypeReference>();
-
-            var constraints = new Collection<TypeReference>(mapping.Length);
-
-            this.context = (IGenericContext)generic_parameter.Owner;
-
-            for (int i = 0; i < mapping.Length; i++)
-                constraints.Add(GetTypeDefOrRef(mapping[i]));
-
-            metadata.RemoveGenericConstraintMapping(generic_parameter);
-
-            return constraints;
-        }
-
-        void InitializeGenericConstraints()
-        {
-            if (metadata.GenericConstraints != null)
-                return;
-
-            var length = MoveTo(Table.GenericParamConstraint);
-
-            metadata.GenericConstraints = new Dictionary<uint, MetadataToken[]>(length);
-
-            for (int i = 1; i <= length; i++)
-                AddGenericConstraintMapping(
-                    ReadTableIndex(Table.GenericParam),
-                    ReadMetadataToken(CodedIndex.TypeDefOrRef));
-        }
-
-        void AddGenericConstraintMapping(uint generic_parameter, MetadataToken constraint)
-        {
-            metadata.SetGenericConstraintMapping(
-                generic_parameter,
-                AddMapping(metadata.GenericConstraints, generic_parameter, constraint));
-        }
-
-        public bool HasOverrides(MethodDefinition method)
-        {
-            InitializeOverrides();
-            MetadataToken[] mapping;
-
-            if (!metadata.TryGetOverrideMapping(method, out mapping))
-                return false;
-
-            return mapping.Length > 0;
-        }
-
-        public Collection<MethodReference> ReadOverrides(MethodDefinition method)
-        {
-            InitializeOverrides();
-
-            MetadataToken[] mapping;
-            if (!metadata.TryGetOverrideMapping(method, out mapping))
-                return new Collection<MethodReference>();
-
-            var overrides = new Collection<MethodReference>(mapping.Length);
-
-            this.context = method;
-
-            for (int i = 0; i < mapping.Length; i++)
-                overrides.Add((MethodReference)LookupToken(mapping[i]));
-
-            metadata.RemoveOverrideMapping(method);
-
-            return overrides;
-        }
-
-        void InitializeOverrides()
-        {
-            if (metadata.Overrides != null)
-                return;
-
-            var length = MoveTo(Table.MethodImpl);
-
-            metadata.Overrides = new Dictionary<uint, MetadataToken[]>(length);
-
-            for (int i = 1; i <= length; i++)
-            {
-                ReadTableIndex(Table.TypeDef);
-
-                var method = ReadMetadataToken(CodedIndex.MethodDefOrRef);
-                if (method.TokenType != TokenType.Method)
-                    throw new NotSupportedException();
-
-                var @override = ReadMetadataToken(CodedIndex.MethodDefOrRef);
-
-                AddOverrideMapping(method.RID, @override);
-            }
-        }
-
-        void AddOverrideMapping(uint method_rid, MetadataToken @override)
-        {
-            metadata.SetOverrideMapping(
-                method_rid,
-                AddMapping(metadata.Overrides, method_rid, @override));
-        }
-
-        public MethodBody ReadMethodBody(MethodDefinition method)
-        {
-            return code.ReadMethodBody(method);
-        }
-
-        public CallSite ReadCallSite(MetadataToken token)
-        {
-            if (!MoveTo(Table.StandAloneSig, token.RID))
-                return null;
-
-            var signature = ReadBlobIndex();
-
-            var call_site = new CallSite();
-
-            ReadMethodSignature(signature, call_site);
-
-            call_site.MetadataToken = token;
-
-            return call_site;
-        }
-
-        public VariableDefinitionCollection ReadVariables(MetadataToken local_var_token)
-        {
-            if (!MoveTo(Table.StandAloneSig, local_var_token.RID))
-                return null;
-
-            var reader = ReadSignature(ReadBlobIndex());
-            const byte local_sig = 0x7;
-
-            if (reader.ReadByte() != local_sig)
-                throw new NotSupportedException();
-
-            var count = reader.ReadCompressedUInt32();
-            if (count == 0)
-                return null;
-
-            var variables = new VariableDefinitionCollection((int)count);
-
-            for (int i = 0; i < count; i++)
-                variables.Add(new VariableDefinition(reader.ReadTypeSignature()));
-
-            return variables;
-        }
-
-        public IMetadataTokenProvider LookupToken(MetadataToken token)
-        {
-            var rid = token.RID;
-
-            if (rid == 0)
-                return null;
-
-            IMetadataTokenProvider element;
-            var position = this.position;
-            var context = this.context;
-
-            switch (token.TokenType)
-            {
-                case TokenType.TypeDef:
-                    element = GetTypeDefinition(rid);
-                    break;
-                case TokenType.TypeRef:
-                    element = GetTypeReference(rid);
-                    break;
-                case TokenType.TypeSpec:
-                    element = GetTypeSpecification(rid);
-                    break;
-                case TokenType.Field:
-                    element = GetFieldDefinition(rid);
-                    break;
-                case TokenType.Method:
-                    element = GetMethodDefinition(rid);
-                    break;
-                case TokenType.MemberRef:
-                    element = GetMemberReference(rid);
-                    break;
-                case TokenType.MethodSpec:
-                    element = GetMethodSpecification(rid);
-                    break;
-                default:
-                    return null;
-            }
-
-            this.position = position;
-            this.context = context;
-
-            return element;
-        }
-
-        public FieldDefinition GetFieldDefinition(uint rid)
-        {
-            InitializeTypeDefinitions();
-
-            var field = metadata.GetFieldDefinition(rid);
-            if (field != null)
-                return field;
-
-            return LookupField(rid);
-        }
-
-        FieldDefinition LookupField(uint rid)
-        {
-            var type = metadata.GetFieldDeclaringType(rid);
-            if (type == null)
-                return null;
-
-            InitializeCollection(type.Fields);
-
-            return metadata.GetFieldDefinition(rid);
-        }
-
-        public MethodDefinition GetMethodDefinition(uint rid)
-        {
-            InitializeTypeDefinitions();
-
-            var method = metadata.GetMethodDefinition(rid);
-            if (method != null)
-                return method;
-
-            return LookupMethod(rid);
-        }
-
-        MethodDefinition LookupMethod(uint rid)
-        {
-            var type = metadata.GetMethodDeclaringType(rid);
-            if (type == null)
-                return null;
-
-            InitializeCollection(type.Methods);
-
-            return metadata.GetMethodDefinition(rid);
-        }
-
-        MethodSpecification GetMethodSpecification(uint rid)
-        {
-            if (!MoveTo(Table.MethodSpec, rid))
-                return null;
-
-            var element_method = (MethodReference)LookupToken(
-                ReadMetadataToken(CodedIndex.MethodDefOrRef));
-            var signature = ReadBlobIndex();
-
-            var method_spec = ReadMethodSpecSignature(signature, element_method);
-            method_spec.token = new MetadataToken(TokenType.MethodSpec, rid);
-            return method_spec;
-        }
-
-        MethodSpecification ReadMethodSpecSignature(uint signature, MethodReference method)
-        {
-            var reader = ReadSignature(signature);
-            const byte methodspec_sig = 0x0a;
-
-            var call_conv = reader.ReadByte();
-
-            if (call_conv != methodspec_sig)
-                throw new NotSupportedException();
-
-            var instance = new GenericInstanceMethod(method);
-
-            reader.ReadGenericInstanceSignature(method, instance);
-
-            return instance;
-        }
-
-        MemberReference GetMemberReference(uint rid)
-        {
-            InitializeMemberReferences();
-
-            var member = metadata.GetMemberReference(rid);
-            if (member != null)
-                return member;
-
-            member = ReadMemberReference(rid);
-            if (member != null && !member.ContainsGenericParameter)
-                metadata.AddMemberReference(member);
-            return member;
-        }
-
-        MemberReference ReadMemberReference(uint rid)
-        {
-            if (!MoveTo(Table.MemberRef, rid))
-                return null;
-
-            var token = ReadMetadataToken(CodedIndex.MemberRefParent);
-            var name = ReadString();
-            var signature = ReadBlobIndex();
-
-            MemberReference member;
-
-            switch (token.TokenType)
-            {
-                case TokenType.TypeDef:
-                case TokenType.TypeRef:
-                case TokenType.TypeSpec:
-                    member = ReadTypeMemberReference(token, name, signature);
-                    break;
-                case TokenType.Method:
-                    member = ReadMethodMemberReference(token, name, signature);
-                    break;
-                default:
-                    throw new NotSupportedException();
-            }
-
-            member.token = new MetadataToken(TokenType.MemberRef, rid);
-
-            return member;
-        }
-
-        MemberReference ReadTypeMemberReference(MetadataToken type, string name, uint signature)
-        {
-            var declaring_type = GetTypeDefOrRef(type);
-
-            if (!declaring_type.IsArray)
-                this.context = declaring_type;
-
-            var member = ReadMemberReferenceSignature(signature, declaring_type);
-            member.Name = name;
-
-            return member;
-        }
-
-        MemberReference ReadMemberReferenceSignature(uint signature, TypeReference declaring_type)
-        {
-            var reader = ReadSignature(signature);
-            const byte field_sig = 0x6;
-
-            if (reader.buffer[reader.position] == field_sig)
-            {
-                reader.position++;
-                var field = new FieldReference();
-                field.DeclaringType = declaring_type;
-                field.FieldType = reader.ReadTypeSignature();
-                return field;
-            }
-            else
-            {
-                var method = new MethodReference();
-                method.DeclaringType = declaring_type;
-                reader.ReadMethodSignature(method);
-                return method;
-            }
-        }
-
-        MemberReference ReadMethodMemberReference(MetadataToken token, string name, uint signature)
-        {
-            var method = GetMethodDefinition(token.RID);
-
-            this.context = method;
-
-            var member = ReadMemberReferenceSignature(signature, method.DeclaringType);
-            member.Name = name;
-
-            return member;
-        }
-
-        void InitializeMemberReferences()
-        {
-            if (metadata.MemberReferences != null)
-                return;
-
-            metadata.MemberReferences = new MemberReference[image.GetTableLength(Table.MemberRef)];
-        }
-
-        public IEnumerable<MemberReference> GetMemberReferences()
-        {
-            InitializeMemberReferences();
-
-            var length = image.GetTableLength(Table.MemberRef);
-
-            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.Corlib);
-
-            var member_references = new MemberReference[length];
-
-            for (uint i = 1; i <= length; i++)
-            {
-                this.context = context;
-                member_references[i - 1] = GetMemberReference(i);
-            }
-
-            return member_references;
-        }
-
-        void InitializeConstants()
-        {
-            if (metadata.Constants != null)
-                return;
-
-            var length = MoveTo(Table.Constant);
-
-            var constants = metadata.Constants = new Dictionary<MetadataToken, Row<ElementType, uint>>(length);
-
-            for (uint i = 1; i <= length; i++)
-            {
-                var type = (ElementType)ReadUInt16();
-                var owner = ReadMetadataToken(CodedIndex.HasConstant);
-                var signature = ReadBlobIndex();
-
-                constants.Add(owner, new Row<ElementType, uint>(type, signature));
-            }
-        }
-
-        public object ReadConstant(IConstantProvider owner)
-        {
-            InitializeConstants();
-
-            Row<ElementType, uint> row;
-            if (!metadata.Constants.TryGetValue(owner.MetadataToken, out row))
-                return Mixin.NoValue;
-
-            metadata.Constants.Remove(owner.MetadataToken);
-
-            switch (row.Col1)
-            {
-                case ElementType.Class:
-                case ElementType.Object:
-                    return null;
-                case ElementType.String:
-                    return ReadConstantString(ReadBlob(row.Col2));
-                default:
-                    return ReadConstantPrimitive(row.Col1, row.Col2);
-            }
-        }
-
-        static string ReadConstantString(byte[] blob)
-        {
-            var length = blob.Length;
-            if ((length & 1) == 1)
-                length--;
-
-            return Encoding.Unicode.GetString(blob, 0, length);
-        }
-
-        object ReadConstantPrimitive(ElementType type, uint signature)
-        {
-            var reader = ReadSignature(signature);
-            return reader.ReadConstantSignature(type);
-        }
-
-        void InitializeCustomAttributes()
-        {
-            if (metadata.CustomAttributes != null)
-                return;
-
-            metadata.CustomAttributes = InitializeRanges(
-                Table.CustomAttribute, () =>
-                {
-                    var next = ReadMetadataToken(CodedIndex.HasCustomAttribute);
-                    ReadMetadataToken(CodedIndex.CustomAttributeType);
-                    ReadBlobIndex();
-                    return next;
-                });
-        }
-
-        public bool HasCustomAttributes(ICustomAttributeProvider owner)
-        {
-            InitializeCustomAttributes();
-
-            Range range;
-            if (!metadata.TryGetCustomAttributeRange(owner, out range))
-                return false;
-
-            return range.Length > 0;
-        }
-
-        public Collection<CustomAttribute> ReadCustomAttributes(ICustomAttributeProvider owner)
-        {
-            InitializeCustomAttributes();
-
-            Range range;
-            if (!metadata.TryGetCustomAttributeRange(owner, out range)
-                || !MoveTo(Table.CustomAttribute, range.Start))
-                return new Collection<CustomAttribute>();
-
-            var custom_attributes = new Collection<CustomAttribute>((int)range.Length);
-
-            for (int i = 0; i < range.Length; i++)
-            {
-                ReadMetadataToken(CodedIndex.HasCustomAttribute);
-
-                var constructor = (MethodReference)LookupToken(
-                    ReadMetadataToken(CodedIndex.CustomAttributeType));
-
-                var signature = ReadBlobIndex();
-
-                custom_attributes.Add(new CustomAttribute(signature, constructor));
-            }
-
-            metadata.RemoveCustomAttributeRange(owner);
-
-            return custom_attributes;
-        }
-
-        public byte[] ReadCustomAttributeBlob(uint signature)
-        {
-            return ReadBlob(signature);
-        }
-
-        public void ReadCustomAttributeSignature(CustomAttribute attribute)
-        {
-            var reader = ReadSignature(attribute.signature);
-
-            if (!reader.CanReadMore())
-                return;
-
-            if (reader.ReadUInt16() != 0x0001)
-                throw new InvalidOperationException();
-
-            var constructor = attribute.Constructor;
-            if (constructor.HasParameters)
-                reader.ReadCustomAttributeConstructorArguments(attribute, constructor.Parameters);
-
-            if (!reader.CanReadMore())
-                return;
-
-            var named = reader.ReadUInt16();
-
-            if (named == 0)
-                return;
-
-            reader.ReadCustomAttributeNamedArguments(named, ref attribute.fields, ref attribute.properties);
-        }
-
-        void InitializeMarshalInfos()
-        {
-            if (metadata.FieldMarshals != null)
-                return;
-
-            var length = MoveTo(Table.FieldMarshal);
-
-            var marshals = metadata.FieldMarshals = new Dictionary<MetadataToken, uint>(length);
-
-            for (int i = 0; i < length; i++)
-            {
-                var token = ReadMetadataToken(CodedIndex.HasFieldMarshal);
-                var signature = ReadBlobIndex();
-                if (token.RID == 0)
-                    continue;
-
-                marshals.Add(token, signature);
-            }
-        }
-
-        public bool HasMarshalInfo(IMarshalInfoProvider owner)
-        {
-            InitializeMarshalInfos();
-
-            return metadata.FieldMarshals.ContainsKey(owner.MetadataToken);
-        }
-
-        public MarshalInfo ReadMarshalInfo(IMarshalInfoProvider owner)
-        {
-            InitializeMarshalInfos();
-
-            uint signature;
-            if (!metadata.FieldMarshals.TryGetValue(owner.MetadataToken, out signature))
-                return null;
-
-            var reader = ReadSignature(signature);
-
-            metadata.FieldMarshals.Remove(owner.MetadataToken);
-
-            return reader.ReadMarshalInfo();
-        }
-
-        void InitializeSecurityDeclarations()
-        {
-            if (metadata.SecurityDeclarations != null)
-                return;
-
-            metadata.SecurityDeclarations = InitializeRanges(
-                Table.DeclSecurity, () =>
-                {
-                    ReadUInt16();
-                    var next = ReadMetadataToken(CodedIndex.HasDeclSecurity);
-                    ReadBlobIndex();
-                    return next;
-                });
-        }
-
-        public bool HasSecurityDeclarations(ISecurityDeclarationProvider owner)
-        {
-            InitializeSecurityDeclarations();
-
-            Range range;
-            if (!metadata.TryGetSecurityDeclarationRange(owner, out range))
-                return false;
-
-            return range.Length > 0;
-        }
-
-        public Collection<SecurityDeclaration> ReadSecurityDeclarations(ISecurityDeclarationProvider owner)
-        {
-            InitializeSecurityDeclarations();
-
-            Range range;
-            if (!metadata.TryGetSecurityDeclarationRange(owner, out range)
-                || !MoveTo(Table.DeclSecurity, range.Start))
-                return new Collection<SecurityDeclaration>();
-
-            var security_declarations = new Collection<SecurityDeclaration>((int)range.Length);
-
-            for (int i = 0; i < range.Length; i++)
-            {
-                var action = (SecurityAction)ReadUInt16();
-                ReadMetadataToken(CodedIndex.HasDeclSecurity);
-                var signature = ReadBlobIndex();
-
-                security_declarations.Add(new SecurityDeclaration(action, signature, module));
-            }
-
-            metadata.RemoveSecurityDeclarationRange(owner);
-
-            return security_declarations;
-        }
-
-        public byte[] ReadSecurityDeclarationBlob(uint signature)
-        {
-            return ReadBlob(signature);
-        }
-
-        public void ReadSecurityDeclarationSignature(SecurityDeclaration declaration)
-        {
-            var signature = declaration.signature;
-            var reader = ReadSignature(signature);
-
-            if (reader.buffer[reader.position] != '.')
-            {
-                ReadXmlSecurityDeclaration(signature, declaration);
-                return;
-            }
-
-            reader.position++;
-            var count = reader.ReadCompressedUInt32();
-            var attributes = new Collection<SecurityAttribute>((int)count);
-
-            for (int i = 0; i < count; i++)
-                attributes.Add(reader.ReadSecurityAttribute());
-
-            declaration.security_attributes = attributes;
-        }
-
-        void ReadXmlSecurityDeclaration(uint signature, SecurityDeclaration declaration)
-        {
-            var blob = ReadBlob(signature);
-            var attributes = new Collection<SecurityAttribute>(1);
-
-            var attribute = new SecurityAttribute(
-                module.TypeSystem.LookupType("System.Security.Permissions", "PermissionSetAttribute"));
-
-            attribute.properties = new Collection<CustomAttributeNamedArgument>(1);
-            attribute.properties.Add(
-                new CustomAttributeNamedArgument(
-                    "XML",
-                    new CustomAttributeArgument(
-                        module.TypeSystem.String,
-                        Encoding.Unicode.GetString(blob, 0, blob.Length))));
-
-            attributes.Add(attribute);
-
-            declaration.security_attributes = attributes;
-        }
-
-        public Collection<ExportedType> ReadExportedTypes()
-        {
-            var length = MoveTo(Table.ExportedType);
-            if (length == 0)
-                return new Collection<ExportedType>();
-
-            var exported_types = new Collection<ExportedType>(length);
-
-            for (int i = 1; i <= length; i++)
-            {
-                var attributes = (TypeAttributes)ReadUInt32();
-                var identifier = ReadUInt32();
-                var name = ReadString();
-                var @namespace = ReadString();
-                var implementation = ReadMetadataToken(CodedIndex.Implementation);
-
-                ExportedType declaring_type = null;
-                IMetadataScope scope = null;
-
-                switch (implementation.TokenType)
-                {
-                    case TokenType.AssemblyRef:
-                    case TokenType.File:
-                        scope = GetExportedTypeScope(implementation);
-                        break;
-                    case TokenType.ExportedType:
-                        // FIXME: if the table is not properly sorted
-                        declaring_type = exported_types[(int)implementation.RID - 1];
-                        break;
-                }
-
-                var exported_type = new ExportedType(@namespace, name, module, scope)
-                {
-                    Attributes = attributes,
-                    Identifier = (int)identifier,
-                    DeclaringType = declaring_type,
-                };
-                exported_type.token = new MetadataToken(TokenType.ExportedType, i);
-
-                exported_types.Add(exported_type);
-            }
-
-            return exported_types;
-        }
-
-        IMetadataScope GetExportedTypeScope(MetadataToken token)
-        {
-            var position = this.position;
-            IMetadataScope scope;
-
-            switch (token.TokenType)
-            {
-                case TokenType.AssemblyRef:
-                    InitializeAssemblyReferences();
-                    scope = metadata.AssemblyReferences[(int)token.RID - 1];
-                    break;
-                case TokenType.File:
-                    InitializeModuleReferences();
-                    scope = GetModuleReferenceFromFile(token);
-                    break;
-                default:
-                    throw new NotSupportedException();
-            }
-
-            this.position = position;
-            return scope;
-        }
-
-        ModuleReference GetModuleReferenceFromFile(MetadataToken token)
-        {
-            if (!MoveTo(Table.File, token.RID))
-                return null;
-
-            ReadUInt32();
-            var file_name = ReadString();
-            var modules = module.ModuleReferences;
-
-            ModuleReference reference;
-            for (int i = 0; i < modules.Count; i++)
-            {
-                reference = modules[i];
-                if (reference.Name == file_name)
-                    return reference;
-            }
-
-            reference = new ModuleReference(file_name);
-            modules.Add(reference);
-            return reference;
-        }
-
-        static void InitializeCollection(object o)
-        {
-        }
-    }
-
-    sealed class SignatureReader : ByteBuffer
-    {
-
-        readonly MetadataReader reader;
-        readonly uint start, sig_length;
-
-        TypeSystem TypeSystem
-        {
-            get { return reader.module.TypeSystem; }
-        }
-
-        public SignatureReader(uint blob, MetadataReader reader)
-            : base(reader.buffer)
-        {
-            this.reader = reader;
-
-            MoveToBlob(blob);
-
-            this.sig_length = ReadCompressedUInt32();
-            this.start = (uint)position;
-        }
-
-        void MoveToBlob(uint blob)
-        {
-            position = (int)(reader.image.BlobHeap.Offset + blob);
-        }
-
-        MetadataToken ReadTypeTokenSignature()
-        {
-            return Mixin.GetMetadataToken(CodedIndex.TypeDefOrRef, ReadCompressedUInt32());
-        }
-
-        GenericParameter GetGenericParameter(GenericParameterType type, uint var)
-        {
-            var context = reader.context;
-            int index = (int)var;
-
-            if (context == null)
-                return GetUnboundGenericParameter(type, index);
-
-            IGenericParameterProvider provider;
-
-            switch (type)
-            {
-                case GenericParameterType.Type:
-                    provider = context.Type;
-                    break;
-                case GenericParameterType.Method:
-                    provider = context.Method;
-                    break;
-                default:
-                    throw new NotSupportedException();
-            }
-
-            if (!context.IsDefinition)
-                CheckGenericContext(provider, index);
-
-            if (index >= provider.GenericParameters.Count)
-                return GetUnboundGenericParameter(type, index);
-
-            return provider.GenericParameters[index];
-        }
-
-        GenericParameter GetUnboundGenericParameter(GenericParameterType type, int index)
-        {
-            return new GenericParameter(index, type, reader.module);
-        }
-
-        static void CheckGenericContext(IGenericParameterProvider owner, int index)
-        {
-            var owner_parameters = owner.GenericParameters;
-
-            for (int i = owner_parameters.Count; i <= index; i++)
-                owner_parameters.Add(new GenericParameter(owner));
-        }
-
-        public void ReadGenericInstanceSignature(IGenericParameterProvider provider, IGenericInstance instance)
-        {
-            var arity = ReadCompressedUInt32();
-
-            if (!provider.IsDefinition)
-                CheckGenericContext(provider, (int)arity - 1);
-
-            var instance_arguments = instance.GenericArguments;
-
-            for (int i = 0; i < arity; i++)
-                instance_arguments.Add(ReadTypeSignature());
-        }
-
-        ArrayType ReadArrayTypeSignature()
-        {
-            var array = new ArrayType(ReadTypeSignature());
-
-            var rank = ReadCompressedUInt32();
-
-            var sizes = new uint[ReadCompressedUInt32()];
-            for (int i = 0; i < sizes.Length; i++)
-                sizes[i] = ReadCompressedUInt32();
-
-            var low_bounds = new int[ReadCompressedUInt32()];
-            for (int i = 0; i < low_bounds.Length; i++)
-                low_bounds[i] = ReadCompressedInt32();
-
-            array.Dimensions.Clear();
-
-            for (int i = 0; i < rank; i++)
-            {
-                int? lower = null, upper = null;
-
-                if (i < low_bounds.Length)
-                    lower = low_bounds[i];
-
-                if (i < sizes.Length)
-                    upper = lower + (int)sizes[i] - 1;
-
-                array.Dimensions.Add(new ArrayDimension(lower, upper));
-            }
-
-            return array;
-        }
-
-        TypeReference GetTypeDefOrRef(MetadataToken token)
-        {
-            return reader.GetTypeDefOrRef(token);
-        }
-
-        public TypeReference ReadTypeSignature()
-        {
-            return ReadTypeSignature((ElementType)ReadByte());
-        }
-
-        TypeReference ReadTypeSignature(ElementType etype)
-        {
-            switch (etype)
-            {
-                case ElementType.ValueType:
-                    {
-                        var value_type = GetTypeDefOrRef(ReadTypeTokenSignature());
-                        value_type.IsValueType = true;
-                        return value_type;
-                    }
-                case ElementType.Class:
-                    return GetTypeDefOrRef(ReadTypeTokenSignature());
-                case ElementType.Ptr:
-                    return new PointerType(ReadTypeSignature());
-                case ElementType.FnPtr:
-                    {
-                        var fptr = new FunctionPointerType();
-                        ReadMethodSignature(fptr);
-                        return fptr;
-                    }
-                case ElementType.ByRef:
-                    return new ByReferenceType(ReadTypeSignature());
-                case ElementType.Pinned:
-                    return new PinnedType(ReadTypeSignature());
-                case ElementType.SzArray:
-                    return new ArrayType(ReadTypeSignature());
-                case ElementType.Array:
-                    return ReadArrayTypeSignature();
-                case ElementType.CModOpt:
-                    return new OptionalModifierType(
-                        GetTypeDefOrRef(ReadTypeTokenSignature()), ReadTypeSignature());
-                case ElementType.CModReqD:
-                    return new RequiredModifierType(
-                        GetTypeDefOrRef(ReadTypeTokenSignature()), ReadTypeSignature());
-                case ElementType.Sentinel:
-                    return new SentinelType(ReadTypeSignature());
-                case ElementType.Var:
-                    return GetGenericParameter(GenericParameterType.Type, ReadCompressedUInt32());
-                case ElementType.MVar:
-                    return GetGenericParameter(GenericParameterType.Method, ReadCompressedUInt32());
-                case ElementType.GenericInst:
-                    {
-                        var is_value_type = ReadByte() == (byte)ElementType.ValueType;
-                        var element_type = GetTypeDefOrRef(ReadTypeTokenSignature());
-                        var generic_instance = new GenericInstanceType(element_type);
-
-                        ReadGenericInstanceSignature(element_type, generic_instance);
-
-                        if (is_value_type)
-                        {
-                            generic_instance.IsValueType = true;
-                            element_type.GetElementType().IsValueType = true;
-                        }
-
-                        return generic_instance;
-                    }
-                case ElementType.Object: return TypeSystem.Object;
-                case ElementType.Void: return TypeSystem.Void;
-                case ElementType.TypedByRef: return TypeSystem.TypedReference;
-                case ElementType.I: return TypeSystem.IntPtr;
-                case ElementType.U: return TypeSystem.UIntPtr;
-                default: return GetPrimitiveType(etype);
-            }
-        }
-
-        public void ReadMethodSignature(IMethodSignature method)
-        {
-            var calling_convention = ReadByte();
-
-            const byte has_this = 0x20;
-            const byte explicit_this = 0x40;
-
-            if ((calling_convention & has_this) != 0)
-            {
-                method.HasThis = true;
-                calling_convention = (byte)(calling_convention & ~has_this);
-            }
-
-            if ((calling_convention & explicit_this) != 0)
-            {
-                method.ExplicitThis = true;
-                calling_convention = (byte)(calling_convention & ~explicit_this);
-            }
-
-            method.CallingConvention = (MethodCallingConvention)calling_convention;
-
-            var generic_context = method as MethodReference;
-            if (generic_context != null && !generic_context.DeclaringType.IsArray)
-                reader.context = generic_context;
-
-            if ((calling_convention & 0x10) != 0)
-            {
-                var arity = ReadCompressedUInt32();
-
-                if (generic_context != null && !generic_context.IsDefinition)
-                    CheckGenericContext(generic_context, (int)arity - 1);
-            }
-
-            var param_count = ReadCompressedUInt32();
-
-            method.MethodReturnType.ReturnType = ReadTypeSignature();
-
-            if (param_count == 0)
-                return;
-
-            Collection<ParameterDefinition> parameters;
-
-            var method_ref = method as MethodReference;
-            if (method_ref != null)
-                parameters = method_ref.parameters = new ParameterDefinitionCollection(method, (int)param_count);
-            else
-                parameters = method.Parameters;
-
-            for (int i = 0; i < param_count; i++)
-                parameters.Add(new ParameterDefinition(ReadTypeSignature()));
-        }
-
-        public object ReadConstantSignature(ElementType type)
-        {
-            return ReadPrimitiveValue(type);
-        }
-
-        public void ReadCustomAttributeConstructorArguments(CustomAttribute attribute, Collection<ParameterDefinition> parameters)
-        {
-            var count = parameters.Count;
-            if (count == 0)
-                return;
-
-            attribute.arguments = new Collection<CustomAttributeArgument>(count);
-
-            for (int i = 0; i < count; i++)
-                attribute.arguments.Add(
-                    ReadCustomAttributeFixedArgument(parameters[i].ParameterType));
-        }
-
-        CustomAttributeArgument ReadCustomAttributeFixedArgument(TypeReference type)
-        {
-            if (type.IsArray)
-                return ReadCustomAttributeFixedArrayArgument((ArrayType)type);
-
-            return ReadCustomAttributeElement(type);
-        }
-
-        public void ReadCustomAttributeNamedArguments(ushort count, ref Collection<CustomAttributeNamedArgument> fields, ref Collection<CustomAttributeNamedArgument> properties)
-        {
-            for (int i = 0; i < count; i++)
-                ReadCustomAttributeNamedArgument(ref fields, ref properties);
-        }
-
-        void ReadCustomAttributeNamedArgument(ref Collection<CustomAttributeNamedArgument> fields, ref Collection<CustomAttributeNamedArgument> properties)
-        {
-            var kind = ReadByte();
-            var type = ReadCustomAttributeFieldOrPropType();
-            var name = ReadUTF8String();
-
-            Collection<CustomAttributeNamedArgument> container;
-            switch (kind)
-            {
-                case 0x53:
-                    container = GetCustomAttributeNamedArgumentCollection(ref fields);
-                    break;
-                case 0x54:
-                    container = GetCustomAttributeNamedArgumentCollection(ref properties);
-                    break;
-                default:
-                    throw new NotSupportedException();
-            }
-
-            container.Add(new CustomAttributeNamedArgument(name, ReadCustomAttributeFixedArgument(type)));
-        }
-
-        static Collection<CustomAttributeNamedArgument> GetCustomAttributeNamedArgumentCollection(ref Collection<CustomAttributeNamedArgument> collection)
-        {
-            if (collection != null)
-                return collection;
-
-            return collection = new Collection<CustomAttributeNamedArgument>();
-        }
-
-        CustomAttributeArgument ReadCustomAttributeFixedArrayArgument(ArrayType type)
-        {
-            var length = ReadUInt32();
-
-            if (length == 0xffffffff)
-                return new CustomAttributeArgument(type, null);
-
-            if (length == 0)
-                return new CustomAttributeArgument(type, Empty<CustomAttributeArgument>.Array);
-
-            var arguments = new CustomAttributeArgument[length];
-            var element_type = type.ElementType;
-
-            for (int i = 0; i < length; i++)
-                arguments[i] = ReadCustomAttributeElement(element_type);
-
-            return new CustomAttributeArgument(type, arguments);
-        }
-
-        CustomAttributeArgument ReadCustomAttributeElement(TypeReference type)
-        {
-            if (type.IsArray)
-                return ReadCustomAttributeFixedArrayArgument((ArrayType)type);
-
-            return new CustomAttributeArgument(
-                type,
-                type.etype == ElementType.Object
-                    ? ReadCustomAttributeElement(ReadCustomAttributeFieldOrPropType())
-                    : ReadCustomAttributeElementValue(type));
-        }
-
-        object ReadCustomAttributeElementValue(TypeReference type)
-        {
-            var etype = type.etype;
-
-            switch (etype)
-            {
-                case ElementType.String:
-                    return ReadUTF8String();
-                case ElementType.None:
-                    if (Mixin.IsTypeOf(type,"System", "Type"))
-                        return ReadTypeReference();
-
-                    return ReadCustomAttributeEnum(type);
-                default:
-                    return ReadPrimitiveValue(etype);
-            }
-        }
-
-        object ReadPrimitiveValue(ElementType type)
-        {
-            switch (type)
-            {
-                case ElementType.Boolean:
-                    return ReadByte() == 1;
-                case ElementType.I1:
-                    return (sbyte)ReadByte();
-                case ElementType.U1:
-                    return ReadByte();
-                case ElementType.Char:
-                    return (char)ReadUInt16();
-                case ElementType.I2:
-                    return ReadInt16();
-                case ElementType.U2:
-                    return ReadUInt16();
-                case ElementType.I4:
-                    return ReadInt32();
-                case ElementType.U4:
-                    return ReadUInt32();
-                case ElementType.I8:
-                    return ReadInt64();
-                case ElementType.U8:
-                    return ReadUInt64();
-                case ElementType.R4:
-                    return ReadSingle();
-                case ElementType.R8:
-                    return ReadDouble();
-                default:
-                    throw new NotImplementedException(type.ToString());
-            }
-        }
-
-        TypeReference GetPrimitiveType(ElementType etype)
-        {
-            switch (etype)
-            {
-                case ElementType.Boolean:
-                    return TypeSystem.Boolean;
-                case ElementType.Char:
-                    return TypeSystem.Char;
-                case ElementType.I1:
-                    return TypeSystem.SByte;
-                case ElementType.U1:
-                    return TypeSystem.Byte;
-                case ElementType.I2:
-                    return TypeSystem.Int16;
-                case ElementType.U2:
-                    return TypeSystem.UInt16;
-                case ElementType.I4:
-                    return TypeSystem.Int32;
-                case ElementType.U4:
-                    return TypeSystem.UInt32;
-                case ElementType.I8:
-                    return TypeSystem.Int64;
-                case ElementType.U8:
-                    return TypeSystem.UInt64;
-                case ElementType.R4:
-                    return TypeSystem.Single;
-                case ElementType.R8:
-                    return TypeSystem.Double;
-                case ElementType.String:
-                    return TypeSystem.String;
-                default:
-                    throw new NotImplementedException(etype.ToString());
-            }
-        }
-
-        TypeReference ReadCustomAttributeFieldOrPropType()
-        {
-            var etype = (ElementType)ReadByte();
-
-            switch (etype)
-            {
-                case ElementType.Boxed:
-                    return TypeSystem.Object;
-                case ElementType.SzArray:
-                    return new ArrayType(ReadCustomAttributeFieldOrPropType());
-                case ElementType.Enum:
-                    return ReadTypeReference();
-                case ElementType.Type:
-                    return TypeSystem.LookupType("System", "Type");
-                default:
-                    return GetPrimitiveType(etype);
-            }
-        }
-
-        public TypeReference ReadTypeReference()
-        {
-            return TypeParser.ParseType(reader.module, ReadUTF8String());
-        }
-
-        object ReadCustomAttributeEnum(TypeReference enum_type)
-        {
-            try
-            {
-                TypeDefinition type = null;
-                type = Mixin.CheckedResolve(enum_type);
-                if (!type.IsEnum)
-                    throw new ArgumentException();
-                return ReadCustomAttributeElementValue(Mixin.GetEnumUnderlyingType(type));
-            }
-            catch
-            {
-                //Resolve failed
-                string name = enum_type.FullName + ", " + enum_type.scope.Name;
-                Type type = Type.GetType(name);
-                if (type == null || !type.IsEnum)
-                    return new ArgumentException();
-                var fields = type.GetFields(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public);
-                Type eType = null;
-                foreach(var i in fields)
-                {
-                    eType = i.FieldType;
-                    break;
-                }
-
-                object val;
-                if(eType == typeof(int))
-                {
-                    val = ReadPrimitiveValue(ElementType.I4);
-                }
-                else if (eType == typeof(long))
-                {
-                    val = ReadPrimitiveValue(ElementType.I8);
-                }
-                else if (eType == typeof(short))
-                {
-                    val = ReadPrimitiveValue(ElementType.I2);
-                }
-                else if (eType == typeof(byte))
-                {
-                    val = ReadPrimitiveValue(ElementType.U1);
-                }
-                else if (eType == typeof(uint))
-                {
-                    val = ReadPrimitiveValue(ElementType.U4);
-                }
-                else if (eType == typeof(ulong))
-                {
-                    val = ReadPrimitiveValue(ElementType.U8);
-                }
-                else if (eType == typeof(ushort))
-                {
-                    val = ReadPrimitiveValue(ElementType.U2);
-                }
-                else
-                {
-                    val = ReadPrimitiveValue(ElementType.Void);
-                }
-
-                return Enum.ToObject(type, val);
-            }
-            
-        }
-
-        public SecurityAttribute ReadSecurityAttribute()
-        {
-            var attribute = new SecurityAttribute(ReadTypeReference());
-
-            ReadCompressedUInt32();
-
-            ReadCustomAttributeNamedArguments(
-                (ushort)ReadCompressedUInt32(),
-                ref attribute.fields,
-                ref attribute.properties);
-
-            return attribute;
-        }
-
-        public MarshalInfo ReadMarshalInfo()
-        {
-            var native = ReadNativeType();
-            switch (native)
-            {
-                case NativeType.Array:
-                    {
-                        var array = new ArrayMarshalInfo();
-                        if (CanReadMore())
-                            array.element_type = ReadNativeType();
-                        if (CanReadMore())
-                            array.size_parameter_index = (int)ReadCompressedUInt32();
-                        if (CanReadMore())
-                            array.size = (int)ReadCompressedUInt32();
-                        if (CanReadMore())
-                            array.size_parameter_multiplier = (int)ReadCompressedUInt32();
-                        return array;
-                    }
-                case NativeType.SafeArray:
-                    {
-                        var array = new SafeArrayMarshalInfo();
-                        if (CanReadMore())
-                            array.element_type = ReadVariantType();
-                        return array;
-                    }
-                case NativeType.FixedArray:
-                    {
-                        var array = new FixedArrayMarshalInfo();
-                        if (CanReadMore())
-                            array.size = (int)ReadCompressedUInt32();
-                        if (CanReadMore())
-                            array.element_type = ReadNativeType();
-                        return array;
-                    }
-                case NativeType.FixedSysString:
-                    {
-                        var sys_string = new FixedSysStringMarshalInfo();
-                        if (CanReadMore())
-                            sys_string.size = (int)ReadCompressedUInt32();
-                        return sys_string;
-                    }
-                case NativeType.CustomMarshaler:
-                    {
-                        var marshaler = new CustomMarshalInfo();
-                        var guid_value = ReadUTF8String();
-                        marshaler.guid = !string.IsNullOrEmpty(guid_value) ? new Guid(guid_value) : Guid.Empty;
-                        marshaler.unmanaged_type = ReadUTF8String();
-                        marshaler.managed_type = ReadTypeReference();
-                        marshaler.cookie = ReadUTF8String();
-                        return marshaler;
-                    }
-                default:
-                    return new MarshalInfo(native);
-            }
-        }
-
-        NativeType ReadNativeType()
-        {
-            return (NativeType)ReadByte();
-        }
-
-        VariantType ReadVariantType()
-        {
-            return (VariantType)ReadByte();
-        }
-
-        string ReadUTF8String()
-        {
-            if (buffer[position] == 0xff)
-            {
-                position++;
-                return null;
-            }
-
-            var length = (int)ReadCompressedUInt32();
-            if (length == 0)
-                return string.Empty;
-
-            var @string = Encoding.UTF8.GetString(buffer, position,
-                buffer[position + length - 1] == 0 ? length - 1 : length);
-
-            position += length;
-            return @string;
-        }
-
-        public bool CanReadMore()
-        {
-            return position - start < sig_length;
-        }
-    }
-}

+ 0 - 47
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/AssemblyWriter.cs

@@ -1,47 +0,0 @@
-//
-// AssemblyWriter.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-
-using Mono.Collections.Generic;
-using Mono.Cecil.Cil;
-using Mono.Cecil.Metadata;
-using Mono.Cecil.PE;
-
-using RVA = System.UInt32;
-using RID = System.UInt32;
-using CodedRID = System.UInt32;
-using StringIndex = System.UInt32;
-using BlobIndex = System.UInt32;
-
-namespace Mono.Cecil {
-
-}

+ 0 - 172
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/BaseAssemblyResolver.cs

@@ -1,172 +0,0 @@
-//
-// BaseAssemblyResolver.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil {
-
-	public delegate AssemblyDefinition AssemblyResolveEventHandler (object sender, AssemblyNameReference reference);
-
-	public sealed class AssemblyResolveEventArgs : EventArgs {
-
-		readonly AssemblyNameReference reference;
-
-		public AssemblyNameReference AssemblyReference {
-			get { return reference; }
-		}
-
-		public AssemblyResolveEventArgs (AssemblyNameReference reference)
-		{
-			this.reference = reference;
-		}
-	}
-
-
-	public class AssemblyResolutionException : FileNotFoundException {
-
-		readonly AssemblyNameReference reference;
-
-		public AssemblyNameReference AssemblyReference {
-			get { return reference; }
-		}
-
-		public AssemblyResolutionException (AssemblyNameReference reference)
-			: base (string.Format ("Failed to resolve assembly: '{0}'", reference))
-		{
-			this.reference = reference;
-		}
-
-
-	}
-
-	public abstract class BaseAssemblyResolver : IAssemblyResolver {
-
-		static readonly bool on_mono = Type.GetType ("Mono.Runtime") != null;
-
-		readonly Collection<string> directories;
-
-
-
-		public void AddSearchDirectory (string directory)
-		{
-			directories.Add (directory);
-		}
-
-		public void RemoveSearchDirectory (string directory)
-		{
-			directories.Remove (directory);
-		}
-
-		public string [] GetSearchDirectories ()
-		{
-			var directories = new string [this.directories.size];
-			Array.Copy (this.directories.items, directories, directories.Length);
-			return directories;
-		}
-
-		public virtual AssemblyDefinition Resolve (string fullName)
-		{
-			return Resolve (fullName, new ReaderParameters ());
-		}
-
-		public virtual AssemblyDefinition Resolve (string fullName, ReaderParameters parameters)
-		{
-			if (fullName == null)
-				throw new ArgumentNullException ("fullName");
-
-			return Resolve (AssemblyNameReference.Parse (fullName), parameters);
-		}
-
-		public event AssemblyResolveEventHandler ResolveFailure;
-
-		protected BaseAssemblyResolver ()
-		{
-			directories = new Collection<string> (2) { ".", "bin" };
-		}
-
-		AssemblyDefinition GetAssembly (string file, ReaderParameters parameters)
-		{
-			if (parameters.AssemblyResolver == null)
-				parameters.AssemblyResolver = this;
-
-			return ModuleDefinition.ReadModule (file, parameters).Assembly;
-		}
-
-		public virtual AssemblyDefinition Resolve (AssemblyNameReference name)
-		{
-			return Resolve (name, new ReaderParameters ());
-		}
-
-		public virtual AssemblyDefinition Resolve (AssemblyNameReference name, ReaderParameters parameters)
-		{
-			if (name == null)
-				throw new ArgumentNullException ("name");
-            if (parameters == null)
-				parameters = new ReaderParameters ();
-
-			var assembly = SearchDirectory (name, directories, parameters);
-			if (assembly != null)
-				return assembly;
-
-
-
-			if (ResolveFailure != null) {
-				assembly = ResolveFailure (this, name);
-				if (assembly != null)
-					return assembly;
-			}
-
-			throw new AssemblyResolutionException (name);
-		}
-
-		AssemblyDefinition SearchDirectory (AssemblyNameReference name, IEnumerable<string> directories, ReaderParameters parameters)
-		{
-			var extensions = new [] { ".exe", ".dll" };
-			foreach (var directory in directories) {
-				foreach (var extension in extensions) {
-					string file = Path.Combine (directory, name.Name + extension);
-					if (File.Exists (file))
-						return GetAssembly (file, parameters);
-				}
-			}
-
-			return null;
-		}
-
-		static bool IsZero (Version version)
-		{
-			return version == null || (version.Major == 0 && version.Minor == 0 && version.Build == 0 && version.Revision == 0);
-		}
-
-	}
-}

+ 0 - 70
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/DefaultAssemblyResolver.cs

@@ -1,70 +0,0 @@
-//
-// DefaultAssemblyResolver.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-
-namespace Mono.Cecil {
-
-	public class DefaultAssemblyResolver : BaseAssemblyResolver {
-
-		readonly IDictionary<string, AssemblyDefinition> cache;
-
-		public DefaultAssemblyResolver ()
-		{
-			cache = new Dictionary<string, AssemblyDefinition> (StringComparer.Ordinal);
-		}
-
-		public override AssemblyDefinition Resolve (AssemblyNameReference name)
-		{
-			if (name == null)
-				throw new ArgumentNullException ("name");
-
-			AssemblyDefinition assembly;
-			if (cache.TryGetValue (name.FullName, out assembly))
-				return assembly;
-
-			assembly = base.Resolve (name);
-			cache [name.FullName] = assembly;
-
-			return assembly;
-		}
-
-		protected void RegisterAssembly (AssemblyDefinition assembly)
-		{
-			if (assembly == null)
-				throw new ArgumentNullException ("assembly");
-
-			var name = assembly.Name.FullName;
-			if (cache.ContainsKey (name))
-				return;
-
-			cache [name] = assembly;
-		}
-	}
-}

+ 0 - 105
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/EmbeddedResource.cs

@@ -1,105 +0,0 @@
-//
-// EmbeddedResource.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-namespace Mono.Cecil {
-
-	public sealed class EmbeddedResource : Resource {
-
-		readonly MetadataReader reader;
-
-		uint? offset;
-		byte [] data;
-		Stream stream;
-
-		public override ResourceType ResourceType {
-			get { return ResourceType.Embedded; }
-		}
-
-		public EmbeddedResource (string name, ManifestResourceAttributes attributes, byte [] data) :
-			base (name, attributes)
-		{
-			this.data = data;
-		}
-
-		public EmbeddedResource (string name, ManifestResourceAttributes attributes, Stream stream) :
-			base (name, attributes)
-		{
-			this.stream = stream;
-		}
-
-		internal EmbeddedResource (string name, ManifestResourceAttributes attributes, uint offset, MetadataReader reader)
-			: base (name, attributes)
-		{
-			this.offset = offset;
-			this.reader = reader;
-		}
-
-		public Stream GetResourceStream ()
-		{
-			if (stream != null)
-				return stream;
-
-			if (data != null)
-				return new MemoryStream (data);
-
-			if (offset.HasValue)
-				return reader.GetManagedResourceStream (offset.Value);
-
-			throw new InvalidOperationException ();
-		}
-
-		public byte [] GetResourceData ()
-		{
-			if (stream != null)
-				return ReadStream (stream);
-
-			if (data != null)
-				return data;
-
-			if (offset.HasValue)
-				return reader.GetManagedResourceStream (offset.Value).ToArray ();
-
-			throw new InvalidOperationException ();
-		}
-
-		static byte [] ReadStream (Stream stream)
-		{
-			var length = (int) stream.Length;
-			var data = new byte [length];
-			int offset = 0, read;
-
-			while ((read = stream.Read (data, offset, length - offset)) > 0)
-				offset += read;
-
-			return data;
-		}
-	}
-}

+ 0 - 39
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/EventAttributes.cs

@@ -1,39 +0,0 @@
-//
-// EventAttributes.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	[Flags]
-	public enum EventAttributes : ushort {
-		None			= 0x0000,
-		SpecialName		= 0x0200,	// Event is special
-		RTSpecialName	= 0x0400	 // CLI provides 'special' behavior, depending upon the name of the event
-	}
-}

+ 0 - 57
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/EventReference.cs

@@ -1,57 +0,0 @@
-//
-// EventReference.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	public abstract class EventReference : MemberReference {
-
-		TypeReference event_type;
-
-		public TypeReference EventType {
-			get { return event_type; }
-			set { event_type = value; }
-		}
-
-		public override string FullName {
-			get { return event_type.FullName + " " + MemberFullName (); }
-		}
-
-		protected EventReference (string name, TypeReference eventType)
-			: base (name)
-		{
-			if (eventType == null)
-				throw new ArgumentNullException ("eventType");
-
-			event_type = eventType;
-		}
-
-		public abstract EventDefinition Resolve ();
-	}
-}

+ 0 - 249
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ExportedType.cs

@@ -1,249 +0,0 @@
-//
-// ExportedType.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	public class ExportedType : IMetadataTokenProvider {
-
-		string @namespace;
-		string name;
-		uint attributes;
-		IMetadataScope scope;
-		ModuleDefinition module;
-		int identifier;
-		ExportedType declaring_type;
-		internal MetadataToken token;
-
-		public string Namespace {
-			get { return @namespace; }
-			set { @namespace = value; }
-		}
-
-		public string Name {
-			get { return name; }
-			set { name = value; }
-		}
-
-		public TypeAttributes Attributes {
-			get { return (TypeAttributes) attributes; }
-			set { attributes = (uint) value; }
-		}
-
-		public IMetadataScope Scope {
-			get {
-				if (declaring_type != null)
-					return declaring_type.Scope;
-
-				return scope;
-			}
-		}
-
-		public ExportedType DeclaringType {
-			get { return declaring_type; }
-			set { declaring_type = value; }
-		}
-
-		public MetadataToken MetadataToken {
-			get { return token; }
-			set { token = value; }
-		}
-
-		public int Identifier {
-			get { return identifier; }
-			set { identifier = value; }
-		}
-
-		#region TypeAttributes
-
-		public bool IsNotPublic {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NotPublic); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NotPublic, value); }
-		}
-
-		public bool IsPublic {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.Public); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.Public, value); }
-		}
-
-		public bool IsNestedPublic {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedPublic); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedPublic, value); }
-		}
-
-		public bool IsNestedPrivate {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedPrivate); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedPrivate, value); }
-		}
-
-		public bool IsNestedFamily {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedFamily); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedFamily, value); }
-		}
-
-		public bool IsNestedAssembly {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedAssembly); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedAssembly, value); }
-		}
-
-		public bool IsNestedFamilyAndAssembly {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedFamANDAssem); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedFamANDAssem, value); }
-		}
-
-		public bool IsNestedFamilyOrAssembly {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedFamORAssem); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.VisibilityMask, (uint) TypeAttributes.NestedFamORAssem, value); }
-		}
-
-		public bool IsAutoLayout {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.LayoutMask, (uint) TypeAttributes.AutoLayout); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.LayoutMask, (uint) TypeAttributes.AutoLayout, value); }
-		}
-
-		public bool IsSequentialLayout {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.LayoutMask, (uint) TypeAttributes.SequentialLayout); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.LayoutMask, (uint) TypeAttributes.SequentialLayout, value); }
-		}
-
-		public bool IsExplicitLayout {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.LayoutMask, (uint) TypeAttributes.ExplicitLayout); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.LayoutMask, (uint) TypeAttributes.ExplicitLayout, value); }
-		}
-
-		public bool IsClass {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.ClassSemanticMask, (uint) TypeAttributes.Class); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.ClassSemanticMask, (uint) TypeAttributes.Class, value); }
-		}
-
-		public bool IsInterface {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.ClassSemanticMask, (uint) TypeAttributes.Interface); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.ClassSemanticMask, (uint) TypeAttributes.Interface, value); }
-		}
-
-		public bool IsAbstract {
-			get { return Mixin.GetAttributes(attributes,(uint) TypeAttributes.Abstract); }
-			set { attributes =Mixin.SetAttributes(attributes,(uint) TypeAttributes.Abstract, value); }
-		}
-
-		public bool IsSealed {
-			get { return Mixin.GetAttributes(attributes,(uint) TypeAttributes.Sealed); }
-			set { attributes =Mixin.SetAttributes(attributes,(uint) TypeAttributes.Sealed, value); }
-		}
-
-		public bool IsSpecialName {
-			get { return Mixin.GetAttributes(attributes,(uint) TypeAttributes.SpecialName); }
-			set { attributes =Mixin.SetAttributes(attributes,(uint) TypeAttributes.SpecialName, value); }
-		}
-
-		public bool IsImport {
-			get { return Mixin.GetAttributes(attributes,(uint) TypeAttributes.Import); }
-			set { attributes =Mixin.SetAttributes(attributes,(uint) TypeAttributes.Import, value); }
-		}
-
-		public bool IsSerializable {
-			get { return Mixin.GetAttributes(attributes,(uint) TypeAttributes.Serializable); }
-			set { attributes =Mixin.SetAttributes(attributes,(uint) TypeAttributes.Serializable, value); }
-		}
-
-		public bool IsAnsiClass {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.StringFormatMask, (uint) TypeAttributes.AnsiClass); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.StringFormatMask, (uint) TypeAttributes.AnsiClass, value); }
-		}
-
-		public bool IsUnicodeClass {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.StringFormatMask, (uint) TypeAttributes.UnicodeClass); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.StringFormatMask, (uint) TypeAttributes.UnicodeClass, value); }
-		}
-
-		public bool IsAutoClass {
-			get { return Mixin.GetMaskedAttributes(attributes,(uint) TypeAttributes.StringFormatMask, (uint) TypeAttributes.AutoClass); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(uint) TypeAttributes.StringFormatMask, (uint) TypeAttributes.AutoClass, value); }
-		}
-
-		public bool IsBeforeFieldInit {
-			get { return Mixin.GetAttributes(attributes,(uint) TypeAttributes.BeforeFieldInit); }
-			set { attributes =Mixin.SetAttributes(attributes,(uint) TypeAttributes.BeforeFieldInit, value); }
-		}
-
-		public bool IsRuntimeSpecialName {
-			get { return Mixin.GetAttributes(attributes,(uint) TypeAttributes.RTSpecialName); }
-			set { attributes =Mixin.SetAttributes(attributes,(uint) TypeAttributes.RTSpecialName, value); }
-		}
-
-		public bool HasSecurity {
-			get { return Mixin.GetAttributes(attributes,(uint) TypeAttributes.HasSecurity); }
-			set { attributes =Mixin.SetAttributes(attributes,(uint) TypeAttributes.HasSecurity, value); }
-		}
-
-		#endregion
-
-		public bool IsForwarder {
-			get { return Mixin.GetAttributes(attributes,(uint) TypeAttributes.Forwarder); }
-			set { attributes =Mixin.SetAttributes(attributes,(uint) TypeAttributes.Forwarder, value); }
-		}
-
-		public string FullName {
-			get {
-				if (declaring_type != null)
-					return declaring_type.FullName + "/" + name;
-
-				if (string.IsNullOrEmpty (@namespace))
-					return name;
-
-				return @namespace + "." + name;
-			}
-		}
-
-		public ExportedType (string @namespace, string name, ModuleDefinition module, IMetadataScope scope)
-		{
-			this.@namespace = @namespace;
-			this.name = name;
-			this.scope = scope;
-			this.module = module;
-		}
-
-		public override string ToString ()
-		{
-			return FullName;
-		}
-
-		public TypeDefinition Resolve ()
-		{
-			return module.Resolve (CreateReference ());
-		}
-
-		internal TypeReference CreateReference ()
-		{
-			return new TypeReference (@namespace, name, module, scope) {
-				DeclaringType = declaring_type != null ? declaring_type.CreateReference () : null,
-			};
-		}
-	}
-}

+ 0 - 271
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/FieldDefinition.cs

@@ -1,271 +0,0 @@
-//
-// FieldDefinition.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil {
-
-	public sealed class FieldDefinition : FieldReference, IMemberDefinition, IConstantProvider, IMarshalInfoProvider {
-
-		ushort attributes;
-		Collection<CustomAttribute> custom_attributes;
-
-		int offset = Mixin.NotResolvedMarker;
-
-		internal int rva = Mixin.NotResolvedMarker;
-		byte [] initial_value;
-
-		object constant = Mixin.NotResolved;
-
-		MarshalInfo marshal_info;
-
-		void ResolveLayout ()
-		{
-			if (offset != Mixin.NotResolvedMarker)
-				return;
-
-			if (!HasImage) {
-				offset = Mixin.NoDataMarker;
-				return;
-			}
-
-			offset = Module.Read (this, (field, reader) => reader.ReadFieldLayout (field));
-		}
-
-		public bool HasLayoutInfo {
-			get {
-				if (offset >= 0)
-					return true;
-
-				ResolveLayout ();
-
-				return offset >= 0;
-			}
-		}
-
-		public int Offset {
-			get {
-				if (offset >= 0)
-					return offset;
-
-				ResolveLayout ();
-
-				return offset >= 0 ? offset : -1;
-			}
-			set { offset = value; }
-		}
-
-		void ResolveRVA ()
-		{
-			if (rva != Mixin.NotResolvedMarker)
-				return;
-
-			if (!HasImage)
-				return;
-
-			rva = Module.Read (this, (field, reader) => reader.ReadFieldRVA (field));
-		}
-
-		public int RVA {
-			get {
-				if (rva > 0)
-					return rva;
-
-				ResolveRVA ();
-
-				return rva > 0 ? rva : 0;
-			}
-		}
-
-		public byte [] InitialValue {
-			get {
-				if (initial_value != null)
-					return initial_value;
-
-				ResolveRVA ();
-
-				if (initial_value == null)
-					initial_value = Empty<byte>.Array;
-
-				return initial_value;
-			}
-			set { initial_value = value; }
-		}
-
-		public FieldAttributes Attributes {
-			get { return (FieldAttributes) attributes; }
-			set { attributes = (ushort) value; }
-		}
-
-		public bool HasConstant {
-			get {
-                Mixin.ResolveConstant(this, ref constant, Module);
-
-				return constant != Mixin.NoValue;
-			}
-			set { if (!value) constant = Mixin.NoValue; }
-		}
-
-		public object Constant {
-			get { return HasConstant ? constant : null;	}
-			set { constant = value; }
-		}
-
-		public bool HasCustomAttributes {
-			get {
-				if (custom_attributes != null)
-					return custom_attributes.Count > 0;
-
-                return Mixin.GetHasCustomAttributes(this, Module);
-			}
-		}
-
-		public Collection<CustomAttribute> CustomAttributes {
-            get { return custom_attributes ?? (Mixin.GetCustomAttributes(this, ref custom_attributes, Module)); }
-		}
-
-		public bool HasMarshalInfo {
-			get {
-				if (marshal_info != null)
-					return true;
-
-                return Mixin.GetHasMarshalInfo(this, Module);
-			}
-		}
-
-		public MarshalInfo MarshalInfo {
-            get { return marshal_info ?? (Mixin.GetMarshalInfo(this, ref marshal_info, Module)); }
-			set { marshal_info = value; }
-		}
-
-		#region FieldAttributes
-
-		public bool IsCompilerControlled {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.CompilerControlled); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.CompilerControlled, value); }
-		}
-
-		public bool IsPrivate {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.Private); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.Private, value); }
-		}
-
-		public bool IsFamilyAndAssembly {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.FamANDAssem); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.FamANDAssem, value); }
-		}
-
-		public bool IsAssembly {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.Assembly); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.Assembly, value); }
-		}
-
-		public bool IsFamily {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.Family); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.Family, value); }
-		}
-
-		public bool IsFamilyOrAssembly {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.FamORAssem); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.FamORAssem, value); }
-		}
-
-		public bool IsPublic {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.Public); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) FieldAttributes.FieldAccessMask, (ushort) FieldAttributes.Public, value); }
-		}
-
-		public bool IsStatic {
-			get { return Mixin.GetAttributes(attributes,(ushort) FieldAttributes.Static); }
-			set { attributes =Mixin.SetAttributes(attributes,(ushort) FieldAttributes.Static, value); }
-		}
-
-		public bool IsInitOnly {
-			get { return Mixin.GetAttributes(attributes,(ushort) FieldAttributes.InitOnly); }
-			set { attributes =Mixin.SetAttributes(attributes,(ushort) FieldAttributes.InitOnly, value); }
-		}
-
-		public bool IsLiteral {
-			get { return Mixin.GetAttributes(attributes,(ushort) FieldAttributes.Literal); }
-			set { attributes =Mixin.SetAttributes(attributes,(ushort) FieldAttributes.Literal, value); }
-		}
-
-		public bool IsNotSerialized {
-			get { return Mixin.GetAttributes(attributes,(ushort) FieldAttributes.NotSerialized); }
-			set { attributes =Mixin.SetAttributes(attributes,(ushort) FieldAttributes.NotSerialized, value); }
-		}
-
-		public bool IsSpecialName {
-			get { return Mixin.GetAttributes(attributes,(ushort) FieldAttributes.SpecialName); }
-			set { attributes =Mixin.SetAttributes(attributes,(ushort) FieldAttributes.SpecialName, value); }
-		}
-
-		public bool IsPInvokeImpl {
-			get { return Mixin.GetAttributes(attributes,(ushort) FieldAttributes.PInvokeImpl); }
-			set { attributes =Mixin.SetAttributes(attributes,(ushort) FieldAttributes.PInvokeImpl, value); }
-		}
-
-		public bool IsRuntimeSpecialName {
-			get { return Mixin.GetAttributes(attributes,(ushort) FieldAttributes.RTSpecialName); }
-			set { attributes =Mixin.SetAttributes(attributes,(ushort) FieldAttributes.RTSpecialName, value); }
-		}
-
-		public bool HasDefault {
-			get { return Mixin.GetAttributes(attributes,(ushort) FieldAttributes.HasDefault); }
-			set { attributes =Mixin.SetAttributes(attributes,(ushort) FieldAttributes.HasDefault, value); }
-		}
-
-		#endregion
-
-		public override bool IsDefinition {
-			get { return true; }
-		}
-
-		public new TypeDefinition DeclaringType {
-			get { return (TypeDefinition) base.DeclaringType; }
-			set { base.DeclaringType = value; }
-		}
-
-		public FieldDefinition (string name, FieldAttributes attributes, TypeReference fieldType)
-			: base (name, fieldType)
-		{
-			this.attributes = (ushort) attributes;
-		}
-
-		public override FieldDefinition Resolve ()
-		{
-			return this;
-		}
-	}
-
-	static partial class Mixin {
-
-		public const int NotResolvedMarker = -2;
-		public const int NoDataMarker = -1;
-	}
-}

+ 0 - 83
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/FieldReference.cs

@@ -1,83 +0,0 @@
-//
-// FieldReference.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	public class FieldReference : MemberReference {
-
-		TypeReference field_type;
-
-		public TypeReference FieldType {
-			get { return field_type; }
-			set { field_type = value; }
-		}
-
-		public override string FullName {
-			get { return field_type.FullName + " " + MemberFullName (); }
-		}
-
-		public override bool ContainsGenericParameter {
-			get { return field_type.ContainsGenericParameter || base.ContainsGenericParameter; }
-		}
-
-		internal FieldReference ()
-		{
-			this.token = new MetadataToken (TokenType.MemberRef);
-		}
-
-		public FieldReference (string name, TypeReference fieldType)
-			: base (name)
-		{
-			if (fieldType == null)
-				throw new ArgumentNullException ("fieldType");
-
-			this.field_type = fieldType;
-			this.token = new MetadataToken (TokenType.MemberRef);
-		}
-
-		public FieldReference (string name, TypeReference fieldType, TypeReference declaringType)
-			: this (name, fieldType)
-		{
-			if (declaringType == null)
-				throw new ArgumentNullException("declaringType");
-
-			this.DeclaringType = declaringType;
-		}
-
-		public virtual FieldDefinition Resolve ()
-		{
-			var module = this.Module;
-			if (module == null)
-				throw new NotSupportedException ();
-
-			return module.Resolve (this);
-		}
-	}
-}

+ 0 - 35
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/FileAttributes.cs

@@ -1,35 +0,0 @@
-//
-// FileAttributes.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-	enum FileAttributes : uint {
-		ContainsMetaData	= 0x0000,	// This is not a resource file
-		ContainsNoMetaData  = 0x0001,	// This is a resource file or other non-metadata-containing file
-	}
-}

+ 0 - 95
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/GenericInstanceMethod.cs

@@ -1,95 +0,0 @@
-//
-// GenericInstanceMethod.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil
-{
-
-    public sealed class GenericInstanceMethod : MethodSpecification, IGenericInstance, IGenericContext
-    {
-
-        Collection<TypeReference> arguments;
-
-        public bool HasGenericArguments
-        {
-            get { return !Mixin.IsNullOrEmpty(arguments); }
-        }
-
-        public Collection<TypeReference> GenericArguments
-        {
-            get { return arguments ?? (arguments = new Collection<TypeReference>()); }
-        }
-
-        public override bool IsGenericInstance
-        {
-            get { return true; }
-        }
-
-        IGenericParameterProvider IGenericContext.Method
-        {
-            get { return ElementMethod; }
-        }
-
-        IGenericParameterProvider IGenericContext.Type
-        {
-            get { return ElementMethod.DeclaringType; }
-        }
-
-        public override bool ContainsGenericParameter
-        {
-            get { return Mixin.ContainsGenericParameter(this) || base.ContainsGenericParameter; }
-        }
-
-        public override string FullName
-        {
-            get
-            {
-                var signature = new StringBuilder();
-                var method = this.ElementMethod;
-                signature.Append(method.ReturnType.FullName)
-                    .Append(" ")
-                    .Append(method.DeclaringType.FullName)
-                    .Append("::")
-                    .Append(method.Name);
-                Mixin.GenericInstanceFullName(this, signature);
-                Mixin.MethodSignatureFullName(this, signature);
-                return signature.ToString();
-
-            }
-        }
-
-        public GenericInstanceMethod(MethodReference method)
-            : base(method)
-        {
-        }
-    }
-}

+ 0 - 93
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/GenericInstanceType.cs

@@ -1,93 +0,0 @@
-//
-// GenericInstanceType.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-
-using Mono.Collections.Generic;
-
-using MD = Mono.Cecil.Metadata;
-
-namespace Mono.Cecil
-{
-
-    public sealed class GenericInstanceType : TypeSpecification, IGenericInstance, IGenericContext
-    {
-
-        Collection<TypeReference> arguments;
-
-        public bool HasGenericArguments
-        {
-            get { return !Mixin.IsNullOrEmpty(arguments); }
-        }
-
-        public Collection<TypeReference> GenericArguments
-        {
-            get { return arguments ?? (arguments = new Collection<TypeReference>()); }
-        }
-
-        public override TypeReference DeclaringType
-        {
-            get { return ElementType.DeclaringType; }
-            set { throw new NotSupportedException(); }
-        }
-
-        public override string FullName
-        {
-            get
-            {
-                var name = new StringBuilder();
-                name.Append(base.FullName);
-                Mixin.GenericInstanceFullName(this, name);
-                return name.ToString();
-            }
-        }
-
-        public override bool IsGenericInstance
-        {
-            get { return true; }
-        }
-
-        public override bool ContainsGenericParameter
-        {
-            get { return Mixin.ContainsGenericParameter(this) || base.ContainsGenericParameter; }
-        }
-
-        IGenericParameterProvider IGenericContext.Type
-        {
-            get { return ElementType; }
-        }
-
-        public GenericInstanceType(TypeReference type)
-            : base(type)
-        {
-            base.IsValueType = type.IsValueType;
-            this.etype = MD.ElementType.GenericInst;
-        }
-    }
-}

+ 0 - 45
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/GenericParameterAttributes.cs

@@ -1,45 +0,0 @@
-//
-// GenericParameterAttributes.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	[Flags]
-	public enum GenericParameterAttributes : ushort {
-		VarianceMask	= 0x0003,
-		NonVariant		= 0x0000,
-		Covariant		= 0x0001,
-		Contravariant	= 0x0002,
-
-		SpecialConstraintMask			= 0x001c,
-		ReferenceTypeConstraint			= 0x0004,
-		NotNullableValueTypeConstraint	= 0x0008,
-		DefaultConstructorConstraint	= 0x0010
-	}
-}

+ 0 - 57
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IConstantProvider.cs

@@ -1,57 +0,0 @@
-//
-// IConstantProvider.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-	public interface IConstantProvider : IMetadataTokenProvider {
-
-		bool HasConstant { get; set; }
-		object Constant { get; set; }
-	}
-
-	static partial class Mixin {
-
-		internal static object NoValue = new object ();
-		internal static object NotResolved = new object ();
-
-		public static void ResolveConstant (
-			IConstantProvider self,
-			ref object constant,
-			ModuleDefinition module)
-		{
-			lock (module.SyncRoot) {
-				if (constant != Mixin.NotResolved)
-					return;
-				if (Mixin.HasImage (module))
-					constant = module.Read (self, (provider, reader) => reader.ReadConstant (provider));
-				else
-					constant = Mixin.NoValue;
-			}
-		}
-	}
-}

+ 0 - 63
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ICustomAttributeProvider.cs

@@ -1,63 +0,0 @@
-//
-// ICustomAttributeProvider.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil
-{
-
-    public interface ICustomAttributeProvider : IMetadataTokenProvider
-    {
-
-        Collection<CustomAttribute> CustomAttributes { get; }
-
-        bool HasCustomAttributes { get; }
-    }
-
-    static partial class Mixin
-    {
-
-        public static bool GetHasCustomAttributes(
-            ICustomAttributeProvider self,
-            ModuleDefinition module)
-        {
-            return Mixin.HasImage(module) && module.Read(self, (provider, reader) => reader.HasCustomAttributes(provider));
-        }
-
-        public static Collection<CustomAttribute> GetCustomAttributes(
-            ICustomAttributeProvider self,
-            ref Collection<CustomAttribute> variable,
-            ModuleDefinition module)
-        {
-            return Mixin.HasImage(module)
-                ? module.Read(ref variable, self, (provider, reader) => reader.ReadCustomAttributes(provider))
-                : variable = new Collection<CustomAttribute>();
-        }
-    }
-}

+ 0 - 66
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IGenericInstance.cs

@@ -1,66 +0,0 @@
-//
-// IGenericInstance.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Text;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil {
-
-	public interface IGenericInstance : IMetadataTokenProvider {
-
-		bool HasGenericArguments { get; }
-		Collection<TypeReference> GenericArguments { get; }
-	}
-
-	static partial class Mixin {
-
-		public static bool ContainsGenericParameter (IGenericInstance self)
-		{
-			var arguments = self.GenericArguments;
-
-			for (int i = 0; i < arguments.Count; i++)
-				if (arguments [i].ContainsGenericParameter)
-					return true;
-
-			return false;
-		}
-
-		public static void GenericInstanceFullName (IGenericInstance self, StringBuilder builder)
-		{
-			builder.Append ("<");
-			var arguments = self.GenericArguments;
-			for (int i = 0; i < arguments.Count; i++) {
-				if (i > 0)
-					builder.Append (",");
-				builder.Append (arguments [i].FullName);
-			}
-			builder.Append (">");
-		}
-	}
-}

+ 0 - 79
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IGenericParameterProvider.cs

@@ -1,79 +0,0 @@
-//
-// IGenericParameterProvider.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil
-{
-
-    public interface IGenericParameterProvider : IMetadataTokenProvider
-    {
-
-        bool HasGenericParameters { get; }
-        bool IsDefinition { get; }
-        ModuleDefinition Module { get; }
-        Collection<GenericParameter> GenericParameters { get; }
-        GenericParameterType GenericParameterType { get; }
-    }
-
-    public enum GenericParameterType
-    {
-        Type,
-        Method
-    }
-
-    interface IGenericContext
-    {
-
-        bool IsDefinition { get; }
-        IGenericParameterProvider Type { get; }
-        IGenericParameterProvider Method { get; }
-    }
-
-    static partial class Mixin
-    {
-
-        public static bool GetHasGenericParameters(
-            IGenericParameterProvider self,
-            ModuleDefinition module)
-        {
-            return Mixin.HasImage(module) && module.Read(self, (provider, reader) => reader.HasGenericParameters(provider));
-        }
-
-        public static Collection<GenericParameter> GetGenericParameters(
-            IGenericParameterProvider self,
-            ref Collection<GenericParameter> collection,
-            ModuleDefinition module)
-        {
-            return Mixin.HasImage(module)
-                ? module.Read(ref collection, self, (provider, reader) => reader.ReadGenericParameters(provider))
-                : collection = new GenericParameterCollection(self);
-        }
-    }
-}

+ 0 - 59
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IMarshalInfoProvider.cs

@@ -1,59 +0,0 @@
-//
-// IMarshalInfoProvider.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil
-{
-
-    public interface IMarshalInfoProvider : IMetadataTokenProvider
-    {
-
-        bool HasMarshalInfo { get; }
-        MarshalInfo MarshalInfo { get; set; }
-    }
-
-    static partial class Mixin
-    {
-
-        public static bool GetHasMarshalInfo(
-            IMarshalInfoProvider self,
-            ModuleDefinition module)
-        {
-            return Mixin.HasImage(module) && module.Read(self, (provider, reader) => reader.HasMarshalInfo(provider));
-        }
-
-        public static MarshalInfo GetMarshalInfo(
-            IMarshalInfoProvider self,
-            ref MarshalInfo variable,
-            ModuleDefinition module)
-        {
-            return Mixin.HasImage(module)
-                ? module.Read(ref variable, self, (provider, reader) => reader.ReadMarshalInfo(provider))
-                : null;
-        }
-    }
-}

+ 0 - 105
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IMemberDefinition.cs

@@ -1,105 +0,0 @@
-//
-// IMemberDefinition.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil
-{
-
-    public interface IMemberDefinition : ICustomAttributeProvider
-    {
-
-        string Name { get; set; }
-        string FullName { get; }
-
-        bool IsSpecialName { get; set; }
-        bool IsRuntimeSpecialName { get; set; }
-
-        TypeDefinition DeclaringType { get; set; }
-    }
-
-    static partial class Mixin
-    {
-
-        public static bool GetAttributes(uint self, uint attributes)
-        {
-            return (self & attributes) != 0;
-        }
-
-        public static uint SetAttributes(uint self, uint attributes, bool value)
-        {
-            if (value)
-                return self | attributes;
-
-            return self & ~attributes;
-        }
-
-        public static bool GetMaskedAttributes(uint self, uint mask, uint attributes)
-        {
-            return (self & mask) == attributes;
-        }
-
-        public static uint SetMaskedAttributes(uint self, uint mask, uint attributes, bool value)
-        {
-            if (value)
-            {
-                self &= ~mask;
-                return self | attributes;
-            }
-
-            return self & ~(mask & attributes);
-        }
-
-        public static bool GetAttributes(ushort self, ushort attributes)
-        {
-            return (self & attributes) != 0;
-        }
-
-        public static ushort SetAttributes(ushort self, ushort attributes, bool value)
-        {
-            if (value)
-                return (ushort)(self | attributes);
-
-            return (ushort)(self & ~attributes);
-        }
-
-        public static bool GetMaskedAttributes(ushort self, ushort mask, uint attributes)
-        {
-            return (self & mask) == attributes;
-        }
-
-        public static ushort SetMaskedAttributes(ushort self, ushort mask, uint attributes, bool value)
-        {
-            if (value)
-            {
-                self = (ushort)(self & ~mask);
-                return (ushort)(self | attributes);
-            }
-
-            return (ushort)(self & ~(mask & attributes));
-        }
-    }
-}

+ 0 - 41
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IMetadataScope.cs

@@ -1,41 +0,0 @@
-//
-// IMetadataScope.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-	public enum MetadataScopeType {
-		AssemblyNameReference,
-		ModuleReference,
-		ModuleDefinition,
-	}
-
-	public interface IMetadataScope : IMetadataTokenProvider {
-		MetadataScopeType MetadataScopeType { get; }
-		string Name { get; set; }
-	}
-}

+ 0 - 35
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IMetadataTokenProvider.cs

@@ -1,35 +0,0 @@
-//
-// IMetadataTokenProvider.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-	public interface IMetadataTokenProvider {
-
-		MetadataToken MetadataToken { get; set; }
-	}
-}

+ 0 - 75
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/IMethodSignature.cs

@@ -1,75 +0,0 @@
-//
-// IMethodSignature.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Text;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil {
-
-	public interface IMethodSignature : IMetadataTokenProvider {
-
-		bool HasThis { get; set; }
-		bool ExplicitThis { get; set; }
-		MethodCallingConvention CallingConvention { get; set; }
-
-		bool HasParameters { get; }
-		Collection<ParameterDefinition> Parameters { get; }
-		TypeReference ReturnType { get; set; }
-		MethodReturnType MethodReturnType { get; }
-	}
-
-	static partial class Mixin {
-
-		public static bool HasImplicitThis (IMethodSignature self)
-		{
-			return self.HasThis && !self.ExplicitThis;
-		}
-
-		public static void MethodSignatureFullName (IMethodSignature self, StringBuilder builder)
-		{
-			builder.Append ("(");
-
-			if (self.HasParameters) {
-				var parameters = self.Parameters;
-				for (int i = 0; i < parameters.Count; i++) {
-					var parameter = parameters [i];
-					if (i > 0)
-						builder.Append (",");
-
-					if (parameter.ParameterType.IsSentinel)
-						builder.Append ("...,");
-
-					builder.Append (parameter.ParameterType.FullName);
-				}
-			}
-
-			builder.Append (")");
-		}
-	}
-}

+ 0 - 286
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/Import.cs

@@ -1,286 +0,0 @@
-//
-// Import.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using SR = System.Reflection;
-
-using Mono.Cecil.Metadata;
-
-namespace Mono.Cecil
-{
-
-    enum ImportGenericKind
-    {
-        Definition,
-        Open,
-    }
-
-    class MetadataImporter
-    {
-
-        readonly ModuleDefinition module;
-
-        public MetadataImporter(ModuleDefinition module)
-        {
-            this.module = module;
-        }
-
-
-        public TypeReference ImportType(TypeReference type, IGenericContext context)
-        {
-            if (Mixin.IsTypeSpecification(type))
-                return ImportTypeSpecification(type, context);
-
-            var reference = new TypeReference(
-                type.Namespace,
-                type.Name,
-                module,
-                ImportScope(type.Scope),
-                type.IsValueType);
-
-            MetadataSystem.TryProcessPrimitiveTypeReference(reference);
-
-            if (type.IsNested)
-                reference.DeclaringType = ImportType(type.DeclaringType, context);
-
-            if (type.HasGenericParameters)
-                ImportGenericParameters(reference, type);
-
-            return reference;
-        }
-
-        IMetadataScope ImportScope(IMetadataScope scope)
-        {
-            switch (scope.MetadataScopeType)
-            {
-                case MetadataScopeType.AssemblyNameReference:
-                    return ImportAssemblyName((AssemblyNameReference)scope);
-                case MetadataScopeType.ModuleDefinition:
-                    return ImportAssemblyName(((ModuleDefinition)scope).Assembly.Name);
-                case MetadataScopeType.ModuleReference:
-                    throw new NotImplementedException();
-            }
-
-            throw new NotSupportedException();
-        }
-
-        AssemblyNameReference ImportAssemblyName(AssemblyNameReference name)
-        {
-            AssemblyNameReference reference;
-            if (TryGetAssemblyNameReference(name, out reference))
-                return reference;
-
-            reference = new AssemblyNameReference(name.Name, name.Version)
-            {
-                Culture = name.Culture,
-                HashAlgorithm = name.HashAlgorithm,
-            };
-
-            var pk_token = !Mixin.IsNullOrEmpty(name.PublicKeyToken)
-                ? new byte[name.PublicKeyToken.Length]
-                : Empty<byte>.Array;
-
-            if (pk_token.Length > 0)
-                Buffer.BlockCopy(name.PublicKeyToken, 0, pk_token, 0, pk_token.Length);
-
-            reference.PublicKeyToken = pk_token;
-
-            module.AssemblyReferences.Add(reference);
-
-            return reference;
-        }
-
-        bool TryGetAssemblyNameReference(AssemblyNameReference name_reference, out AssemblyNameReference assembly_reference)
-        {
-            var references = module.AssemblyReferences;
-
-            for (int i = 0; i < references.Count; i++)
-            {
-                var reference = references[i];
-                if (name_reference.FullName != reference.FullName) // TODO compare field by field
-                    continue;
-
-                assembly_reference = reference;
-                return true;
-            }
-
-            assembly_reference = null;
-            return false;
-        }
-
-        static void ImportGenericParameters(IGenericParameterProvider imported, IGenericParameterProvider original)
-        {
-            var parameters = original.GenericParameters;
-            var imported_parameters = imported.GenericParameters;
-
-            for (int i = 0; i < parameters.Count; i++)
-                imported_parameters.Add(new GenericParameter(parameters[i].Name, imported));
-        }
-
-        TypeReference ImportTypeSpecification(TypeReference type, IGenericContext context)
-        {
-            switch (type.etype)
-            {
-                case ElementType.SzArray:
-                    var vector = (ArrayType)type;
-                    return new ArrayType(ImportType(vector.ElementType, context));
-                case ElementType.Ptr:
-                    var pointer = (PointerType)type;
-                    return new PointerType(ImportType(pointer.ElementType, context));
-                case ElementType.ByRef:
-                    var byref = (ByReferenceType)type;
-                    return new ByReferenceType(ImportType(byref.ElementType, context));
-                case ElementType.Pinned:
-                    var pinned = (PinnedType)type;
-                    return new PinnedType(ImportType(pinned.ElementType, context));
-                case ElementType.Sentinel:
-                    var sentinel = (SentinelType)type;
-                    return new SentinelType(ImportType(sentinel.ElementType, context));
-                case ElementType.CModOpt:
-                    var modopt = (OptionalModifierType)type;
-                    return new OptionalModifierType(
-                        ImportType(modopt.ModifierType, context),
-                        ImportType(modopt.ElementType, context));
-                case ElementType.CModReqD:
-                    var modreq = (RequiredModifierType)type;
-                    return new RequiredModifierType(
-                        ImportType(modreq.ModifierType, context),
-                        ImportType(modreq.ElementType, context));
-                case ElementType.Array:
-                    var array = (ArrayType)type;
-                    var imported_array = new ArrayType(ImportType(array.ElementType, context));
-                    if (array.IsVector)
-                        return imported_array;
-
-                    var dimensions = array.Dimensions;
-                    var imported_dimensions = imported_array.Dimensions;
-
-                    imported_dimensions.Clear();
-
-                    for (int i = 0; i < dimensions.Count; i++)
-                    {
-                        var dimension = dimensions[i];
-
-                        imported_dimensions.Add(new ArrayDimension(dimension.LowerBound, dimension.UpperBound));
-                    }
-
-                    return imported_array;
-                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_arguments = imported_instance.GenericArguments;
-
-                    for (int i = 0; i < arguments.Count; i++)
-                        imported_arguments.Add(ImportType(arguments[i], context));
-
-                    return imported_instance;
-                case ElementType.Var:
-                    if (context == null || context.Type == null)
-                        throw new InvalidOperationException();
-
-                    return ((TypeReference)context.Type).GetElementType().GenericParameters[((GenericParameter)type).Position];
-                case ElementType.MVar:
-                    if (context == null || context.Method == null)
-                        throw new InvalidOperationException();
-
-                    return context.Method.GenericParameters[((GenericParameter)type).Position];
-            }
-
-            throw new NotSupportedException(type.etype.ToString());
-        }
-
-        public FieldReference ImportField(FieldReference field, IGenericContext context)
-        {
-            var declaring_type = ImportType(field.DeclaringType, context);
-
-            return new FieldReference
-            {
-                Name = field.Name,
-                DeclaringType = declaring_type,
-                FieldType = ImportType(field.FieldType, context ?? declaring_type),
-            };
-        }
-
-        public MethodReference ImportMethod(MethodReference method, IGenericContext context)
-        {
-            if (method.IsGenericInstance)
-                return ImportMethodSpecification(method, context);
-
-            var declaring_type = ImportType(method.DeclaringType, context);
-
-            var reference = new MethodReference
-            {
-                Name = method.Name,
-                HasThis = method.HasThis,
-                ExplicitThis = method.ExplicitThis,
-                DeclaringType = declaring_type,
-            };
-
-            reference.CallingConvention = method.CallingConvention;
-
-            if (method.HasGenericParameters)
-                ImportGenericParameters(reference, method);
-
-            reference.ReturnType = ImportType(method.ReturnType, context ?? reference);
-
-            if (!method.HasParameters)
-                return reference;
-
-            var reference_parameters = reference.Parameters;
-
-            var parameters = method.Parameters;
-            for (int i = 0; i < parameters.Count; i++)
-                reference_parameters.Add(
-                    new ParameterDefinition(ImportType(parameters[i].ParameterType, context ?? reference)));
-
-            return reference;
-        }
-
-        MethodSpecification ImportMethodSpecification(MethodReference method, IGenericContext context)
-        {
-            if (!method.IsGenericInstance)
-                throw new NotSupportedException();
-
-            var instance = (GenericInstanceMethod)method;
-            var element_method = ImportMethod(instance.ElementMethod, context);
-            var imported_instance = new GenericInstanceMethod(element_method);
-
-            var arguments = instance.GenericArguments;
-            var imported_arguments = imported_instance.GenericArguments;
-
-            for (int i = 0; i < arguments.Count; i++)
-                imported_arguments.Add(ImportType(arguments[i], context));
-
-            return imported_instance;
-        }
-    }
-}

+ 0 - 60
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/LinkedResource.cs

@@ -1,60 +0,0 @@
-//
-// LinkedResource.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-	public sealed class LinkedResource : Resource {
-
-		internal byte [] hash;
-		string file;
-
-		public byte [] Hash {
-			get { return hash; }
-		}
-
-		public string File {
-			get { return file; }
-			set { file = value; }
-		}
-
-		public override ResourceType ResourceType {
-			get { return ResourceType.Linked; }
-		}
-
-		public LinkedResource (string name, ManifestResourceAttributes flags)
-			: base (name, flags)
-		{
-		}
-
-		public LinkedResource (string name, ManifestResourceAttributes flags, string file)
-			: base (name, flags)
-		{
-			this.file = file;
-		}
-	}
-}

+ 0 - 39
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ManifestResourceAttributes.cs

@@ -1,39 +0,0 @@
-//
-// ManifestResourceAttributes.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	[Flags]
-	public enum ManifestResourceAttributes : uint {
-		VisibilityMask	= 0x0007,
-		Public			= 0x0001,	// The resource is exported from the Assembly
-		Private			= 0x0002	 // The resource is private to the Assembly
-	}
-}

+ 0 - 92
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MemberDefinitionCollection.cs

@@ -1,92 +0,0 @@
-//
-// MemberDefinitionCollection.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil {
-
-	class MemberDefinitionCollection<T> : Collection<T> where T : IMemberDefinition {
-
-		TypeDefinition container;
-
-		internal MemberDefinitionCollection (TypeDefinition container)
-		{
-			this.container = container;
-		}
-
-		internal MemberDefinitionCollection (TypeDefinition container, int capacity)
-			: base (capacity)
-		{
-			this.container = container;
-		}
-
-		protected override void OnAdd (T item, int index)
-		{
-			Attach (item);
-		}
-
-		protected sealed override void OnSet (T item, int index)
-		{
-			Attach (item);
-		}
-
-		protected sealed override void OnInsert (T item, int index)
-		{
-			Attach (item);
-		}
-
-		protected sealed override void OnRemove (T item, int index)
-		{
-			Detach (item);
-		}
-
-		protected sealed override void OnClear ()
-		{
-			foreach (var definition in this)
-				Detach (definition);
-		}
-
-		void Attach (T element)
-		{
-			if (element.DeclaringType == container)
-				return;
-
-			if (element.DeclaringType != null)
-				throw new ArgumentException ("Member already attached");
-
-			element.DeclaringType = this.container;
-		}
-
-		static void Detach (T element)
-		{
-			element.DeclaringType = null;
-		}
-	}
-}

+ 0 - 370
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MetadataResolver.cs

@@ -1,370 +0,0 @@
-//
-// MetadataResolver.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil
-{
-
-    public interface IAssemblyResolver
-    {
-        AssemblyDefinition Resolve(AssemblyNameReference name);
-        AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters parameters);
-
-        AssemblyDefinition Resolve(string fullName);
-        AssemblyDefinition Resolve(string fullName, ReaderParameters parameters);
-        event AssemblyResolveEventHandler ResolveFailure;
-    }
-
-    public interface IMetadataResolver
-    {
-        TypeDefinition Resolve(TypeReference type);
-        FieldDefinition Resolve(FieldReference field);
-        MethodDefinition Resolve(MethodReference method);
-    }
-
-
-    public class ResolutionException : Exception
-    {
-
-        readonly MemberReference member;
-
-        public MemberReference Member
-        {
-            get { return member; }
-        }
-
-        public ResolutionException(MemberReference member)
-            : base("Failed to resolve " + member.FullName)
-        {
-            this.member = member;
-        }
-
-
-    }
-
-    public class MetadataResolver : IMetadataResolver
-    {
-
-        readonly IAssemblyResolver assembly_resolver;
-
-        public IAssemblyResolver AssemblyResolver
-        {
-            get { return assembly_resolver; }
-        }
-
-        public MetadataResolver(IAssemblyResolver assemblyResolver)
-        {
-            if (assemblyResolver == null)
-                throw new ArgumentNullException("assemblyResolver");
-
-            assembly_resolver = assemblyResolver;
-        }
-
-        public virtual TypeDefinition Resolve(TypeReference type)
-        {
-            if (type == null)
-                throw new ArgumentNullException("type");
-
-            type = type.GetElementType();
-
-            var scope = type.Scope;
-            switch (scope.MetadataScopeType)
-            {
-                case MetadataScopeType.AssemblyNameReference:
-                    var assembly = assembly_resolver.Resolve((AssemblyNameReference)scope);
-                    if (assembly == null)
-                        return null;
-
-                    return GetType(assembly.MainModule, type);
-                case MetadataScopeType.ModuleDefinition:
-                    return GetType((ModuleDefinition)scope, type);
-                case MetadataScopeType.ModuleReference:
-                    var modules = type.Module.Assembly.Modules;
-                    var module_ref = (ModuleReference)scope;
-                    for (int i = 0; i < modules.Count; i++)
-                    {
-                        var netmodule = modules[i];
-                        if (netmodule.Name == module_ref.Name)
-                            return GetType(netmodule, type);
-                    }
-                    break;
-            }
-
-            throw new NotSupportedException();
-        }
-
-        static TypeDefinition GetType(ModuleDefinition module, TypeReference reference)
-        {
-            var type = GetTypeDefinition(module, reference);
-            if (type != null)
-                return type;
-
-            if (!module.HasExportedTypes)
-                return null;
-
-            var exported_types = module.ExportedTypes;
-
-            for (int i = 0; i < exported_types.Count; i++)
-            {
-                var exported_type = exported_types[i];
-                if (exported_type.Name != reference.Name)
-                    continue;
-
-                if (exported_type.Namespace != reference.Namespace)
-                    continue;
-
-                return exported_type.Resolve();
-            }
-
-            return null;
-        }
-
-        static TypeDefinition GetTypeDefinition(ModuleDefinition module, TypeReference type)
-        {
-            if (!type.IsNested)
-                return module.GetType(type.Namespace, type.Name);
-
-            var declaring_type = type.DeclaringType.Resolve();
-            if (declaring_type == null)
-                return null;
-
-            return Mixin.GetNestedType(declaring_type, type.Name);
-        }
-
-        public virtual FieldDefinition Resolve(FieldReference field)
-        {
-            if (field == null)
-                throw new ArgumentNullException("field");
-
-            var type = Resolve(field.DeclaringType);
-            if (type == null)
-                return null;
-
-            if (!type.HasFields)
-                return null;
-
-            return GetField(type, field);
-        }
-
-        FieldDefinition GetField(TypeDefinition type, FieldReference reference)
-        {
-            while (type != null)
-            {
-                var field = GetField(type.Fields, reference);
-                if (field != null)
-                    return field;
-
-                if (type.BaseType == null)
-                    return null;
-
-                type = Resolve(type.BaseType);
-            }
-
-            return null;
-        }
-
-        static FieldDefinition GetField(Collection<FieldDefinition> fields, FieldReference reference)
-        {
-            for (int i = 0; i < fields.Count; i++)
-            {
-                var field = fields[i];
-
-                if (field.Name != reference.Name)
-                    continue;
-
-                if (!AreSame(field.FieldType, reference.FieldType))
-                    continue;
-
-                return field;
-            }
-
-            return null;
-        }
-
-        public virtual MethodDefinition Resolve(MethodReference method)
-        {
-            if (method == null)
-                throw new ArgumentNullException("method");
-
-            var type = Resolve(method.DeclaringType);
-            if (type == null)
-                return null;
-
-            method = method.GetElementMethod();
-
-            if (!type.HasMethods)
-                return null;
-
-            return GetMethod(type, method);
-        }
-
-        MethodDefinition GetMethod(TypeDefinition type, MethodReference reference)
-        {
-            while (type != null)
-            {
-                var method = GetMethod(type.Methods, reference);
-                if (method != null)
-                    return method;
-
-                if (type.BaseType == null)
-                    return null;
-
-                type = Resolve(type.BaseType);
-            }
-
-            return null;
-        }
-
-        public static MethodDefinition GetMethod(Collection<MethodDefinition> methods, MethodReference reference)
-        {
-            for (int i = 0; i < methods.Count; i++)
-            {
-                var method = methods[i];
-
-                if (method.Name != reference.Name)
-                    continue;
-
-                if (method.HasGenericParameters != reference.HasGenericParameters)
-                    continue;
-
-                if (method.HasGenericParameters && method.GenericParameters.Count != reference.GenericParameters.Count)
-                    continue;
-
-                if (!AreSame(method.ReturnType, reference.ReturnType))
-                    continue;
-
-                if (method.HasParameters != reference.HasParameters)
-                    continue;
-
-                if (!method.HasParameters && !reference.HasParameters)
-                    return method;
-
-                if (!AreSame(method.Parameters, reference.Parameters))
-                    continue;
-
-                return method;
-            }
-
-            return null;
-        }
-
-        static bool AreSame(Collection<ParameterDefinition> a, Collection<ParameterDefinition> b)
-        {
-            var count = a.Count;
-
-            if (count != b.Count)
-                return false;
-
-            if (count == 0)
-                return true;
-
-            for (int i = 0; i < count; i++)
-                if (!AreSame(a[i].ParameterType, b[i].ParameterType))
-                    return false;
-
-            return true;
-        }
-
-        static bool AreSame(TypeSpecification a, TypeSpecification b)
-        {
-            if (!AreSame(a.ElementType, b.ElementType))
-                return false;
-
-            if (a.IsGenericInstance)
-                return AreSame((GenericInstanceType)a, (GenericInstanceType)b);
-
-            if (a.IsRequiredModifier || a.IsOptionalModifier)
-                return AreSame((IModifierType)a, (IModifierType)b);
-
-            if (a.IsArray)
-                return AreSame((ArrayType)a, (ArrayType)b);
-
-            return true;
-        }
-
-        static bool AreSame(ArrayType a, ArrayType b)
-        {
-            if (a.Rank != b.Rank)
-                return false;
-
-            // TODO: dimensions
-
-            return true;
-        }
-
-        static bool AreSame(IModifierType a, IModifierType b)
-        {
-            return AreSame(a.ModifierType, b.ModifierType);
-        }
-
-        static bool AreSame(GenericInstanceType a, GenericInstanceType b)
-        {
-            if (a.GenericArguments.Count != b.GenericArguments.Count)
-                return false;
-
-            for (int i = 0; i < a.GenericArguments.Count; i++)
-                if (!AreSame(a.GenericArguments[i], b.GenericArguments[i]))
-                    return false;
-
-            return true;
-        }
-
-        static bool AreSame(GenericParameter a, GenericParameter b)
-        {
-            return a.Position == b.Position;
-        }
-
-        static bool AreSame(TypeReference a, TypeReference b)
-        {
-            if (ReferenceEquals(a, b))
-                return true;
-
-            if (a == null || b == null)
-                return false;
-
-            if (a.etype != b.etype)
-                return false;
-
-            if (a.IsGenericParameter)
-                return AreSame((GenericParameter)a, (GenericParameter)b);
-
-            if (Mixin.IsTypeSpecification(a))
-                return AreSame((TypeSpecification)a, (TypeSpecification)b);
-
-            if (a.Name != b.Name || a.Namespace != b.Namespace)
-                return false;
-
-            //TODO: check scope
-
-            return AreSame(a.DeclaringType, b.DeclaringType);
-        }
-    }
-}

+ 0 - 40
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MethodCallingConvention.cs

@@ -1,40 +0,0 @@
-//
-// MethodCallingConvention.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-	public enum MethodCallingConvention : byte {
-		Default		= 0x0,
-		C			= 0x1,
-		StdCall		= 0x2,
-		ThisCall	= 0x3,
-		FastCall	= 0x4,
-		VarArg		= 0x5,
-		Generic		= 0x10,
-	}
-}

+ 0 - 570
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MethodDefinition.cs

@@ -1,570 +0,0 @@
-//
-// MethodDefinition.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using Mono.Cecil.Cil;
-using Mono.Collections.Generic;
-
-using RVA = System.UInt32;
-
-namespace Mono.Cecil
-{
-
-    public sealed class MethodDefinition : MethodReference, IMemberDefinition, ISecurityDeclarationProvider
-    {
-
-        ushort attributes;
-        ushort impl_attributes;
-        internal volatile bool sem_attrs_ready;
-        internal MethodSemanticsAttributes sem_attrs;
-        Collection<CustomAttribute> custom_attributes;
-        Collection<SecurityDeclaration> security_declarations;
-
-        internal RVA rva;
-        internal PInvokeInfo pinvoke;
-        Collection<MethodReference> overrides;
-
-        internal MethodBody body;
-
-        public MethodAttributes Attributes
-        {
-            get { return (MethodAttributes)attributes; }
-            set { attributes = (ushort)value; }
-        }
-
-        public MethodImplAttributes ImplAttributes
-        {
-            get { return (MethodImplAttributes)impl_attributes; }
-            set { impl_attributes = (ushort)value; }
-        }
-
-        public MethodSemanticsAttributes SemanticsAttributes
-        {
-            get
-            {
-                if (sem_attrs_ready)
-                    return sem_attrs;
-
-                if (HasImage)
-                {
-                    ReadSemantics();
-                    return sem_attrs;
-                }
-
-                sem_attrs = MethodSemanticsAttributes.None;
-                sem_attrs_ready = true;
-                return sem_attrs;
-            }
-            set { sem_attrs = value; }
-        }
-
-        internal void ReadSemantics()
-        {
-            if (sem_attrs_ready)
-                return;
-
-            var module = this.Module;
-            if (module == null)
-                return;
-
-            if (!module.HasImage)
-                return;
-
-            module.Read(this, (method, reader) => reader.ReadAllSemantics(method));
-        }
-
-        public bool HasSecurityDeclarations
-        {
-            get
-            {
-                if (security_declarations != null)
-                    return security_declarations.Count > 0;
-
-                return Mixin.GetHasSecurityDeclarations(this, Module);
-            }
-        }
-
-        public Collection<SecurityDeclaration> SecurityDeclarations
-        {
-            get { return security_declarations ?? (Mixin.GetSecurityDeclarations(this, ref security_declarations, Module)); }
-        }
-
-        public bool HasCustomAttributes
-        {
-            get
-            {
-                if (custom_attributes != null)
-                    return custom_attributes.Count > 0;
-
-                return Mixin.GetHasCustomAttributes(this, Module);
-            }
-        }
-
-        public Collection<CustomAttribute> CustomAttributes
-        {
-            get { return custom_attributes ?? (Mixin.GetCustomAttributes(this, ref custom_attributes, Module)); }
-        }
-
-        public int RVA
-        {
-            get { return (int)rva; }
-        }
-
-        public bool HasBody
-        {
-            get
-            {
-                return (attributes & (ushort)MethodAttributes.Abstract) == 0 &&
-                    (attributes & (ushort)MethodAttributes.PInvokeImpl) == 0 &&
-                    (impl_attributes & (ushort)MethodImplAttributes.InternalCall) == 0 &&
-                    (impl_attributes & (ushort)MethodImplAttributes.Native) == 0 &&
-                    (impl_attributes & (ushort)MethodImplAttributes.Unmanaged) == 0 &&
-                    (impl_attributes & (ushort)MethodImplAttributes.Runtime) == 0;
-            }
-        }
-
-        public MethodBody Body
-        {
-            get
-            {
-                MethodBody localBody = this.body;
-                if (localBody != null)
-                    return localBody;
-
-                if (!HasBody)
-                    return null;
-
-                if (HasImage && rva != 0)
-                    return Module.Read(ref body, this, (method, reader) => reader.ReadMethodBody(method));
-
-                return body = new MethodBody(this);
-            }
-            set
-            {
-                // we reset Body to null in ILSpy to save memory; so we need that operation to be thread-safe
-                lock (Module.SyncRoot)
-                {
-                    body = value;
-                }
-            }
-        }
-
-        public bool HasPInvokeInfo
-        {
-            get
-            {
-                if (pinvoke != null)
-                    return true;
-
-                return IsPInvokeImpl;
-            }
-        }
-
-        public PInvokeInfo PInvokeInfo
-        {
-            get
-            {
-                if (pinvoke != null)
-                    return pinvoke;
-
-                if (HasImage && IsPInvokeImpl)
-                    return Module.Read(ref pinvoke, this, (method, reader) => reader.ReadPInvokeInfo(method));
-
-                return null;
-            }
-            set
-            {
-                IsPInvokeImpl = true;
-                pinvoke = value;
-            }
-        }
-
-        public bool HasOverrides
-        {
-            get
-            {
-                if (overrides != null)
-                    return overrides.Count > 0;
-
-                if (HasImage)
-                    return Module.Read(this, (method, reader) => reader.HasOverrides(method));
-
-                return false;
-            }
-        }
-
-        public Collection<MethodReference> Overrides
-        {
-            get
-            {
-                if (overrides != null)
-                    return overrides;
-
-                if (HasImage)
-                    return Module.Read(ref overrides, this, (method, reader) => reader.ReadOverrides(method));
-
-                return overrides = new Collection<MethodReference>();
-            }
-        }
-
-        public override bool HasGenericParameters
-        {
-            get
-            {
-                if (generic_parameters != null)
-                    return generic_parameters.Count > 0;
-
-                return Mixin.GetHasGenericParameters(this, Module);
-            }
-        }
-
-        public override Collection<GenericParameter> GenericParameters
-        {
-            get { return generic_parameters ?? (Mixin.GetGenericParameters(this, ref generic_parameters, Module)); }
-        }
-
-        #region MethodAttributes
-
-        public bool IsCompilerControlled
-        {
-            get { return Mixin.GetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.CompilerControlled); }
-            set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.CompilerControlled, value); }
-        }
-
-        public bool IsPrivate
-        {
-            get { return Mixin.GetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Private); }
-            set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Private, value); }
-        }
-
-        public bool IsFamilyAndAssembly
-        {
-            get { return Mixin.GetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.FamANDAssem); }
-            set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.FamANDAssem, value); }
-        }
-
-        public bool IsAssembly
-        {
-            get { return Mixin.GetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Assembly); }
-            set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Assembly, value); }
-        }
-
-        public bool IsFamily
-        {
-            get { return Mixin.GetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Family); }
-            set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Family, value); }
-        }
-
-        public bool IsFamilyOrAssembly
-        {
-            get { return Mixin.GetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.FamORAssem); }
-            set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.FamORAssem, value); }
-        }
-
-        public bool IsPublic
-        {
-            get { return Mixin.GetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Public); }
-            set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Public, value); }
-        }
-
-        public bool IsStatic
-        {
-            get { return Mixin.GetAttributes(attributes,(ushort)MethodAttributes.Static); }
-            set { attributes =Mixin.SetAttributes(attributes,(ushort)MethodAttributes.Static, value); }
-        }
-
-        public bool IsFinal
-        {
-            get { return Mixin.GetAttributes(attributes,(ushort)MethodAttributes.Final); }
-            set { attributes =Mixin.SetAttributes(attributes,(ushort)MethodAttributes.Final, value); }
-        }
-
-        public bool IsVirtual
-        {
-            get { return Mixin.GetAttributes(attributes,(ushort)MethodAttributes.Virtual); }
-            set { attributes =Mixin.SetAttributes(attributes,(ushort)MethodAttributes.Virtual, value); }
-        }
-
-        public bool IsHideBySig
-        {
-            get { return Mixin.GetAttributes(attributes,(ushort)MethodAttributes.HideBySig); }
-            set { attributes =Mixin.SetAttributes(attributes,(ushort)MethodAttributes.HideBySig, value); }
-        }
-
-        public bool IsReuseSlot
-        {
-            get { return Mixin.GetMaskedAttributes(attributes,(ushort)MethodAttributes.VtableLayoutMask, (ushort)MethodAttributes.ReuseSlot); }
-            set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort)MethodAttributes.VtableLayoutMask, (ushort)MethodAttributes.ReuseSlot, value); }
-        }
-
-        public bool IsNewSlot
-        {
-            get { return Mixin.GetMaskedAttributes(attributes,(ushort)MethodAttributes.VtableLayoutMask, (ushort)MethodAttributes.NewSlot); }
-            set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort)MethodAttributes.VtableLayoutMask, (ushort)MethodAttributes.NewSlot, value); }
-        }
-
-        public bool IsCheckAccessOnOverride
-        {
-            get { return Mixin.GetAttributes(attributes,(ushort)MethodAttributes.CheckAccessOnOverride); }
-            set { attributes =Mixin.SetAttributes(attributes,(ushort)MethodAttributes.CheckAccessOnOverride, value); }
-        }
-
-        public bool IsAbstract
-        {
-            get { return Mixin.GetAttributes(attributes,(ushort)MethodAttributes.Abstract); }
-            set { attributes =Mixin.SetAttributes(attributes,(ushort)MethodAttributes.Abstract, value); }
-        }
-
-        public bool IsSpecialName
-        {
-            get { return Mixin.GetAttributes(attributes,(ushort)MethodAttributes.SpecialName); }
-            set { attributes =Mixin.SetAttributes(attributes,(ushort)MethodAttributes.SpecialName, value); }
-        }
-
-        public bool IsPInvokeImpl
-        {
-            get { return Mixin.GetAttributes(attributes,(ushort)MethodAttributes.PInvokeImpl); }
-            set { attributes =Mixin.SetAttributes(attributes,(ushort)MethodAttributes.PInvokeImpl, value); }
-        }
-
-        public bool IsUnmanagedExport
-        {
-            get { return Mixin.GetAttributes(attributes,(ushort)MethodAttributes.UnmanagedExport); }
-            set { attributes =Mixin.SetAttributes(attributes,(ushort)MethodAttributes.UnmanagedExport, value); }
-        }
-
-        public bool IsRuntimeSpecialName
-        {
-            get { return Mixin.GetAttributes(attributes,(ushort)MethodAttributes.RTSpecialName); }
-            set { attributes =Mixin.SetAttributes(attributes,(ushort)MethodAttributes.RTSpecialName, value); }
-        }
-
-        public bool HasSecurity
-        {
-            get { return Mixin.GetAttributes(attributes,(ushort)MethodAttributes.HasSecurity); }
-            set { attributes =Mixin.SetAttributes(attributes,(ushort)MethodAttributes.HasSecurity, value); }
-        }
-
-        #endregion
-
-        #region MethodImplAttributes
-
-        public bool IsIL
-        {
-            get { return Mixin.GetMaskedAttributes(impl_attributes,(ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.IL); }
-            set { impl_attributes = Mixin.SetMaskedAttributes(impl_attributes,(ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.IL, value); }
-        }
-
-        public bool IsNative
-        {
-            get { return Mixin.GetMaskedAttributes(impl_attributes,(ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.Native); }
-            set { impl_attributes = Mixin.SetMaskedAttributes(impl_attributes,(ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.Native, value); }
-        }
-
-        public bool IsRuntime
-        {
-            get { return Mixin.GetMaskedAttributes(impl_attributes,(ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.Runtime); }
-            set { impl_attributes = Mixin.SetMaskedAttributes(impl_attributes,(ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.Runtime, value); }
-        }
-
-        public bool IsUnmanaged
-        {
-            get { return Mixin.GetMaskedAttributes(impl_attributes,(ushort)MethodImplAttributes.ManagedMask, (ushort)MethodImplAttributes.Unmanaged); }
-            set { impl_attributes = Mixin.SetMaskedAttributes(impl_attributes,(ushort)MethodImplAttributes.ManagedMask, (ushort)MethodImplAttributes.Unmanaged, value); }
-        }
-
-        public bool IsManaged
-        {
-            get { return Mixin.GetMaskedAttributes(impl_attributes,(ushort)MethodImplAttributes.ManagedMask, (ushort)MethodImplAttributes.Managed); }
-            set { impl_attributes = Mixin.SetMaskedAttributes(impl_attributes,(ushort)MethodImplAttributes.ManagedMask, (ushort)MethodImplAttributes.Managed, value); }
-        }
-
-        public bool IsForwardRef
-        {
-            get { return Mixin.GetAttributes(impl_attributes, (ushort)MethodImplAttributes.ForwardRef); }
-            set { impl_attributes = Mixin.SetAttributes(impl_attributes,(ushort)MethodImplAttributes.ForwardRef, value); }
-        }
-
-        public bool IsPreserveSig
-        {
-            get { return Mixin.GetAttributes(impl_attributes, (ushort)MethodImplAttributes.PreserveSig); }
-            set { impl_attributes = Mixin.SetAttributes(impl_attributes,(ushort)MethodImplAttributes.PreserveSig, value); }
-        }
-
-        public bool IsInternalCall
-        {
-            get { return Mixin.GetAttributes(impl_attributes, (ushort)MethodImplAttributes.InternalCall); }
-            set { impl_attributes = Mixin.SetAttributes(impl_attributes,(ushort)MethodImplAttributes.InternalCall, value); }
-        }
-
-        public bool IsSynchronized
-        {
-            get { return Mixin.GetAttributes(impl_attributes, (ushort)MethodImplAttributes.Synchronized); }
-            set { impl_attributes = Mixin.SetAttributes(impl_attributes,(ushort)MethodImplAttributes.Synchronized, value); }
-        }
-
-        public bool NoInlining
-        {
-            get { return Mixin.GetAttributes(impl_attributes, (ushort)MethodImplAttributes.NoInlining); }
-            set { impl_attributes = Mixin.SetAttributes(impl_attributes,(ushort)MethodImplAttributes.NoInlining, value); }
-        }
-
-        public bool NoOptimization
-        {
-            get { return Mixin.GetAttributes(impl_attributes, (ushort)MethodImplAttributes.NoOptimization); }
-            set { impl_attributes = Mixin.SetAttributes(impl_attributes,(ushort)MethodImplAttributes.NoOptimization, value); }
-        }
-
-        #endregion
-
-        #region MethodSemanticsAttributes
-
-        public bool IsSetter
-        {
-            get { return Mixin.GetSemantics(this, MethodSemanticsAttributes.Setter); }
-            set { Mixin.SetSemantics(this, MethodSemanticsAttributes.Setter, value); }
-        }
-
-        public bool IsGetter
-        {
-            get { return Mixin.GetSemantics(this, MethodSemanticsAttributes.Getter); }
-            set { Mixin.SetSemantics(this, MethodSemanticsAttributes.Getter, value); }
-        }
-
-        public bool IsOther
-        {
-            get { return Mixin.GetSemantics(this, MethodSemanticsAttributes.Other); }
-            set { Mixin.SetSemantics(this, MethodSemanticsAttributes.Other, value); }
-        }
-
-        public bool IsAddOn
-        {
-            get { return Mixin.GetSemantics(this, MethodSemanticsAttributes.AddOn); }
-            set { Mixin.SetSemantics(this, MethodSemanticsAttributes.AddOn, value); }
-        }
-
-        public bool IsRemoveOn
-        {
-            get { return Mixin.GetSemantics(this, MethodSemanticsAttributes.RemoveOn); }
-            set { Mixin.SetSemantics(this, MethodSemanticsAttributes.RemoveOn, value); }
-        }
-
-        public bool IsFire
-        {
-            get { return Mixin.GetSemantics(this, MethodSemanticsAttributes.Fire); }
-            set { Mixin.SetSemantics(this, MethodSemanticsAttributes.Fire, value); }
-        }
-
-        #endregion
-
-        public new TypeDefinition DeclaringType
-        {
-            get { return (TypeDefinition)base.DeclaringType; }
-            set { base.DeclaringType = value; }
-        }
-
-        public bool IsConstructor
-        {
-            get
-            {
-                return this.IsRuntimeSpecialName
-                    && this.IsSpecialName
-                    && (this.Name == ".cctor" || this.Name == ".ctor");
-            }
-        }
-
-        public override bool IsDefinition
-        {
-            get { return true; }
-        }
-
-        internal MethodDefinition()
-        {
-            this.token = new MetadataToken(TokenType.Method);
-        }
-
-        public MethodDefinition(string name, MethodAttributes attributes, TypeReference returnType)
-            : base(name, returnType)
-        {
-            this.attributes = (ushort)attributes;
-            this.HasThis = !this.IsStatic;
-            this.token = new MetadataToken(TokenType.Method);
-        }
-
-        public override MethodDefinition Resolve()
-        {
-            return this;
-        }
-    }
-
-    static partial class Mixin
-    {
-
-        public static ParameterDefinition GetParameter(MethodBody self, int index)
-        {
-            var method = self.method;
-
-            if (method.HasThis)
-            {
-                if (index == 0)
-                    return self.ThisParameter;
-
-                index--;
-            }
-
-            var parameters = method.Parameters;
-
-            if (index < 0 || index >= parameters.size)
-                return null;
-
-            return parameters[index];
-        }
-
-        public static VariableDefinition GetVariable(MethodBody self, int index)
-        {
-            var variables = self.Variables;
-
-            if (index < 0 || index >= variables.size)
-                return null;
-
-            return variables[index];
-        }
-
-        public static bool GetSemantics(MethodDefinition self, MethodSemanticsAttributes semantics)
-        {
-            return (self.SemanticsAttributes & semantics) != 0;
-        }
-
-        public static void SetSemantics(MethodDefinition self, MethodSemanticsAttributes semantics, bool value)
-        {
-            if (value)
-                self.SemanticsAttributes |= semantics;
-            else
-                self.SemanticsAttributes &= ~semantics;
-        }
-    }
-}

+ 0 - 53
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MethodImplAttributes.cs

@@ -1,53 +0,0 @@
-//
-// MethodImplAttributes.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	[Flags]
-	public enum MethodImplAttributes : ushort {
-		CodeTypeMask		= 0x0003,
-		IL					= 0x0000,	// Method impl is CIL
-		Native				= 0x0001,	// Method impl is native
-		OPTIL				= 0x0002,	// Reserved: shall be zero in conforming implementations
-		Runtime				= 0x0003,	// Method impl is provided by the runtime
-
-		ManagedMask			= 0x0004,	// Flags specifying whether the code is managed or unmanaged
-		Unmanaged			= 0x0004,	// Method impl is unmanaged, otherwise managed
-		Managed				= 0x0000,	// Method impl is managed
-
-		// Implementation info and interop
-		ForwardRef			= 0x0010,	// Indicates method is defined; used primarily in merge scenarios
-		PreserveSig			= 0x0080,	// Reserved: conforming implementations may ignore
-		InternalCall		= 0x1000,	// Reserved: shall be zero in conforming implementations
-		Synchronized		= 0x0020,	// Method is single threaded through the body
-		NoOptimization		= 0x0040,	// Method is not optimized by the JIT.
-		NoInlining			= 0x0008,	// Method may not be inlined
-	}
-}

+ 0 - 247
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MethodReference.cs

@@ -1,247 +0,0 @@
-//
-// MethodReference.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil
-{
-
-    public class MethodReference : MemberReference, IMethodSignature, IGenericParameterProvider, IGenericContext
-    {
-        int hashCode = -1;
-        static int instance_id;
-        internal ParameterDefinitionCollection parameters;
-        MethodReturnType return_type;
-
-        bool has_this;
-        bool explicit_this;
-        MethodCallingConvention calling_convention;
-        internal Collection<GenericParameter> generic_parameters;
-
-        public virtual bool HasThis
-        {
-            get { return has_this; }
-            set { has_this = value; }
-        }
-
-        public virtual bool ExplicitThis
-        {
-            get { return explicit_this; }
-            set { explicit_this = value; }
-        }
-
-        public virtual MethodCallingConvention CallingConvention
-        {
-            get { return calling_convention; }
-            set { calling_convention = value; }
-        }
-
-        public virtual bool HasParameters
-        {
-            get { return !Mixin.IsNullOrEmpty(parameters); }
-        }
-
-        public virtual Collection<ParameterDefinition> Parameters
-        {
-            get
-            {
-                if (parameters == null)
-                    parameters = new ParameterDefinitionCollection(this);
-
-                return parameters;
-            }
-        }
-
-        IGenericParameterProvider IGenericContext.Type
-        {
-            get
-            {
-                var declaring_type = this.DeclaringType;
-                var instance = declaring_type as GenericInstanceType;
-                if (instance != null)
-                    return instance.ElementType;
-
-                return declaring_type;
-            }
-        }
-
-        IGenericParameterProvider IGenericContext.Method
-        {
-            get { return this; }
-        }
-
-        GenericParameterType IGenericParameterProvider.GenericParameterType
-        {
-            get { return GenericParameterType.Method; }
-        }
-
-        public virtual bool HasGenericParameters
-        {
-            get { return !Mixin.IsNullOrEmpty(generic_parameters); }
-        }
-
-        public virtual Collection<GenericParameter> GenericParameters
-        {
-            get
-            {
-                if (generic_parameters != null)
-                    return generic_parameters;
-
-                return generic_parameters = new GenericParameterCollection(this);
-            }
-        }
-
-        public TypeReference ReturnType
-        {
-            get
-            {
-                var return_type = MethodReturnType;
-                return return_type != null ? return_type.ReturnType : null;
-            }
-            set
-            {
-                var return_type = MethodReturnType;
-                if (return_type != null)
-                    return_type.ReturnType = value;
-            }
-        }
-
-        public virtual MethodReturnType MethodReturnType
-        {
-            get { return return_type; }
-            set { return_type = value; }
-        }
-
-        public override string FullName
-        {
-            get
-            {
-                var builder = new StringBuilder();
-                builder.Append(ReturnType.FullName)
-                    .Append(" ")
-                    .Append(MemberFullName());
-                Mixin.MethodSignatureFullName(this, builder);
-                return builder.ToString();
-            }
-        }
-
-        public override int GetHashCode()
-        {
-            if (hashCode == -1)
-                hashCode = System.Threading.Interlocked.Add(ref instance_id, 1);
-            return hashCode;
-        }
-
-        public virtual bool IsGenericInstance
-        {
-            get { return false; }
-        }
-
-        public override bool ContainsGenericParameter
-        {
-            get
-            {
-                if (this.ReturnType.ContainsGenericParameter || base.ContainsGenericParameter)
-                    return true;
-
-                var parameters = this.Parameters;
-
-                for (int i = 0; i < parameters.Count; i++)
-                    if (parameters[i].ParameterType.ContainsGenericParameter)
-                        return true;
-
-                return false;
-            }
-        }
-
-        internal MethodReference()
-        {
-            this.return_type = new MethodReturnType(this);
-            this.token = new MetadataToken(TokenType.MemberRef);
-        }
-
-        public MethodReference(string name, TypeReference returnType)
-            : base(name)
-        {
-            if (returnType == null)
-                throw new ArgumentNullException("returnType");
-
-            this.return_type = new MethodReturnType(this);
-            this.return_type.ReturnType = returnType;
-            this.token = new MetadataToken(TokenType.MemberRef);
-        }
-
-        public MethodReference(string name, TypeReference returnType, TypeReference declaringType)
-            : this(name, returnType)
-        {
-            if (declaringType == null)
-                throw new ArgumentNullException("declaringType");
-
-            this.DeclaringType = declaringType;
-        }
-
-        public virtual MethodReference GetElementMethod()
-        {
-            return this;
-        }
-
-        public virtual MethodDefinition Resolve()
-        {
-            var module = this.Module;
-            if (module == null)
-                throw new NotSupportedException();
-
-            return module.Resolve(this);
-        }
-    }
-
-    static partial class Mixin
-    {
-
-        public static bool IsVarArg(IMethodSignature self)
-        {
-            return (self.CallingConvention & MethodCallingConvention.VarArg) != 0;
-        }
-
-        public static int GetSentinelPosition(IMethodSignature self)
-        {
-            if (!self.HasParameters)
-                return -1;
-
-            var parameters = self.Parameters;
-            for (int i = 0; i < parameters.Count; i++)
-                if (parameters[i].ParameterType.IsSentinel)
-                    return i;
-
-            return -1;
-        }
-    }
-}

+ 0 - 43
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/MethodSemanticsAttributes.cs

@@ -1,43 +0,0 @@
-//
-// MethodSemanticsattributes.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	[Flags]
-	public enum MethodSemanticsAttributes : ushort {
-		None		= 0x0000,
-		Setter		= 0x0001,	// Setter for property
-		Getter		= 0x0002,	// Getter for property
-		Other		= 0x0004,	// Other method for property or event
-		AddOn		= 0x0008,	// AddOn method for event
-		RemoveOn	= 0x0010,	// RemoveOn method for event
-		Fire		= 0x0020	 // Fire method for event
-	}
-}

+ 0 - 755
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ModuleDefinition.cs

@@ -1,755 +0,0 @@
-//
-// ModuleDefinition.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using SR = System.Reflection;
-using Mono.Cecil.Cil;
-using Mono.Cecil.Metadata;
-using Mono.Cecil.PE;
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil
-{
-
-    public enum ReadingMode
-    {
-        Immediate = 1,
-        Deferred = 2,
-    }
-
-    public sealed class ReaderParameters
-    {
-
-        ReadingMode reading_mode;
-        IAssemblyResolver assembly_resolver;
-        IMetadataResolver metadata_resolver;
-        Stream symbol_stream;
-        ISymbolReaderProvider symbol_reader_provider;
-        bool read_symbols;
-
-        public ReadingMode ReadingMode
-        {
-            get { return reading_mode; }
-            set { reading_mode = value; }
-        }
-
-        public IAssemblyResolver AssemblyResolver
-        {
-            get { return assembly_resolver; }
-            set { assembly_resolver = value; }
-        }
-
-        public IMetadataResolver MetadataResolver
-        {
-            get { return metadata_resolver; }
-            set { metadata_resolver = value; }
-        }
-
-        public Stream SymbolStream
-        {
-            get { return symbol_stream; }
-            set { symbol_stream = value; }
-        }
-
-        public ISymbolReaderProvider SymbolReaderProvider
-        {
-            get { return symbol_reader_provider; }
-            set { symbol_reader_provider = value; }
-        }
-
-        public bool ReadSymbols
-        {
-            get { return read_symbols; }
-            set { read_symbols = value; }
-        }
-
-        public ReaderParameters()
-            : this(ReadingMode.Deferred)
-        {
-        }
-
-        public ReaderParameters(ReadingMode readingMode)
-        {
-            this.reading_mode = readingMode;
-        }
-    }
-
-
-    public sealed class ModuleDefinition : ModuleReference, ICustomAttributeProvider
-    {
-
-        internal Image Image;
-        internal MetadataSystem MetadataSystem;
-        internal ReadingMode ReadingMode;
-        internal ISymbolReaderProvider SymbolReaderProvider;
-
-        internal ISymbolReader symbol_reader;
-        internal IAssemblyResolver assembly_resolver;
-        internal IMetadataResolver metadata_resolver;
-        internal TypeSystem type_system;
-
-        readonly MetadataReader reader;
-        readonly string fq_name;
-
-        internal ModuleKind kind;
-        TargetRuntime runtime;
-        TargetArchitecture architecture;
-        ModuleAttributes attributes;
-        ModuleCharacteristics characteristics;
-        Guid mvid;
-
-        internal AssemblyDefinition assembly;
-        MethodDefinition entry_point;
-
-        Collection<CustomAttribute> custom_attributes;
-        Collection<AssemblyNameReference> references;
-        Collection<ModuleReference> modules;
-        Collection<Resource> resources;
-        Collection<ExportedType> exported_types;
-        TypeDefinitionCollection types;
-
-        public bool IsMain
-        {
-            get { return kind != ModuleKind.NetModule; }
-        }
-
-        public ModuleKind Kind
-        {
-            get { return kind; }
-            set { kind = value; }
-        }
-
-        public TargetRuntime Runtime
-        {
-            get { return runtime; }
-            set { runtime = value; }
-        }
-
-        public TargetArchitecture Architecture
-        {
-            get { return architecture; }
-            set { architecture = value; }
-        }
-
-        public ModuleAttributes Attributes
-        {
-            get { return attributes; }
-            set { attributes = value; }
-        }
-
-        public ModuleCharacteristics Characteristics
-        {
-            get { return characteristics; }
-            set { characteristics = value; }
-        }
-
-        public string FullyQualifiedName
-        {
-            get { return fq_name; }
-        }
-
-        public Guid Mvid
-        {
-            get { return mvid; }
-            set { mvid = value; }
-        }
-
-        internal bool HasImage
-        {
-            get { return Image != null; }
-        }
-
-        public bool HasSymbols
-        {
-            get { return symbol_reader != null; }
-        }
-
-        public ISymbolReader SymbolReader
-        {
-            get { return symbol_reader; }
-        }
-
-        public override MetadataScopeType MetadataScopeType
-        {
-            get { return MetadataScopeType.ModuleDefinition; }
-        }
-
-        public AssemblyDefinition Assembly
-        {
-            get { return assembly; }
-        }
-
-
-        public IAssemblyResolver AssemblyResolver
-        {
-            get { return assembly_resolver ?? (assembly_resolver = new DefaultAssemblyResolver()); }
-        }
-
-        public IMetadataResolver MetadataResolver
-        {
-            get
-            {
-                if (metadata_resolver == null)
-                    metadata_resolver=new MetadataResolver(this.AssemblyResolver);
-
-                return metadata_resolver;
-            }
-        }
-
-        public TypeSystem TypeSystem
-        {
-            get
-            {
-                if (type_system == null)
-                    type_system = TypeSystem.CreateTypeSystem(this);
-                return type_system;
-            }
-        }
-
-        public bool HasAssemblyReferences
-        {
-            get
-            {
-                if (references != null)
-                    return references.Count > 0;
-
-                return HasImage && Image.HasTable(Table.AssemblyRef);
-            }
-        }
-
-        public Collection<AssemblyNameReference> AssemblyReferences
-        {
-            get
-            {
-                if (references != null)
-                    return references;
-
-                if (HasImage)
-                    return Read(ref references, this, (_, reader) => reader.ReadAssemblyReferences());
-
-                return references = new Collection<AssemblyNameReference>();
-            }
-        }
-
-        public bool HasModuleReferences
-        {
-            get
-            {
-                if (modules != null)
-                    return modules.Count > 0;
-
-                return HasImage && Image.HasTable(Table.ModuleRef);
-            }
-        }
-
-        public Collection<ModuleReference> ModuleReferences
-        {
-            get
-            {
-                if (modules != null)
-                    return modules;
-
-                if (HasImage)
-                    return Read(ref modules, this, (_, reader) => reader.ReadModuleReferences());
-
-                return modules = new Collection<ModuleReference>();
-            }
-        }
-
-        public bool HasResources
-        {
-            get
-            {
-                if (resources != null)
-                    return resources.Count > 0;
-
-                if (HasImage)
-                    return Image.HasTable(Table.ManifestResource) || Read(this, (_, reader) => reader.HasFileResource());
-
-                return false;
-            }
-        }
-
-        public Collection<Resource> Resources
-        {
-            get
-            {
-                if (resources != null)
-                    return resources;
-
-                if (HasImage)
-                    return Read(ref resources, this, (_, reader) => reader.ReadResources());
-
-                return resources = new Collection<Resource>();
-            }
-        }
-
-        public bool HasCustomAttributes
-        {
-            get
-            {
-                if (custom_attributes != null)
-                    return custom_attributes.Count > 0;
-
-                return Mixin.GetHasCustomAttributes(this, this);
-            }
-        }
-
-        public Collection<CustomAttribute> CustomAttributes
-        {
-            get { return custom_attributes ?? (Mixin.GetCustomAttributes(this, ref custom_attributes, this)); }
-        }
-
-        public bool HasTypes
-        {
-            get
-            {
-                if (types != null)
-                    return types.Count > 0;
-
-                return HasImage && Image.HasTable(Table.TypeDef);
-            }
-        }
-
-        public Collection<TypeDefinition> Types
-        {
-            get
-            {
-                if (types != null)
-                    return types;
-
-                if (HasImage)
-                    return Read(ref types, this, (_, reader) => reader.ReadTypes());
-
-                return types = new TypeDefinitionCollection(this);
-            }
-        }
-
-        public bool HasExportedTypes
-        {
-            get
-            {
-                if (exported_types != null)
-                    return exported_types.Count > 0;
-
-                return HasImage && Image.HasTable(Table.ExportedType);
-            }
-        }
-
-        public Collection<ExportedType> ExportedTypes
-        {
-            get
-            {
-                if (exported_types != null)
-                    return exported_types;
-
-                if (HasImage)
-                    return Read(ref exported_types, this, (_, reader) => reader.ReadExportedTypes());
-
-                return exported_types = new Collection<ExportedType>();
-            }
-        }
-
-        public MethodDefinition EntryPoint
-        {
-            get
-            {
-                if (entry_point != null)
-                    return entry_point;
-
-                if (HasImage)
-                    return Read(ref entry_point, this, (_, reader) => reader.ReadEntryPoint());
-
-                return entry_point = null;
-            }
-            set { entry_point = value; }
-        }
-
-        internal ModuleDefinition()
-        {
-            this.MetadataSystem = new MetadataSystem();
-            this.token = new MetadataToken(TokenType.Module, 1);
-        }
-
-        internal ModuleDefinition(Image image)
-            : this()
-        {
-            this.Image = image;
-            this.kind = image.Kind;
-            this.runtime = image.Runtime;
-            this.architecture = image.Architecture;
-            this.attributes = image.Attributes;
-            this.characteristics = image.Characteristics;
-            this.fq_name = image.FileName;
-
-            this.reader = new MetadataReader(this);
-        }
-
-        public bool HasTypeReference(string fullName)
-        {
-            return HasTypeReference(string.Empty, fullName);
-        }
-
-        public bool HasTypeReference(string scope, string fullName)
-        {
-            CheckFullName(fullName);
-
-            if (!HasImage)
-                return false;
-
-            return GetTypeReference(scope, fullName) != null;
-        }
-
-        public bool TryGetTypeReference(string fullName, out TypeReference type)
-        {
-            return TryGetTypeReference(string.Empty, fullName, out type);
-        }
-
-        public bool TryGetTypeReference(string scope, string fullName, out TypeReference type)
-        {
-            CheckFullName(fullName);
-
-            if (!HasImage)
-            {
-                type = null;
-                return false;
-            }
-
-            return (type = GetTypeReference(scope, fullName)) != null;
-        }
-
-        TypeReference GetTypeReference(string scope, string fullname)
-        {
-            return Read(new Row<string, string>(scope, fullname), (row, reader) => reader.GetTypeReference(row.Col1, row.Col2));
-        }
-
-        public IEnumerable<TypeReference> GetTypeReferences()
-        {
-            if (!HasImage)
-                return Empty<TypeReference>.Array;
-
-            return Read(this, (_, reader) => reader.GetTypeReferences());
-        }
-
-        public IEnumerable<MemberReference> GetMemberReferences()
-        {
-            if (!HasImage)
-                return Empty<MemberReference>.Array;
-
-            return Read(this, (_, reader) => reader.GetMemberReferences());
-        }
-
-        public TypeReference GetType(string fullName, bool runtimeName)
-        {
-            return runtimeName
-                ? TypeParser.ParseType(this, fullName)
-                : GetType(fullName);
-        }
-
-        public TypeDefinition GetType(string fullName)
-        {
-            CheckFullName(fullName);
-
-            var position = fullName.IndexOf('/');
-            if (position > 0)
-                return GetNestedType(fullName);
-
-            return ((TypeDefinitionCollection)this.Types).GetType(fullName);
-        }
-
-        public TypeDefinition GetType(string @namespace, string name)
-        {
-            Mixin.CheckName(name);
-
-            return ((TypeDefinitionCollection)this.Types).GetType(@namespace ?? string.Empty, name);
-        }
-
-        public IEnumerable<TypeDefinition> GetTypes()
-        {
-            return GetTypes(Types);
-        }
-
-        static IEnumerable<TypeDefinition> GetTypes(Collection<TypeDefinition> types)
-        {
-            for (int i = 0; i < types.Count; i++)
-            {
-                var type = types[i];
-
-                yield return type;
-
-                if (!type.HasNestedTypes)
-                    continue;
-
-                foreach (var nested in GetTypes(type.NestedTypes))
-                    yield return nested;
-            }
-        }
-
-        static void CheckFullName(string fullName)
-        {
-            if (fullName == null)
-                throw new ArgumentNullException("fullName");
-            if (fullName.Length == 0)
-                throw new ArgumentException();
-        }
-
-        TypeDefinition GetNestedType(string fullname)
-        {
-            var names = fullname.Split('/');
-            var type = GetType(names[0]);
-
-            if (type == null)
-                return null;
-
-            for (int i = 1; i < names.Length; i++)
-            {
-                var nested_type = Mixin.GetNestedType(type, names[i]);
-                if (nested_type == null)
-                    return null;
-
-                type = nested_type;
-            }
-
-            return type;
-        }
-
-        internal FieldDefinition Resolve(FieldReference field)
-        {
-            return MetadataResolver.Resolve(field);
-        }
-
-        internal MethodDefinition Resolve(MethodReference method)
-        {
-            return MetadataResolver.Resolve(method);
-        }
-
-        internal TypeDefinition Resolve(TypeReference type)
-        {
-            return MetadataResolver.Resolve(type);
-        }
-
-
-        public IMetadataTokenProvider LookupToken(int token)
-        {
-            return LookupToken(new MetadataToken((uint)token));
-        }
-
-        public IMetadataTokenProvider LookupToken(MetadataToken token)
-        {
-            return Read(token, (t, reader) => reader.LookupToken(t));
-        }
-
-        readonly object module_lock = new object();
-
-        internal object SyncRoot
-        {
-            get { return module_lock; }
-        }
-
-        internal TRet Read<TItem, TRet>(TItem item, Func<TItem, MetadataReader, TRet> read)
-        {
-            lock (module_lock)
-            {
-                var position = reader.position;
-                var context = reader.context;
-
-                var ret = read(item, reader);
-
-                reader.position = position;
-                reader.context = context;
-
-                return ret;
-            }
-        }
-
-        internal TRet Read<TItem, TRet>(ref TRet variable, TItem item, Func<TItem, MetadataReader, TRet> read) where TRet : class
-        {
-            lock (module_lock)
-            {
-                if (variable != null)
-                    return variable;
-
-                var position = reader.position;
-                var context = reader.context;
-
-                var ret = read(item, reader);
-
-                reader.position = position;
-                reader.context = context;
-
-                return variable = ret;
-            }
-        }
-
-        public bool HasDebugHeader
-        {
-            get { return Image != null && !Image.Debug.IsZero; }
-        }
-
-        public ImageDebugDirectory GetDebugHeader(out byte[] header)
-        {
-            if (!HasDebugHeader)
-                throw new InvalidOperationException();
-
-            return Image.GetDebugHeader(out header);
-        }
-
-        void ProcessDebugHeader()
-        {
-            if (!HasDebugHeader)
-                return;
-
-            byte[] header;
-            var directory = GetDebugHeader(out header);
-
-            if (!symbol_reader.ProcessDebugHeader(directory, header))
-                throw new InvalidOperationException();
-        }
-
-
-
-        public void ReadSymbols()
-        {
-            if (string.IsNullOrEmpty(fq_name))
-                throw new InvalidOperationException();
-
-            var provider = SymbolProvider.GetPlatformReaderProvider();
-            if (provider == null)
-                throw new InvalidOperationException();
-
-            ReadSymbols(provider.GetSymbolReader(this, fq_name));
-        }
-
-        public void ReadSymbols(ISymbolReader reader)
-        {
-            if (reader == null)
-                throw new ArgumentNullException("reader");
-
-            symbol_reader = reader;
-
-            ProcessDebugHeader();
-        }
-
-        public static ModuleDefinition ReadModule(string fileName)
-        {
-            return ReadModule(fileName, new ReaderParameters(ReadingMode.Deferred));
-        }
-
-        public static ModuleDefinition ReadModule(Stream stream)
-        {
-            return ReadModule(stream, new ReaderParameters(ReadingMode.Deferred));
-        }
-
-        public static ModuleDefinition ReadModule(string fileName, ReaderParameters parameters)
-        {
-            using (var stream = GetFileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read))
-            {
-                return ReadModule(stream, parameters);
-            }
-        }
-
-        static void CheckStream(object stream)
-        {
-            if (stream == null)
-                throw new ArgumentNullException("stream");
-        }
-
-        public static ModuleDefinition ReadModule(Stream stream, ReaderParameters parameters)
-        {
-            CheckStream(stream);
-            if (!stream.CanRead || !stream.CanSeek)
-                throw new ArgumentException();
-            Mixin.CheckParameters(parameters);
-
-            return ModuleReader.CreateModuleFrom(
-                ImageReader.ReadImageFrom(stream),
-                parameters);
-        }
-
-        static Stream GetFileStream(string fileName, FileMode mode, FileAccess access, FileShare share)
-        {
-            if (fileName == null)
-                throw new ArgumentNullException("fileName");
-            if (fileName.Length == 0)
-                throw new ArgumentException();
-
-            return new FileStream(fileName, mode, access, share);
-        }
-
-
-
-    }
-
-    static partial class Mixin
-    {
-
-        public static void CheckParameters(object parameters)
-        {
-            if (parameters == null)
-                throw new ArgumentNullException("parameters");
-        }
-
-        public static bool HasImage(ModuleDefinition self)
-        {
-            return self != null && self.HasImage;
-        }
-
-        public static bool IsCorlib(ModuleDefinition module)
-        {
-            if (module.Assembly == null)
-                return false;
-
-            return module.Assembly.Name.Name == "mscorlib";
-        }
-
-        public static string GetFullyQualifiedName(Stream self)
-        {
-
-            return string.Empty;
-        }
-
-        public static TargetRuntime ParseRuntime(string self)
-        {
-            switch (self[1])
-            {
-                case '1':
-                    return self[3] == '0'
-                        ? TargetRuntime.Net_1_0
-                        : TargetRuntime.Net_1_1;
-                case '2':
-                    return TargetRuntime.Net_2_0;
-                case '4':
-                default:
-                    return TargetRuntime.Net_4_0;
-            }
-        }
-    }
-}

+ 0 - 64
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ModuleKind.cs

@@ -1,64 +0,0 @@
-//
-// ModuleKind.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	public enum ModuleKind {
-		Dll,
-		Console,
-		Windows,
-		NetModule,
-	}
-
-	public enum TargetArchitecture {
-		I386,
-		AMD64,
-		IA64,
-		ARMv7,
-	}
-
-	[Flags]
-	public enum ModuleAttributes {
-		ILOnly = 1,
-		Required32Bit = 2,
-		StrongNameSigned = 8,
-		Preferred32Bit = 0x00020000,
-	}
-
-	[Flags]
-	public enum ModuleCharacteristics {
-		HighEntropyVA = 0x0020,
-		DynamicBase = 0x0040,
-		NoSEH = 0x0400,
-		NXCompat = 0x0100,
-		AppContainer = 0x1000,
-		TerminalServerAware = 0x8000,
-	}
-}

+ 0 - 67
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ModuleReference.cs

@@ -1,67 +0,0 @@
-//
-// ModuleReference.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-	public class ModuleReference : IMetadataScope {
-
-		string name;
-
-		internal MetadataToken token;
-
-		public string Name {
-			get { return name; }
-			set { name = value; }
-		}
-
-		public virtual MetadataScopeType MetadataScopeType {
-			get { return MetadataScopeType.ModuleReference; }
-		}
-
-		public MetadataToken MetadataToken {
-			get { return token; }
-			set { token = value; }
-		}
-
-		internal ModuleReference ()
-		{
-			this.token = new MetadataToken (TokenType.ModuleRef);
-		}
-
-		public ModuleReference (string name)
-			: this ()
-		{
-			this.name = name;
-		}
-
-		public override string ToString ()
-		{
-			return name;
-		}
-	}
-}

+ 0 - 73
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/NativeType.cs

@@ -1,73 +0,0 @@
-//
-// NativeType.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-	public enum NativeType {
-		None = 0x66,
-
-		Boolean = 0x02,
-		I1 = 0x03,
-		U1 = 0x04,
-		I2 = 0x05,
-		U2 = 0x06,
-		I4 = 0x07,
-		U4 = 0x08,
-		I8 = 0x09,
-		U8 = 0x0a,
-		R4 = 0x0b,
-		R8 = 0x0c,
-		LPStr = 0x14,
-		Int = 0x1f,
-		UInt = 0x20,
-		Func = 0x26,
-		Array = 0x2a,
-
-		// Msft specific
-		Currency = 0x0f,
-		BStr = 0x13,
-		LPWStr = 0x15,
-		LPTStr = 0x16,
-		FixedSysString = 0x17,
-		IUnknown = 0x19,
-		IDispatch = 0x1a,
-		Struct = 0x1b,
-		IntF = 0x1c,
-		SafeArray = 0x1d,
-		FixedArray = 0x1e,
-		ByValStr = 0x22,
-		ANSIBStr = 0x23,
-		TBStr = 0x24,
-		VariantBool = 0x25,
-		ASAny = 0x28,
-		LPStruct = 0x2b,
-		CustomMarshaler = 0x2c,
-		Error = 0x2d,
-		Max = 0x50
-	}
-}

+ 0 - 62
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PInvokeAttributes.cs

@@ -1,62 +0,0 @@
-//
-// PInvokeAttributes.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	[Flags]
-	public enum PInvokeAttributes : ushort {
-		NoMangle			= 0x0001,	// PInvoke is to use the member name as specified
-
-		// Character set
-		CharSetMask			= 0x0006,
-		CharSetNotSpec		= 0x0000,
-		CharSetAnsi			= 0x0002,
-		CharSetUnicode		= 0x0004,
-		CharSetAuto			= 0x0006,
-
-		SupportsLastError	= 0x0040,	// Information about target function. Not relevant for fields
-
-		// Calling convetion
-		CallConvMask		= 0x0700,
-		CallConvWinapi		= 0x0100,
-		CallConvCdecl		= 0x0200,
-		CallConvStdCall		= 0x0300,
-		CallConvThiscall	= 0x0400,
-		CallConvFastcall	= 0x0500,
-
-		BestFitMask			= 0x0030,
-		BestFitEnabled		= 0x0010,
-		BestFitDisabled		= 0x0020,
-
-		ThrowOnUnmappableCharMask = 0x3000,
-		ThrowOnUnmappableCharEnabled = 0x1000,
-		ThrowOnUnmappableCharDisabled = 0x2000,
-	}
-}

+ 0 - 138
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PInvokeInfo.cs

@@ -1,138 +0,0 @@
-//
-// PInvokeInfo.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-	public sealed class PInvokeInfo {
-
-		ushort attributes;
-		string entry_point;
-		ModuleReference module;
-
-		public PInvokeAttributes Attributes {
-			get { return (PInvokeAttributes) attributes; }
-			set { attributes = (ushort) value; }
-		}
-
-		public string EntryPoint {
-			get { return entry_point; }
-			set { entry_point = value; }
-		}
-
-		public ModuleReference Module {
-			get { return module; }
-			set { module = value; }
-		}
-
-		#region PInvokeAttributes
-
-		public bool IsNoMangle {
-			get { return Mixin.GetAttributes(attributes,(ushort) PInvokeAttributes.NoMangle); }
-			set { attributes =Mixin.SetAttributes(attributes,(ushort) PInvokeAttributes.NoMangle, value); }
-		}
-
-		public bool IsCharSetNotSpec {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CharSetMask, (ushort) PInvokeAttributes.CharSetNotSpec); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CharSetMask, (ushort) PInvokeAttributes.CharSetNotSpec, value); }
-		}
-
-		public bool IsCharSetAnsi {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CharSetMask, (ushort) PInvokeAttributes.CharSetAnsi); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CharSetMask, (ushort) PInvokeAttributes.CharSetAnsi, value); }
-		}
-
-		public bool IsCharSetUnicode {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CharSetMask, (ushort) PInvokeAttributes.CharSetUnicode); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CharSetMask, (ushort) PInvokeAttributes.CharSetUnicode, value); }
-		}
-
-		public bool IsCharSetAuto {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CharSetMask, (ushort) PInvokeAttributes.CharSetAuto); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CharSetMask, (ushort) PInvokeAttributes.CharSetAuto, value); }
-		}
-
-		public bool SupportsLastError {
-			get { return Mixin.GetAttributes(attributes,(ushort) PInvokeAttributes.SupportsLastError); }
-			set { attributes =Mixin.SetAttributes(attributes,(ushort) PInvokeAttributes.SupportsLastError, value); }
-		}
-
-		public bool IsCallConvWinapi {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CallConvMask, (ushort) PInvokeAttributes.CallConvWinapi); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CallConvMask, (ushort) PInvokeAttributes.CallConvWinapi, value); }
-		}
-
-		public bool IsCallConvCdecl {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CallConvMask, (ushort) PInvokeAttributes.CallConvCdecl); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CallConvMask, (ushort) PInvokeAttributes.CallConvCdecl, value); }
-		}
-
-		public bool IsCallConvStdCall {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CallConvMask, (ushort) PInvokeAttributes.CallConvStdCall); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CallConvMask, (ushort) PInvokeAttributes.CallConvStdCall, value); }
-		}
-
-		public bool IsCallConvThiscall {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CallConvMask, (ushort) PInvokeAttributes.CallConvThiscall); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CallConvMask, (ushort) PInvokeAttributes.CallConvThiscall, value); }
-		}
-
-		public bool IsCallConvFastcall {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CallConvMask, (ushort) PInvokeAttributes.CallConvFastcall); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.CallConvMask, (ushort) PInvokeAttributes.CallConvFastcall, value); }
-		}
-
-		public bool IsBestFitEnabled {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.BestFitMask, (ushort) PInvokeAttributes.BestFitEnabled); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.BestFitMask, (ushort) PInvokeAttributes.BestFitEnabled, value); }
-		}
-
-		public bool IsBestFitDisabled {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.BestFitMask, (ushort) PInvokeAttributes.BestFitDisabled); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.BestFitMask, (ushort) PInvokeAttributes.BestFitDisabled, value); }
-		}
-
-		public bool IsThrowOnUnmappableCharEnabled {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.ThrowOnUnmappableCharMask, (ushort) PInvokeAttributes.ThrowOnUnmappableCharEnabled); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.ThrowOnUnmappableCharMask, (ushort) PInvokeAttributes.ThrowOnUnmappableCharEnabled, value); }
-		}
-
-		public bool IsThrowOnUnmappableCharDisabled {
-			get { return Mixin.GetMaskedAttributes(attributes,(ushort) PInvokeAttributes.ThrowOnUnmappableCharMask, (ushort) PInvokeAttributes.ThrowOnUnmappableCharDisabled); }
-			set { attributes = Mixin.SetMaskedAttributes(attributes,(ushort) PInvokeAttributes.ThrowOnUnmappableCharMask, (ushort) PInvokeAttributes.ThrowOnUnmappableCharDisabled, value); }
-		}
-
-		#endregion
-
-		public PInvokeInfo (PInvokeAttributes attributes, string entryPoint, ModuleReference module)
-		{
-			this.attributes = (ushort) attributes;
-			this.entry_point = entryPoint;
-			this.module = module;
-		}
-	}
-}

+ 0 - 45
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ParameterAttributes.cs

@@ -1,45 +0,0 @@
-//
-// ParameterAttributes.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	[Flags]
-	public enum ParameterAttributes : ushort {
-		None				= 0x0000,
-		In					= 0x0001,	// Param is [In]
-		Out					= 0x0002,	// Param is [Out]
-		Lcid				= 0x0004,
-		Retval				= 0x0008,
-		Optional			= 0x0010,	// Param is optional
-		HasDefault			= 0x1000,	// Param has default value
-		HasFieldMarshal		= 0x2000,	// Param has field marshal
-		Unused				= 0xcfe0	 // Reserved: shall be zero in a conforming implementation
-	}
-}

+ 0 - 186
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ParameterDefinition.cs

@@ -1,186 +0,0 @@
-//
-// ParameterDefinition.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil
-{
-
-    public sealed class ParameterDefinition : ParameterReference, ICustomAttributeProvider, IConstantProvider, IMarshalInfoProvider
-    {
-
-        ushort attributes;
-
-        internal IMethodSignature method;
-
-        object constant = Mixin.NotResolved;
-        Collection<CustomAttribute> custom_attributes;
-        MarshalInfo marshal_info;
-
-        public ParameterAttributes Attributes
-        {
-            get { return (ParameterAttributes)attributes; }
-            set { attributes = (ushort)value; }
-        }
-
-        public IMethodSignature Method
-        {
-            get { return method; }
-        }
-
-        public int Sequence
-        {
-            get
-            {
-                if (method == null)
-                    return -1;
-
-                return Mixin.HasImplicitThis(method) ? index + 1 : index;
-            }
-        }
-
-        public bool HasConstant
-        {
-            get
-            {
-                Mixin.ResolveConstant(this, ref constant, parameter_type.Module);
-
-                return constant != Mixin.NoValue;
-            }
-            set { if (!value) constant = Mixin.NoValue; }
-        }
-
-        public object Constant
-        {
-            get { return HasConstant ? constant : null; }
-            set { constant = value; }
-        }
-
-        public bool HasCustomAttributes
-        {
-            get
-            {
-                if (custom_attributes != null)
-                    return custom_attributes.Count > 0;
-
-                return Mixin.GetHasCustomAttributes(this, parameter_type.Module);
-            }
-        }
-
-        public Collection<CustomAttribute> CustomAttributes
-        {
-            get { return custom_attributes ?? (Mixin.GetCustomAttributes(this, ref custom_attributes, parameter_type.Module)); }
-        }
-
-        public bool HasMarshalInfo
-        {
-            get
-            {
-                if (marshal_info != null)
-                    return true;
-
-                return Mixin.GetHasMarshalInfo(this, parameter_type.Module);
-            }
-        }
-
-        public MarshalInfo MarshalInfo
-        {
-            get { return marshal_info ?? (Mixin.GetMarshalInfo(this, ref marshal_info, parameter_type.Module)); }
-            set { marshal_info = value; }
-        }
-
-        #region ParameterAttributes
-
-        public bool IsIn
-        {
-            get { return Mixin.GetAttributes(attributes, (ushort)ParameterAttributes.In); }
-            set { attributes = Mixin.SetAttributes(attributes, (ushort)ParameterAttributes.In, value); }
-        }
-
-        public bool IsOut
-        {
-            get { return Mixin.GetAttributes(attributes, (ushort)ParameterAttributes.Out); }
-            set { attributes = Mixin.SetAttributes(attributes, (ushort)ParameterAttributes.Out, value); }
-        }
-
-        public bool IsLcid
-        {
-            get { return Mixin.GetAttributes(attributes, (ushort)ParameterAttributes.Lcid); }
-            set { attributes = Mixin.SetAttributes(attributes, (ushort)ParameterAttributes.Lcid, value); }
-        }
-
-        public bool IsReturnValue
-        {
-            get { return Mixin.GetAttributes(attributes, (ushort)ParameterAttributes.Retval); }
-            set { attributes = Mixin.SetAttributes(attributes, (ushort)ParameterAttributes.Retval, value); }
-        }
-
-        public bool IsOptional
-        {
-            get { return Mixin.GetAttributes(attributes, (ushort)ParameterAttributes.Optional); }
-            set { attributes = Mixin.SetAttributes(attributes, (ushort)ParameterAttributes.Optional, value); }
-        }
-
-        public bool HasDefault
-        {
-            get { return Mixin.GetAttributes(attributes, (ushort)ParameterAttributes.HasDefault); }
-            set { attributes = Mixin.SetAttributes(attributes, (ushort)ParameterAttributes.HasDefault, value); }
-        }
-
-        public bool HasFieldMarshal
-        {
-            get { return Mixin.GetAttributes(attributes, (ushort)ParameterAttributes.HasFieldMarshal); }
-            set { attributes = Mixin.SetAttributes(attributes, (ushort)ParameterAttributes.HasFieldMarshal, value); }
-        }
-
-        #endregion
-
-        internal ParameterDefinition(TypeReference parameterType, IMethodSignature method)
-            : this(string.Empty, ParameterAttributes.None, parameterType)
-        {
-            this.method = method;
-        }
-
-        public ParameterDefinition(TypeReference parameterType)
-            : this(string.Empty, ParameterAttributes.None, parameterType)
-        {
-        }
-
-        public ParameterDefinition(string name, ParameterAttributes attributes, TypeReference parameterType)
-            : base(name, parameterType)
-        {
-            this.attributes = (ushort)attributes;
-            this.token = new MetadataToken(TokenType.Param);
-        }
-
-        public override ParameterDefinition Resolve()
-        {
-            return this;
-        }
-    }
-}

+ 0 - 80
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ParameterDefinitionCollection.cs

@@ -1,80 +0,0 @@
-//
-// ParameterDefinitionCollection.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil {
-
-	sealed class ParameterDefinitionCollection : Collection<ParameterDefinition> {
-
-		readonly IMethodSignature method;
-
-		internal ParameterDefinitionCollection (IMethodSignature method)
-		{
-			this.method = method;
-		}
-
-		internal ParameterDefinitionCollection (IMethodSignature method, int capacity)
-			: base (capacity)
-		{
-			this.method = method;
-		}
-
-		protected override void OnAdd (ParameterDefinition item, int index)
-		{
-			item.method = method;
-			item.index = index;
-		}
-
-		protected override void OnInsert (ParameterDefinition item, int index)
-		{
-			item.method = method;
-			item.index = index;
-
-			for (int i = index; i < size; i++)
-				items [i].index = i + 1;
-		}
-
-		protected override void OnSet (ParameterDefinition item, int index)
-		{
-			item.method = method;
-			item.index = index;
-		}
-
-		protected override void OnRemove (ParameterDefinition item, int index)
-		{
-			item.method = null;
-			item.index = -1;
-
-			for (int i = index + 1; i < size; i++)
-				items [i].index = i - 1;
-		}
-	}
-}

+ 0 - 75
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/ParameterReference.cs

@@ -1,75 +0,0 @@
-//
-// ParameterReference.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	public abstract class ParameterReference : IMetadataTokenProvider {
-
-		string name;
-		internal int index = -1;
-		protected TypeReference parameter_type;
-		internal MetadataToken token;
-
-		public string Name {
-			get { return name; }
-			set { name = value; }
-		}
-
-		public int Index {
-			get { return index; }
-		}
-
-		public TypeReference ParameterType {
-			get { return parameter_type; }
-			set { parameter_type = value; }
-		}
-
-		public MetadataToken MetadataToken {
-			get { return token; }
-			set { token = value; }
-		}
-
-		internal ParameterReference (string name, TypeReference parameterType)
-		{
-			if (parameterType == null)
-				throw new ArgumentNullException ("parameterType");
-
-			this.name = name ?? string.Empty;
-			this.parameter_type = parameterType;
-		}
-
-		public override string ToString ()
-		{
-			return name;
-		}
-
-		public abstract ParameterDefinition Resolve ();
-	}
-}

+ 0 - 53
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PinnedType.cs

@@ -1,53 +0,0 @@
-//
-// PinnedType.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MD = Mono.Cecil.Metadata;
-
-namespace Mono.Cecil {
-
-	public sealed class PinnedType : TypeSpecification {
-
-		public override bool IsValueType {
-			get { return false; }
-			set { throw new InvalidOperationException (); }
-		}
-
-		public override bool IsPinned {
-			get { return true; }
-		}
-
-		public PinnedType (TypeReference type)
-			: base (type)
-		{
-			Mixin.CheckType (type);
-			this.etype = MD.ElementType.Pinned;
-		}
-	}
-}

+ 0 - 61
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PointerType.cs

@@ -1,61 +0,0 @@
-//
-// PointerType.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MD = Mono.Cecil.Metadata;
-
-namespace Mono.Cecil {
-
-	public sealed class PointerType : TypeSpecification {
-
-		public override string Name {
-			get { return base.Name + "*"; }
-		}
-
-		public override string FullName {
-			get { return base.FullName + "*"; }
-		}
-
-		public override bool IsValueType {
-			get { return false; }
-			set { throw new InvalidOperationException (); }
-		}
-
-		public override bool IsPointer {
-			get { return true; }
-		}
-
-		public PointerType (TypeReference type)
-			: base (type)
-		{
-			Mixin.CheckType (type);
-			this.etype = MD.ElementType.Ptr;
-		}
-	}
-}

+ 0 - 41
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PropertyAttributes.cs

@@ -1,41 +0,0 @@
-//
-// PropertyAttributes.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.Cecil {
-
-	[Flags]
-	public enum PropertyAttributes : ushort {
-		None			= 0x0000,
-		SpecialName		= 0x0200,	// Property is special
-		RTSpecialName	= 0x0400,	// Runtime(metadata internal APIs) should check name encoding
-		HasDefault		= 0x1000,	// Property has default
-		Unused			= 0xe9ff	 // Reserved: shall be zero in a conforming implementation
-	}
-}

+ 0 - 59
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20/MonoCecil/Mono.Cecil/PropertyReference.cs

@@ -1,59 +0,0 @@
-//
-// PropertyReference.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Collections.Generic;
-
-namespace Mono.Cecil {
-
-	public abstract class PropertyReference : MemberReference {
-
-		TypeReference property_type;
-
-		public TypeReference PropertyType {
-			get { return property_type; }
-			set { property_type = value; }
-		}
-
-		public abstract Collection<ParameterDefinition> Parameters {
-			get;
-		}
-
-		internal PropertyReference (string name, TypeReference propertyType)
-			: base (name)
-		{
-			if (propertyType == null)
-				throw new ArgumentNullException ("propertyType");
-
-			property_type = propertyType;
-		}
-
-		public abstract PropertyDefinition Resolve ();
-	}
-}

Некоторые файлы не были показаны из-за большого количества измененных файлов