AILLabel.cs 535 B

12345678910111213141516171819202122232425262728
  1. using System.Reflection.Emit;
  2. namespace ChocolArm64.Translation
  3. {
  4. class AILLabel : IAILEmit
  5. {
  6. private bool HasLabel;
  7. private Label Lbl;
  8. public void Emit(AILEmitter Context)
  9. {
  10. Context.Generator.MarkLabel(GetLabel(Context));
  11. }
  12. public Label GetLabel(AILEmitter Context)
  13. {
  14. if (!HasLabel)
  15. {
  16. Lbl = Context.Generator.DefineLabel();
  17. HasLabel = true;
  18. }
  19. return Lbl;
  20. }
  21. }
  22. }