diff options
author | jfrijters <jfrijters> | 2011-12-01 16:03:23 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2011-12-01 16:03:23 +0400 |
commit | 72e3bfb7966341d49f9696e8c91fe3bc1f419d21 (patch) | |
tree | ff5a9239b099672ad9820b04226fffdc1ff14a77 /reflect/Emit | |
parent | 8159a8d12c3db9a81774a7c7cb247f93346359ce (diff) |
Added new overload of __ResolveOptionalParameterTypes() that supports resolving generic type parameters and custom modifiers.
Diffstat (limited to 'reflect/Emit')
-rw-r--r-- | reflect/Emit/ILGenerator.cs | 14 | ||||
-rw-r--r-- | reflect/Emit/ModuleBuilder.cs | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/reflect/Emit/ILGenerator.cs b/reflect/Emit/ILGenerator.cs index 46c70918..c8f7ddb9 100644 --- a/reflect/Emit/ILGenerator.cs +++ b/reflect/Emit/ILGenerator.cs @@ -1,5 +1,5 @@ /* - Copyright (C) 2008-2010 Jeroen Frijters + Copyright (C) 2008-2011 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -811,6 +811,11 @@ namespace IKVM.Reflection.Emit public void EmitCall(OpCode opc, MethodInfo method, Type[] optionalParameterTypes) { + __EmitCall(opc, method, optionalParameterTypes, null); + } + + public void __EmitCall(OpCode opc, MethodInfo method, Type[] optionalParameterTypes, CustomModifiers[] customModifiers) + { if (optionalParameterTypes == null || optionalParameterTypes.Length == 0) { Emit(opc, method); @@ -820,7 +825,7 @@ namespace IKVM.Reflection.Emit Emit(opc); UpdateStack(opc, method.HasThis, method.ReturnType, method.ParameterCount + optionalParameterTypes.Length); ByteBuffer sig = new ByteBuffer(16); - method.MethodSignature.WriteMethodRefSig(moduleBuilder, sig, optionalParameterTypes); + method.MethodSignature.WriteMethodRefSig(moduleBuilder, sig, optionalParameterTypes, customModifiers); MemberRefTable.Record record = new MemberRefTable.Record(); if (method.Module == moduleBuilder) { @@ -841,6 +846,11 @@ namespace IKVM.Reflection.Emit EmitCall(opc, constructor.GetMethodInfo(), optionalParameterTypes); } + public void __EmitCall(OpCode opc, ConstructorInfo constructor, Type[] optionalParameterTypes, CustomModifiers[] customModifiers) + { + __EmitCall(opc, constructor.GetMethodInfo(), optionalParameterTypes, customModifiers); + } + public void EmitCalli(OpCode opc, CallingConvention callingConvention, Type returnType, Type[] parameterTypes) { __EmitCalli(opc, __StandAloneMethodSig.Create(callingConvention, returnType, new CustomModifiers(), parameterTypes, null)); diff --git a/reflect/Emit/ModuleBuilder.cs b/reflect/Emit/ModuleBuilder.cs index 42a091f6..510fd278 100644 --- a/reflect/Emit/ModuleBuilder.cs +++ b/reflect/Emit/ModuleBuilder.cs @@ -1184,7 +1184,7 @@ namespace IKVM.Reflection.Emit mvid = guid; } - public override Type[] __ResolveOptionalParameterTypes(int metadataToken) + public override Type[] __ResolveOptionalParameterTypes(int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments, out CustomModifiers[] customModifiers) { throw new NotImplementedException(); } |