2018-10-31 01:43:02 +00:00
|
|
|
using System.Reflection.Emit;
|
|
|
|
|
|
|
|
namespace ChocolArm64.Translation
|
|
|
|
{
|
|
|
|
class ILLabel : IILEmit
|
|
|
|
{
|
|
|
|
private bool _hasLabel;
|
|
|
|
|
|
|
|
private Label _lbl;
|
|
|
|
|
2018-12-11 00:58:52 +00:00
|
|
|
public void Emit(ILMethodBuilder context)
|
2018-10-31 01:43:02 +00:00
|
|
|
{
|
|
|
|
context.Generator.MarkLabel(GetLabel(context));
|
|
|
|
}
|
|
|
|
|
2018-12-11 00:58:52 +00:00
|
|
|
public Label GetLabel(ILMethodBuilder context)
|
2018-10-31 01:43:02 +00:00
|
|
|
{
|
|
|
|
if (!_hasLabel)
|
|
|
|
{
|
|
|
|
_lbl = context.Generator.DefineLabel();
|
|
|
|
|
|
|
|
_hasLabel = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return _lbl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|