Clean up the module .ctor construction a little.

This commit is contained in:
Bill Currie 2018-10-12 21:09:36 +09:00
parent f56d25cda6
commit e03dfa29b4

View file

@ -1265,6 +1265,7 @@ class_finish_module (void)
category_t **ca; category_t **ca;
def_t *symtab_def; def_t *symtab_def;
symbol_t *module_sym; symbol_t *module_sym;
expr_t *module_expr;
pr_module_t *module; pr_module_t *module;
symbol_t *exec_class_sym; symbol_t *exec_class_sym;
symbol_t *init_sym; symbol_t *init_sym;
@ -1314,12 +1315,12 @@ class_finish_module (void)
init_sym = new_symbol_type (".ctor", &type_function); init_sym = new_symbol_type (".ctor", &type_function);
init_sym = function_symbol (init_sym, 0, 1); init_sym = function_symbol (init_sym, 0, 1);
module_expr = address_expr (new_symbol_expr (module_sym), 0, 0);
init_expr = new_block_expr (); init_expr = new_block_expr ();
append_expr (init_expr, append_expr (init_expr,
build_function_call (new_symbol_expr (exec_class_sym), build_function_call (new_symbol_expr (exec_class_sym),
exec_class_sym->type, exec_class_sym->type, module_expr));
address_expr (new_symbol_expr (module_sym),
0, 0)));
save_storage = current_storage; save_storage = current_storage;
current_storage = sc_static; current_storage = sc_static;