diff options
author | Johannes Bucher <johannes.bucher2@student.kit.edu> | 2019-09-10 16:43:02 +0200 |
---|---|---|
committer | Johannes Bucher <johannes.bucher2@student.kit.edu> | 2019-09-10 18:08:15 +0200 |
commit | 7ce319a2c2a7a472f9ec889e217ecfbb674c2fd1 (patch) | |
tree | 53a3b26936668c05b912b072af153ff363c1677d | |
parent | 18744c2237a55ca4af2736d9bd96f8cddf134792 (diff) |
fix type init/deinitmulti-file
m--------- | libfirm | 0 | ||||
-rw-r--r-- | src/ast/ast.c | 4 | ||||
-rw-r--r-- | src/driver/driver.c | 7 | ||||
-rw-r--r-- | src/firm/ast2firm.c | 1 |
4 files changed, 10 insertions, 2 deletions
diff --git a/libfirm b/libfirm -Subproject 7d3271b487626d5e24eb96990c0cd392fac94db +Subproject c6c01a182b53626ae9f598e5723693184dbf459 diff --git a/src/ast/ast.c b/src/ast/ast.c index 70a2391..1149cbb 100644 --- a/src/ast/ast.c +++ b/src/ast/ast.c @@ -2035,7 +2035,7 @@ void init_ast_dialect(void) void exit_ast(void) { - exit_types(); - exit_typehash(); + //exit_types(); + //exit_typehash(); obstack_free(&ast_obstack, NULL); } diff --git a/src/driver/driver.c b/src/driver/driver.c index eb97dba..a0097ce 100644 --- a/src/driver/driver.c +++ b/src/driver/driver.c @@ -12,6 +12,7 @@ #include <string.h> #include <unistd.h> #include <libfirm/firm_common.h> +#include <ast/type_hash.h> #include "adt/panic.h" #include "adt/strutil.h" @@ -219,6 +220,10 @@ bool process_unit(compilation_env_t *env, compilation_unit_t *unit) { bool res; if (!is_initialized()) { + init_typehash(); + } + target_adjust_types_and_dialect(); + if (!is_initialized()) { init_firm_target(); init_firm_opt(); set_optimization_level(opt_level); @@ -239,6 +244,8 @@ bool process_unit(compilation_env_t *env, compilation_unit_t *unit) } assert(unit->type != type); /* handler should have changed the type */ } + exit_types(); + exit_typehash(); print_diagnostic_summary(); exit_firm_opt(); return res; diff --git a/src/firm/ast2firm.c b/src/firm/ast2firm.c index da89167..14cb97a 100644 --- a/src/firm/ast2firm.c +++ b/src/firm/ast2firm.c @@ -5160,6 +5160,7 @@ static const char *get_cwd(void) void translation_unit_to_firm(translation_unit_t *unit) { + printf("translation_unit_to_firm\n"); init_ast2firm(); if (dialect.cpp) { be_dwarf_set_source_language(DW_LANG_C_plus_plus); |