if (builder == null)
throw new InternalErrorException ("Emit without Store, or after Release");
- ec.Emit (OpCodes.Ldloc, builder, type);
+ ec.Emit (OpCodes.Ldloc, builder);
}
#region IAssignMethod Members
if (builder == null)
builder = ec.GetTemporaryLocal (type);
- ec.Emit (OpCodes.Stloc, builder, type);
+ ec.Emit (OpCodes.Stloc, builder);
}
public void AddressOf (EmitContext ec, AddressOp mode)
// if is_address, than this is just the address anyways,
// so we just return this.
//
- ec.Emit (OpCodes.Ldloc, builder, type);
+ ec.Emit (OpCodes.Ldloc, builder);
} else {
- ec.Emit (OpCodes.Ldloca, builder, type);
+ ec.Emit (OpCodes.Ldloca, builder);
}
}
}
ig.Emit (opcode);
}
- public void Emit (OpCode opcode, LocalBuilder local, TypeSpec type)
+ public void Emit (OpCode opcode, LocalBuilder local)
{
ig.Emit (opcode, local);
}
// Create temporary local (we cannot load this before Emit)
var temp = ec.GetTemporaryLocal (type);
- ec.Emit (OpCodes.Stloc, temp, type);
+ ec.Emit (OpCodes.Stloc, temp);
//
// Store the result to temporary field
//
var field = ec.GetTemporaryField (type);
ec.EmitThis ();
- ec.Emit (OpCodes.Ldloc, temp, type);
+ ec.Emit (OpCodes.Ldloc, temp);
field.EmitAssignFromStack (ec);
ec.FreeTemporaryLocal (temp, type);
if (need_copy) {
Emit (ec);
var temp = ec.GetTemporaryLocal (type);
- ec.Emit (OpCodes.Stloc, temp, type);
- ec.Emit (OpCodes.Ldloca, temp, type);
+ ec.Emit (OpCodes.Stloc, temp);
+ ec.Emit (OpCodes.Ldloca, temp);
ec.FreeTemporaryLocal (temp, type);
return;
}
current_pc = ec.GetTemporaryLocal (ec.BuiltinTypes.UInt);
ec.EmitThis ();
ec.Emit (OpCodes.Ldfld, storey.PC.Spec);
- ec.Emit (OpCodes.Stloc, current_pc, ec.BuiltinTypes.UInt);
+ ec.Emit (OpCodes.Stloc, current_pc);
}
ec.EmitThis ();
if (labels != null) {
//SymbolWriter.StartIteratorDispatcher (ec.ig);
- ec.Emit (OpCodes.Ldloc, current_pc, ec.BuiltinTypes.UInt);
+ ec.Emit (OpCodes.Ldloc, current_pc);
ec.Emit (OpCodes.Switch, labels);
//SymbolWriter.EndIteratorDispatcher (ec.ig);
current_pc = ec.GetTemporaryLocal (ec.BuiltinTypes.UInt);
ec.EmitThis ();
ec.Emit (OpCodes.Ldfld, storey.PC.Spec);
- ec.Emit (OpCodes.Stloc, current_pc, ec.BuiltinTypes.UInt);
+ ec.Emit (OpCodes.Stloc, current_pc);
// We're actually in state 'running', but this is as good a PC value as any if there's an abnormal exit
ec.EmitThis ();
if (need_skip_finally) {
skip_finally = ec.GetTemporaryLocal (ec.BuiltinTypes.Bool);
ec.EmitInt (0);
- ec.Emit (OpCodes.Stloc, skip_finally, ec.BuiltinTypes.Bool);
+ ec.Emit (OpCodes.Stloc, skip_finally);
}
SymbolWriter.StartIteratorDispatcher (ec);
- ec.Emit (OpCodes.Ldloc, current_pc, ec.BuiltinTypes.UInt);
+ ec.Emit (OpCodes.Ldloc, current_pc);
ec.Emit (OpCodes.Switch, labels);
ec.Emit (OpCodes.Br, move_next_error);
// mark finally blocks as disabled
if (unwind_protect && skip_finally != null) {
ec.EmitInt (1);
- ec.Emit (OpCodes.Stloc, skip_finally, ec.Module.Compiler.BuiltinTypes.Bool);
+ ec.Emit (OpCodes.Stloc, skip_finally);
}
}
}
}
if (unwind_protect)
- ec.Emit (OpCodes.Stloc, ec.TemporaryReturn (), ec.ReturnType);
+ ec.Emit (OpCodes.Stloc, ec.TemporaryReturn ());
}
if (unwind_protect)
if ((flags & Flags.CompilerGenerated) != 0)
CreateBuilder (ec);
- ec.Emit (OpCodes.Ldloc, builder, type);
+ ec.Emit (OpCodes.Ldloc, builder);
}
public void EmitAssign (EmitContext ec)
if ((flags & Flags.CompilerGenerated) != 0)
CreateBuilder (ec);
- ec.Emit (OpCodes.Stloc, builder, type);
+ ec.Emit (OpCodes.Stloc, builder);
}
public void EmitAddressOf (EmitContext ec)
{
- ec.Emit (OpCodes.Ldloca, builder, type);
+ ec.Emit (OpCodes.Ldloca, builder);
}
public string GetReadOnlyContext ()
ec.MarkLabel (ec.ReturnLabel);
if (ec.return_value != null) {
- ec.Emit (OpCodes.Ldloc, ec.return_value, ec.ReturnType);
+ ec.Emit (OpCodes.Ldloc, ec.return_value);
ec.Emit (OpCodes.Ret);
} else {
//
if (ec.HasReturnLabel || !unreachable) {
if (ec.ReturnType.Kind != MemberKind.Void)
- ec.Emit (OpCodes.Ldloc, ec.TemporaryReturn (), ec.ReturnType);
+ ec.Emit (OpCodes.Ldloc, ec.TemporaryReturn ());
ec.Emit (OpCodes.Ret);
}
}
if (resume_points != null) {
ec.EmitInt ((int) IteratorStorey.State.Running);
- ec.Emit (OpCodes.Stloc, iter.CurrentPC, ec.BuiltinTypes.UInt);
+ ec.Emit (OpCodes.Stloc, iter.CurrentPC);
}
ec.BeginExceptionBlock ();
// For normal control flow, we want to fall-through the Switch
// So, we use CurrentPC rather than the $PC field, and initialize it to an outside value above
- ec.Emit (OpCodes.Ldloc, iter.CurrentPC, ec.BuiltinTypes.UInt);
+ ec.Emit (OpCodes.Ldloc, iter.CurrentPC);
ec.EmitInt (first_resume_pc);
ec.Emit (OpCodes.Sub);
Label start_finally = ec.DefineLabel ();
if (resume_points != null) {
- ec.Emit (OpCodes.Ldloc, iter.SkipFinally, ec.BuiltinTypes.Bool);
+ ec.Emit (OpCodes.Ldloc, iter.SkipFinally);
ec.Emit (OpCodes.Brfalse_S, start_finally);
ec.Emit (OpCodes.Endfinally);
}
if (emit_dispatcher) {
//SymbolWriter.StartIteratorDispatcher (ec.ig);
- ec.Emit (OpCodes.Ldloc, pc, ec.BuiltinTypes.UInt);
+ ec.Emit (OpCodes.Ldloc, pc);
ec.EmitInt (first_resume_pc);
ec.Emit (OpCodes.Sub);
ec.Emit (OpCodes.Switch, labels);