Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__lpython_dummy -> __lcompilers_dummy for ignoring return values of function calls #672

Merged
merged 2 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lpython/semantics/python_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ class CommonVisitor : public AST::BaseVisitor<Derived> {
s_generic, args_new.p, args_new.size(),
a_type, value, nullptr);
if( ignore_return_value ) {
std::string dummy_ret_name = current_scope->get_unique_name("__lpython_dummy");
std::string dummy_ret_name = current_scope->get_unique_name("__lcompilers_dummy");
ASR::asr_t* variable_asr = ASR::make_Variable_t(al, loc, current_scope,
s2c(al, dummy_ret_name), ASR::intentType::Local,
nullptr, nullptr, ASR::storage_typeType::Default,
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/asr-expr_10-d39708c.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"outfile": null,
"outfile_hash": null,
"stdout": "asr-expr_10-d39708c.stdout",
"stdout_hash": "67e5a6431aa7fea394fe49d7e034c580a88bb71aa6806c199fb3d14b",
"stdout_hash": "54f5d58eafdde566a73d807cad213343afde64b6c2c1e3434e407be0",
"stderr": null,
"stderr_hash": null,
"returncode": 0
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/asr-expr_10-d39708c.stdout
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 6 {}) _lpython_main_program [] [(SubroutineCall 1 test_fn1 () [] ())] Source Public Implementation () .false. .false.), g: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) g [] [(= (Var 2 _lpython_return_variable) (IntegerConstant 5 (Integer 4 [])) ()) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ()), gsubrout: (Subroutine (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) gsubrout [(Var 3 x)] [(Print () [(Var 3 x)])] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 5 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), test_fn1: (Subroutine (SymbolTable 4 {__lpython_dummy: (Variable 4 __lpython_dummy Local () () Default (Integer 4 []) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.)}) test_fn1 [] [(= (Var 4 i) (FunctionCall 1 g () [] (Integer 4 []) () ()) ()) (= (Var 4 j) (FunctionCall 1 g () [] (Integer 4 []) () ()) ()) (= (Var 4 __lpython_dummy) (FunctionCall 1 g () [] (Integer 4 []) () ()) ()) (SubroutineCall 1 gsubrout () [((Var 4 i))] ())] Source Public Implementation () .false. .false.)}) [])
(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 6 {}) _lpython_main_program [] [(SubroutineCall 1 test_fn1 () [] ())] Source Public Implementation () .false. .false.), g: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) g [] [(= (Var 2 _lpython_return_variable) (IntegerConstant 5 (Integer 4 [])) ()) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ()), gsubrout: (Subroutine (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) gsubrout [(Var 3 x)] [(Print () [(Var 3 x)])] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 5 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), test_fn1: (Subroutine (SymbolTable 4 {__lcompilers_dummy: (Variable 4 __lcompilers_dummy Local () () Default (Integer 4 []) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.)}) test_fn1 [] [(= (Var 4 i) (FunctionCall 1 g () [] (Integer 4 []) () ()) ()) (= (Var 4 j) (FunctionCall 1 g () [] (Integer 4 []) () ()) ()) (= (Var 4 __lcompilers_dummy) (FunctionCall 1 g () [] (Integer 4 []) () ()) ()) (SubroutineCall 1 gsubrout () [((Var 4 i))] ())] Source Public Implementation () .false. .false.)}) [])