summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2015-12-30 15:33:33 +0800
committerTing-Wei Lan <lantw44@gmail.com>2015-12-30 15:33:33 +0800
commit463be4aa241f9c9b8453ba46a89ce5d67995c55b (patch)
tree8575ce34c28d0cc10a4b3a98ced553a504e7c7d4 /src/main.c
parent0c0c7ab0850b6803c377ad7150305870d75bf3c0 (diff)
downloadcompiler2015-463be4aa241f9c9b8453ba46a89ce5d67995c55b.tar
compiler2015-463be4aa241f9c9b8453ba46a89ce5d67995c55b.tar.gz
compiler2015-463be4aa241f9c9b8453ba46a89ce5d67995c55b.tar.bz2
compiler2015-463be4aa241f9c9b8453ba46a89ce5d67995c55b.tar.lz
compiler2015-463be4aa241f9c9b8453ba46a89ce5d67995c55b.tar.xz
compiler2015-463be4aa241f9c9b8453ba46a89ce5d67995c55b.tar.zst
compiler2015-463be4aa241f9c9b8453ba46a89ce5d67995c55b.zip
Drop any_error from state and add asm_output to state
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 5f6c169..0ae48e4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -96,13 +96,12 @@ int main (int argc, char **argv)
else
exit(1);
- FILE *asm_output = fopen("output.s", "w");
- if (asm_output == NULL) {
+ state->asm_output = fopen("output.s", "w");
+ if (state->asm_output == NULL) {
fprintf(stderr, "%s: output.s: %s\n", prog_name, ERR_MSG);
exit(1);
}
- ccmmc_code_generation(state->ast, state->table, asm_output);
- fclose(asm_output);
+ ccmmc_code_generation(state);
ccmmc_state_fini(state);
fclose(source_handle);