aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/main.c b/main.c
index 7577012..5588543 100644
--- a/main.c
+++ b/main.c
@@ -3,6 +3,8 @@
#include <assert.h>
#include "compiler.h"
#include "node.h"
+#include "regalloc.h"
+#include "to_assembly.h"
extern FILE *yyin;
@@ -30,9 +32,14 @@ int main(int argc, char **argv) {
printf("\n");
struct ir *ir = compile(root_node);
- ir_print(ir, stdout);
- type_cache_cleanup();
+ ir_print(ir, stdout); printf("\n");
+
+ struct allocation *alloc = regalloc(ir);
+ to_assembly(ir, alloc);
+ allocation_delete(alloc);
+
+ ir_print(ir, stdout); printf("\n");
return result;
}