From e03dfa29b464dd53e81e548ddf3b6b97a22ebafa Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 12 Oct 2018 21:09:36 +0900 Subject: [PATCH] Clean up the module .ctor construction a little. --- tools/qfcc/source/class.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/qfcc/source/class.c b/tools/qfcc/source/class.c index 52b67823d..21dc210c6 100644 --- a/tools/qfcc/source/class.c +++ b/tools/qfcc/source/class.c @@ -1265,6 +1265,7 @@ class_finish_module (void) category_t **ca; def_t *symtab_def; symbol_t *module_sym; + expr_t *module_expr; pr_module_t *module; symbol_t *exec_class_sym; symbol_t *init_sym; @@ -1314,12 +1315,12 @@ class_finish_module (void) init_sym = new_symbol_type (".ctor", &type_function); init_sym = function_symbol (init_sym, 0, 1); + module_expr = address_expr (new_symbol_expr (module_sym), 0, 0); + init_expr = new_block_expr (); append_expr (init_expr, - build_function_call (new_symbol_expr (exec_class_sym), - exec_class_sym->type, - address_expr (new_symbol_expr (module_sym), - 0, 0))); + build_function_call (new_symbol_expr (exec_class_sym), + exec_class_sym->type, module_expr)); save_storage = current_storage; current_storage = sc_static;