aboutsummaryrefslogtreecommitdiff
path: root/regalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'regalloc.h')
-rw-r--r--regalloc.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/regalloc.h b/regalloc.h
new file mode 100644
index 0000000..6ba0470
--- /dev/null
+++ b/regalloc.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <stdbool.h>
+#include "ir.h"
+
+
+struct allocation_record {
+ bool spill;
+ int reg; // only used if spill == false
+};
+
+struct allocation {
+ int numregs;
+ struct allocation_record *allocs;
+};
+
+struct allocation* regalloc(const struct ir *ir);
+
+void allocation_delete(struct allocation *alloc);