Mutate() public method

public Mutate ( Mono.CSharp.TypeParameterMutator mutator ) : MethodSpec
mutator Mono.CSharp.TypeParameterMutator
return MethodSpec
Example #1
0
		public void Emit (OpCode opcode, MethodSpec method)
		{
			if (IsAnonymousStoreyMutateRequired)
				method = method.Mutate (CurrentAnonymousMethod.Storey.Mutator);

			if (method.IsConstructor)
				ig.Emit (opcode, (ConstructorInfo) method.GetMetaInfo ());
			else
				ig.Emit (opcode, (MethodInfo) method.GetMetaInfo ());
		}
Example #2
0
		public void Emit (OpCode opcode, MethodSpec method)
		{
			if (IsAnonymousStoreyMutateRequired)
				method = method.Mutate (CurrentAnonymousMethod.Storey.Mutator);

			if (method.IsConstructor)
				ig.Emit (opcode, (ConstructorInfo) method.GetMetaInfo ());
			else
				ig.Emit (opcode, (MethodInfo) method.GetMetaInfo ());

			if (TrackStackTypes) {
				//
				// Don't bother with ldftn/Ldvirtftn they can never appear on open stack
				//
				if (method.IsConstructor) {
					if (opcode == OpCodes.Newobj)
						SetStackType (method.DeclaringType);
				} else {
					if (method.ReturnType.Kind != MemberKind.Void) {
						SetStackType (method.ReturnType);
					}
				}
			}
		}