Skip to content

Commit db63e03

Browse files
committed
Revert "Update location numbers after adding instructions"
This reverts commit 309ad6e.
1 parent 309ad6e commit db63e03

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/goto-programs/remove_returns.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class remove_returnst
4444
const irep_idt &function_id,
4545
goto_functionst::goto_functiont &function);
4646

47-
bool do_function_calls(
47+
void do_function_calls(
4848
function_is_stubt function_is_stub,
4949
goto_programt &goto_program);
5050

@@ -142,14 +142,10 @@ void remove_returnst::replace_returns(
142142
/// \param function_is_stub: function (irep_idt -> bool) that determines whether
143143
/// a given function ID is a stub
144144
/// \param goto_program: program to transform
145-
/// \return True if, and only if, instructions have been inserted. In that case
146-
/// the caller must invoke an appropriate method to update location numbers.
147-
bool remove_returnst::do_function_calls(
145+
void remove_returnst::do_function_calls(
148146
function_is_stubt function_is_stub,
149147
goto_programt &goto_program)
150148
{
151-
bool requires_update = false;
152-
153149
Forall_goto_program_instructions(i_it, goto_program)
154150
{
155151
if(i_it->is_function_call())
@@ -225,17 +221,13 @@ bool remove_returnst::do_function_calls(
225221
t_a,
226222
goto_programt::make_dead(*return_value, i_it->source_location));
227223
}
228-
229-
requires_update = true;
230224
}
231225

232226
// update the call
233227
i_it->set_function_call(function_call);
234228
}
235229
}
236230
}
237-
238-
return requires_update;
239231
}
240232

241233
void remove_returnst::operator()(goto_functionst &goto_functions)
@@ -252,8 +244,7 @@ void remove_returnst::operator()(goto_functionst &goto_functions)
252244
};
253245

254246
replace_returns(it->first, it->second);
255-
if(do_function_calls(function_is_stub, it->second.body))
256-
goto_functions.compute_location_numbers(it->second.body);
247+
do_function_calls(function_is_stub, it->second.body);
257248
}
258249
}
259250

@@ -270,8 +261,7 @@ void remove_returnst::operator()(
270261
return;
271262

272263
replace_returns(model_function.get_function_id(), goto_function);
273-
if(do_function_calls(function_is_stub, goto_function.body))
274-
model_function.compute_location_numbers();
264+
do_function_calls(function_is_stub, goto_function.body);
275265
}
276266

277267
/// removes returns

0 commit comments

Comments
 (0)