Skip to content

Commit 8ddd9ba

Browse files
committed
goto_inline: replace source location if adjust_function is set
We no longer need to change an instruction's function member, but should update the source location instead.
1 parent c9c872e commit 8ddd9ba

File tree

1 file changed

+5
-27
lines changed

1 file changed

+5
-27
lines changed

src/goto-programs/goto_inline_class.cpp

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -315,37 +315,15 @@ void goto_inlinet::insert_function_body(
315315
call_location_number,
316316
identifier);
317317

318-
#if 0
319-
if(goto_function.is_hidden())
318+
if(adjust_function)
320319
{
321-
source_locationt new_source_location=
322-
function.find_source_location();
323-
324-
if(new_source_location.is_not_nil())
320+
Forall_goto_program_instructions(it, tmp)
325321
{
326-
new_source_location.set_hide();
327-
328-
Forall_goto_program_instructions(it, tmp)
329-
{
330-
if(it->function==identifier)
331-
{
332-
// don't hide assignment to lhs
333-
if(it->is_assign() && it->get_assign().lhs()==lhs)
334-
{
335-
}
336-
else
337-
{
338-
replace_location(it->source_location, new_source_location);
339-
replace_location(it->guard, new_source_location);
340-
replace_location(it->code, new_source_location);
341-
}
342-
343-
it->function=target->function;
344-
}
345-
}
322+
replace_location(it->source_location, target->source_location);
323+
replace_location(it->guard, target->source_location);
324+
replace_location(it->code, target->source_location);
346325
}
347326
}
348-
#endif
349327

350328
// kill call
351329
target->type=LOCATION;

0 commit comments

Comments
 (0)