Skip to content

Commit 56ca07c

Browse files
author
svorenova
committed
Add return_value_identifier function
This function was removed in #4616
1 parent fd79fe0 commit 56ca07c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/goto-programs/remove_returns.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,7 @@ bool remove_returnst::restore_returns(
296296

297297
// do we have X#return_value?
298298
const namespacet ns(symbol_table);
299-
auto rv_symbol = return_value_symbol(function_id, ns);
300-
auto rv_name = rv_symbol.get_identifier();
299+
auto rv_name = return_value_identifier(function_id);
301300

302301
symbol_tablet::symbolst::const_iterator rv_it=
303302
symbol_table.symbols.find(rv_name);
@@ -411,10 +410,15 @@ void restore_returns(goto_modelt &goto_model)
411410
rr.restore(goto_model.goto_functions);
412411
}
413412

413+
irep_idt return_value_identifier(const irep_idt &identifier)
414+
{
415+
return id2string(identifier) + RETURN_VALUE_SUFFIX;
416+
}
417+
414418
symbol_exprt
415419
return_value_symbol(const irep_idt &identifier, const namespacet &ns)
416420
{
417421
const symbolt &function_symbol = ns.lookup(identifier);
418422
const typet &return_type = to_code_type(function_symbol.type).return_type();
419-
return symbol_exprt(id2string(identifier) + RETURN_VALUE_SUFFIX, return_type);
423+
return symbol_exprt(return_value_identifier(identifier), return_type);
420424
}

src/goto-programs/remove_returns.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ void restore_returns(symbol_table_baset &, goto_functionst &);
9595

9696
void restore_returns(goto_modelt &);
9797

98+
/// produces the identifier that is used to store the return
99+
/// value of the function with the given identifier
100+
irep_idt return_value_identifier(const irep_idt &);
101+
98102
/// produces the symbol that is used to store the return
99103
/// value of the function with the given identifier
100104
symbol_exprt return_value_symbol(const irep_idt &, const namespacet &);

0 commit comments

Comments
 (0)