public void Emit(OpCode opcode, Label label) { DebuggingLabel dbgLabel = labels.Find(e => e.GetLabel() == label); dbgLabel.AddRef(instructions.Count); AddOpString(opcode, dbgLabel.GetAddr() != -1 ? "label_" + dbgLabel.GetAddr().ToString("X") : "label_"); ILGen.Emit(opcode, label); }
public void MarkLabel(Label label) { instructions.Add("label_" + ILGen.ILOffset.ToString("X")); DebuggingLabel dbgLabel = labels.Find(e => e.GetLabel() == label); dbgLabel.SetAddr(ILGen.ILOffset); foreach (int refAddr in dbgLabel.GetRefs()) { instructions[refAddr] += dbgLabel.GetAddr().ToString("X"); } ILGen.MarkLabel(label); }