Skip to content

Commit 2b00973

Browse files
authored
Merge pull request #2227 from tautschnig/fptr-removal
Function-pointer removal performance fix
2 parents 3f7685f + 3b3dc71 commit 2b00973

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/goto-programs/remove_function_pointers.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,18 @@ void remove_function_pointerst::fix_return_type(
233233
code_type.return_type(), ns))
234234
return;
235235

236+
const symbolt &function_symbol =
237+
ns.lookup(to_symbol_expr(function_call.function()).get_identifier());
238+
236239
symbolt &tmp_symbol = get_fresh_aux_symbol(
237240
code_type.return_type(),
238241
id2string(function_call.source_location().get_function()),
239-
"tmp_return_val",
242+
"tmp_return_val_" + id2string(function_symbol.base_name),
240243
function_call.source_location(),
241-
irep_idt(),
244+
function_symbol.mode,
242245
symbol_table);
243246

244-
symbol_exprt tmp_symbol_expr;
245-
tmp_symbol_expr.type()=tmp_symbol.type;
246-
tmp_symbol_expr.set_identifier(tmp_symbol.name);
247+
const symbol_exprt tmp_symbol_expr = tmp_symbol.symbol_expr();
247248

248249
exprt old_lhs=function_call.lhs();
249250
function_call.lhs()=tmp_symbol_expr;

0 commit comments

Comments
 (0)