aboutsummaryrefslogtreecommitdiff
path: root/ChocolArm64/Translation/ILLabel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ChocolArm64/Translation/ILLabel.cs')
-rw-r--r--ChocolArm64/Translation/ILLabel.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/ChocolArm64/Translation/ILLabel.cs b/ChocolArm64/Translation/ILLabel.cs
new file mode 100644
index 00000000..4f96edcc
--- /dev/null
+++ b/ChocolArm64/Translation/ILLabel.cs
@@ -0,0 +1,28 @@
+using System.Reflection.Emit;
+
+namespace ChocolArm64.Translation
+{
+ class ILLabel : IILEmit
+ {
+ private bool _hasLabel;
+
+ private Label _lbl;
+
+ public void Emit(ILEmitter context)
+ {
+ context.Generator.MarkLabel(GetLabel(context));
+ }
+
+ public Label GetLabel(ILEmitter context)
+ {
+ if (!_hasLabel)
+ {
+ _lbl = context.Generator.DefineLabel();
+
+ _hasLabel = true;
+ }
+
+ return _lbl;
+ }
+ }
+} \ No newline at end of file