Skip to content

Commit 4562866

Browse files
committed
Update the rest of the code to compile
1 parent 326f662 commit 4562866

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

src/libasr/codegen/asr_to_x86.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ Result<int> asr_to_x86(ASR::TranslationUnit_t &asr, Allocator &al,
577577

578578
{
579579
auto t1 = std::chrono::high_resolution_clock::now();
580-
pass_wrap_global_stmts_into_function(al, asr, pass_options);
580+
pass_wrap_global_stmts(al, asr, pass_options);
581581
auto t2 = std::chrono::high_resolution_clock::now();
582582
time_pass_global = std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count();
583583
}

src/libasr/pass/for_all.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ForAllVisitor : public ASR::StatementWalkVisitor<ForAllVisitor>
4343
}
4444
};
4545

46-
void pass_replace_forall(Allocator &al, ASR::TranslationUnit_t &unit,
46+
void pass_replace_for_all(Allocator &al, ASR::TranslationUnit_t &unit,
4747
const LCompilers::PassOptions& /*pass_options*/) {
4848
ForAllVisitor v(al);
4949
v.visit_TranslationUnit(unit);

src/libasr/pass/global_stmts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ using ASRUtils::EXPR;
1818
* statements and expressions into a function.
1919
*
2020
*/
21-
void pass_wrap_global_stmts_into_function(Allocator &al,
21+
void pass_wrap_global_stmts(Allocator &al,
2222
ASR::TranslationUnit_t &unit, const LCompilers::PassOptions& pass_options) {
2323
if (unit.n_items == 0) {
2424
return ;

src/libasr/pass/global_stmts_program.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ using ASRUtils::EXPR;
1818
* statements and expressions into a program.
1919
*
2020
*/
21-
void pass_wrap_global_stmts_into_program(Allocator &al,
21+
void pass_wrap_global_stmts_program(Allocator &al,
2222
ASR::TranslationUnit_t &unit, const LCompilers::PassOptions& pass_options) {
2323
std::string program_fn_name = pass_options.run_fun;
2424
SymbolTable *current_scope = al.make_new<SymbolTable>(unit.m_global_scope);
@@ -28,8 +28,8 @@ void pass_wrap_global_stmts_into_program(Allocator &al,
2828
SetChar prog_dep;
2929
prog_dep.reserve(al, 1);
3030
bool call_main_program = unit.n_items > 0;
31-
pass_wrap_global_stmts_into_function(al, unit, pass_options);
32-
pass_wrap_global_syms_into_module(al, unit, pass_options);
31+
pass_wrap_global_stmts(al, unit, pass_options);
32+
pass_wrap_global_symbols(al, unit, pass_options);
3333
if( call_main_program && !pass_options.disable_main ) {
3434
// Call `_lpython_main_program` function
3535
ASR::Module_t *mod = ASR::down_cast<ASR::Module_t>(

src/libasr/pass/global_symbols.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace LCompilers {
1414
* and wraps all global symbols into a module
1515
*/
1616

17-
void pass_wrap_global_syms_into_module(Allocator &al,
17+
void pass_wrap_global_symbols(Allocator &al,
1818
ASR::TranslationUnit_t &unit,
1919
const LCompilers::PassOptions &/*pass_options*/) {
2020
if( unit.m_global_scope->get_scope().size() == 0 ) {

src/libasr/pass/instantiate_template.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator<FunctionInstanti
430430

431431
};
432432

433-
ASR::symbol_t* pass_instantiate_generic_function(Allocator &al, std::map<std::string, ASR::ttype_t*> subs,
433+
ASR::symbol_t* pass_instantiate_template(Allocator &al, std::map<std::string, ASR::ttype_t*> subs,
434434
std::map<std::string, ASR::symbol_t*> rt_subs, SymbolTable *current_scope,
435435
std::string new_func_name, ASR::symbol_t *sym) {
436436
ASR::symbol_t* sym2 = ASRUtils::symbol_get_past_external(sym);

src/libasr/pass/pass_manager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace LCompilers {
6767
std::vector<std::string> _skip_passes, _c_skip_passes;
6868
std::map<std::string, pass_function> _passes_db = {
6969
{"do_loops", &pass_replace_do_loops},
70-
{"global_stmts", &pass_wrap_global_stmts_into_function},
70+
{"global_stmts", &pass_wrap_global_stmts},
7171
{"implied_do_loops", &pass_replace_implied_do_loops},
7272
{"array_op", &pass_replace_array_op},
7373
{"intrinsic_function", &pass_replace_intrinsic_function},
@@ -83,7 +83,7 @@ namespace LCompilers {
8383
{"inline_function_calls", &pass_inline_function_calls},
8484
{"loop_unroll", &pass_loop_unroll},
8585
{"dead_code_removal", &pass_dead_code_removal},
86-
{"forall", &pass_replace_forall},
86+
{"forall", &pass_replace_for_all},
8787
{"select_case", &pass_replace_select_case},
8888
{"loop_vectorise", &pass_loop_vectorise},
8989
{"array_dim_intrinsics_update", &pass_update_array_dim_intrinsic_calls},

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
15351535
std::string new_func_name = "__asr_generic_" + func_name + "_"
15361536
+ std::to_string(new_function_num);
15371537
generic_func_subs[new_func_name] = subs;
1538-
t = pass_instantiate_generic_function(al, subs, rt_subs,
1538+
t = pass_instantiate_template(al, subs, rt_subs,
15391539
ASRUtils::symbol_parent_symtab(func), new_func_name, func);
15401540
dependencies.erase(s2c(al, func_name));
15411541
dependencies.push_back(al, s2c(al, new_func_name));
@@ -4733,7 +4733,7 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
47334733
std::string func_name = "global_initializer";
47344734
LCompilers::PassOptions pass_options;
47354735
pass_options.run_fun = func_name;
4736-
pass_wrap_global_stmts_into_function(al, *unit, pass_options);
4736+
pass_wrap_global_stmts(al, *unit, pass_options);
47374737

47384738
ASR::Module_t *mod = ASR::down_cast<ASR::Module_t>(main_module_sym);
47394739
ASR::symbol_t *f_sym = unit->m_global_scope->get_symbol(func_name);
@@ -4769,7 +4769,7 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
47694769
// Wrap all the global statements into a Function
47704770
LCompilers::PassOptions pass_options;
47714771
pass_options.run_fun = func_name;
4772-
pass_wrap_global_stmts_into_function(al, *unit, pass_options);
4772+
pass_wrap_global_stmts(al, *unit, pass_options);
47734773

47744774
ASR::Module_t *mod = ASR::down_cast<ASR::Module_t>(main_module_sym);
47754775
ASR::symbol_t *f_sym = unit->m_global_scope->get_symbol(func_name);
@@ -7684,7 +7684,7 @@ Result<ASR::TranslationUnit_t*> python_ast_to_asr(Allocator &al, LocationManager
76847684
pass_options.run_fun = "_lpython_main_program";
76857685
pass_options.runtime_library_dir = get_runtime_library_dir();
76867686
}
7687-
pass_wrap_global_stmts_into_program(al, *tu, pass_options);
7687+
pass_wrap_global_stmts_program(al, *tu, pass_options);
76887688
#if defined(WITH_LFORTRAN_ASSERT)
76897689
diag::Diagnostics diagnostics;
76907690
if (!asr_verify(*tu, true, diagnostics)) {

0 commit comments

Comments
 (0)