aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/CodeGen/RegisterAllocators/LiveRange.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ARMeilleure/CodeGen/RegisterAllocators/LiveRange.cs')
-rw-r--r--ARMeilleure/CodeGen/RegisterAllocators/LiveRange.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/ARMeilleure/CodeGen/RegisterAllocators/LiveRange.cs b/ARMeilleure/CodeGen/RegisterAllocators/LiveRange.cs
new file mode 100644
index 00000000..b5faeffd
--- /dev/null
+++ b/ARMeilleure/CodeGen/RegisterAllocators/LiveRange.cs
@@ -0,0 +1,31 @@
+using System;
+
+namespace ARMeilleure.CodeGen.RegisterAllocators
+{
+ struct LiveRange : IComparable<LiveRange>
+ {
+ public int Start { get; }
+ public int End { get; }
+
+ public LiveRange(int start, int end)
+ {
+ Start = start;
+ End = end;
+ }
+
+ public int CompareTo(LiveRange other)
+ {
+ if (Start < other.End && other.Start < End)
+ {
+ return 0;
+ }
+
+ return Start.CompareTo(other.Start);
+ }
+
+ public override string ToString()
+ {
+ return $"[{Start}, {End}[";
+ }
+ }
+} \ No newline at end of file