File tree 3 files changed +26
-3
lines changed 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,7 @@ irep_idt ansi_c_languaget::generate_opaque_stub_body(
95
95
if (return_type.id ()!=ID_nil)
96
96
{
97
97
auxiliary_symbolt return_symbol;
98
- std::ostringstream return_symbol_name_builder;
99
- return_symbol_name_builder << " to_return_" << symbol.name ;
100
- return_symbol.name =return_symbol_name_builder.str ();
98
+ return_symbol.name =get_stub_return_symbol_name (symbol.name );
101
99
return_symbol.base_name =return_symbol.name ;
102
100
return_symbol.mode =ID_C;
103
101
return_symbol.type =return_type;
Original file line number Diff line number Diff line change @@ -224,6 +224,28 @@ parameter_symbolt languaget::build_stub_parameter_symbol(
224
224
return parameter_symbolt ();
225
225
}
226
226
227
+ /* ******************************************************************\
228
+
229
+ Function: languaget::get_stub_return_symbol_name
230
+
231
+ Inputs:
232
+ function_id - the function that has a return value
233
+
234
+ Outputs: the identifier to use for the symbol that will store the
235
+ return value of this function.
236
+
237
+ Purpose: To get the name of the symbol to be used for the return value
238
+ of the function. Generates a name like to_return_function_name
239
+
240
+ \*******************************************************************/
241
+
242
+ irep_idt languaget::get_stub_return_symbol_name (const irep_idt &function_id)
243
+ {
244
+ std::ostringstream return_symbol_name_builder;
245
+ return_symbol_name_builder << " to_return_" << function_id;
246
+ return return_symbol_name_builder.str ();
247
+ }
248
+
227
249
228
250
/* ******************************************************************\
229
251
Original file line number Diff line number Diff line change @@ -114,6 +114,9 @@ class languaget:public messaget
114
114
const symbolt &function_symbol,
115
115
size_t parameter_index,
116
116
const code_typet::parametert ¶meter);
117
+
118
+ static irep_idt get_stub_return_symbol_name (const irep_idt &function_id);
119
+
117
120
private:
118
121
bool is_symbol_opaque_function (const symbolt &symbol);
119
122
void generate_opaque_parameter_symbols (
You can’t perform that action at this time.
0 commit comments