Skip to content

Commit

Permalink
remove extraneous overloads & object parameter (I was informed about …
Browse files Browse the repository at this point in the history
…implicit conversion operator overloads; thanks Stefan)
  • Loading branch information
diakopter committed Dec 22, 2009
1 parent 306ea56 commit d0ef2c8
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions RunSharp/CodeGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -419,37 +419,16 @@ public Operand this[string localName] // Named locals support.
}
}

/// <summary>
/// DO NOT USE THIS. Declare a label with a compile-time value, not a run-time value.
/// </summary>
/// <param name="operand"></param>
public void Label(Operand operand, bool soValuesDontCoerceToOperand)
public void Label(string labelName)
{
throw new InvalidOperationException("we use computed gotos only!");
}

/// <summary>
/// DO NOT USE THIS. Declare a label with a compile-time value, not a run-time value.
/// </summary>
/// <param name="operand"></param>
public void Goto(Operand operand, bool soValuesDontCoerceToOperand)
{
throw new InvalidOperationException("we use computed gotos only!");
}

// stringified object for convenience when generating label names from integral types
public void Label(object labelNameObject)
{
string labelName = labelNameObject.ToString();
Label label;
if (!Labels.TryGetValue(labelName, out label))
Labels.Add(labelName, label = IL.DefineLabel());
IL.MarkLabel(label);
}

public void Goto(object labelNameObject)
public void Goto(string labelName)
{
string labelName = labelNameObject.ToString();
Label label;
if (!Labels.TryGetValue(labelName, out label))
Labels.Add(labelName, label = IL.DefineLabel());
Expand Down

0 comments on commit d0ef2c8

Please sign in to comment.