LiveRange.cs 641 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. namespace ARMeilleure.CodeGen.RegisterAllocators
  3. {
  4. struct LiveRange : IComparable<LiveRange>
  5. {
  6. public int Start { get; }
  7. public int End { get; }
  8. public LiveRange(int start, int end)
  9. {
  10. Start = start;
  11. End = end;
  12. }
  13. public int CompareTo(LiveRange other)
  14. {
  15. if (Start < other.End && other.Start < End)
  16. {
  17. return 0;
  18. }
  19. return Start.CompareTo(other.Start);
  20. }
  21. public override string ToString()
  22. {
  23. return $"[{Start}, {End}[";
  24. }
  25. }
  26. }