aboutsummaryrefslogtreecommitdiff
path: root/regalloc.h
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2018-01-05 23:42:24 +0100
committertomsmeding <tom.smeding@gmail.com>2018-01-05 23:42:24 +0100
commit3272b5d83d2e2167eed24748557df88bd66584ee (patch)
tree6b8f1574f6d6a44e11b74903516286f6249cb0b7 /regalloc.h
parenta298cb75c4f586b83b304c7dc66cb555693ea1b8 (diff)
There's actually a chance that, correctly stringified, this will work
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);