More casts done, bugs fixed, codegen expanded, correct ordering in codegen, if, label, goto, break, switch, continue, compile time if analysed,

This commit is contained in:
Christoffer Lerno
2019-09-07 00:58:56 +02:00
parent 0dba2b8569
commit 3b2051ea80
12 changed files with 1104 additions and 382 deletions

View File

@@ -55,8 +55,13 @@ void compiler_compile()
diag_reset();
parse_file(file);
sema_analysis(current_context);
current_context->codegen_output = stdout;
FILE *f = fopen("test.c","w");
fprintf(f, "#include <stdbool.h>\n#include <stdint.h>\n");
current_context->codegen_output = f;
codegen(current_context);
fclose(f);
system("cc test.c && ./a.out");
}
exit(EXIT_SUCCESS);
}