Skip to content

Commit f3ed613

Browse files
committed
Use shorter names for global_init() and global_stmts()
1 parent 9aefff4 commit f3ed613

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ void get_calls_to_global_init_and_stmts(Allocator &al, const Location &loc, Symb
428428
ASR::Module_t* mod, std::vector<ASR::asr_t *> &tmp_vec) {
429429

430430
std::string mod_name = mod->m_name;
431-
std::string g_func_name = mod_name + "__global_initializer";
431+
std::string g_func_name = mod_name + "global_init";
432432
ASR::symbol_t *g_func = mod->m_symtab->get_symbol(g_func_name);
433433
if (g_func && !scope->get_symbol(g_func_name)) {
434434
ASR::symbol_t *es = ASR::down_cast<ASR::symbol_t>(
@@ -441,7 +441,7 @@ void get_calls_to_global_init_and_stmts(Allocator &al, const Location &loc, Symb
441441
es, g_func, nullptr, 0, nullptr, nullptr, false));
442442
}
443443

444-
g_func_name = mod_name + "__global_statements";
444+
g_func_name = mod_name + "global_stmts";
445445
g_func = mod->m_symtab->get_symbol(g_func_name);
446446
if (g_func && !scope->get_symbol(g_func_name)) {
447447
ASR::symbol_t *es = ASR::down_cast<ASR::symbol_t>(
@@ -4803,7 +4803,7 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
48034803
// `pass_wrap_global_stmts_into_function` pass
48044804
unit->m_items = global_init.p;
48054805
unit->n_items = global_init.size();
4806-
std::string func_name = module_name + "__global_initializer";
4806+
std::string func_name = module_name + "global_init";
48074807
LCompilers::PassOptions pass_options;
48084808
pass_options.run_fun = func_name;
48094809
pass_wrap_global_stmts(al, *unit, pass_options);
@@ -4826,7 +4826,7 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
48264826
if (items.n > 0) {
48274827
unit->m_items = items.p;
48284828
unit->n_items = items.size();
4829-
std::string func_name = module_name + "__global_statements";
4829+
std::string func_name = module_name + "global_stmts";
48304830
// Wrap all the global statements into a Function
48314831
LCompilers::PassOptions pass_options;
48324832
pass_options.run_fun = func_name;

0 commit comments

Comments
 (0)