Skip to content

Commit

Permalink
Merge pull request #672 from czgdp1807/rename_dummy
Browse files Browse the repository at this point in the history
`__lpython_dummy` -> `__lcompilers_dummy` for ignoring return values of function calls
  • Loading branch information
czgdp1807 authored Jun 22, 2022
2 parents 693bc8d + 283bbf3 commit 412e89f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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.)}) [])

0 comments on commit 412e89f

Please sign in to comment.