@@ -76,10 +76,11 @@ class assume_false_generate_function_bodiest : public generate_function_bodiest
76
76
const irep_idt &function_name) const override
77
77
{
78
78
auto const &function_symbol = symbol_table.lookup_ref (function_name);
79
- function.body .add (
80
- goto_programt::make_assumption (false_exprt (), function_symbol.location ));
81
- function.body .add (
82
- goto_programt::make_end_function (function_symbol.location ));
79
+ source_locationt location = function_symbol.location ;
80
+ location.set_function (function_name);
81
+
82
+ function.body .add (goto_programt::make_assumption (false_exprt (), location));
83
+ function.body .add (goto_programt::make_end_function (location));
83
84
}
84
85
};
85
86
@@ -249,6 +250,8 @@ class havoc_generate_function_bodiest : public generate_function_bodiest
249
250
}
250
251
251
252
auto const &function_symbol = symbol_table.lookup_ref (function_name);
253
+ source_locationt location = function_symbol.location ;
254
+ location.set_function (function_name);
252
255
253
256
for (std::size_t i = 0 ; i < function.parameter_identifiers .size (); ++i)
254
257
{
@@ -266,7 +269,7 @@ class havoc_generate_function_bodiest : public generate_function_bodiest
266
269
equal_exprt (
267
270
parameter_symbol.symbol_expr (),
268
271
null_pointer_exprt (to_pointer_type (parameter_symbol.type ))),
269
- function_symbol. location ));
272
+ location));
270
273
271
274
dereference_exprt dereference_expr (
272
275
parameter_symbol.symbol_expr (),
@@ -276,15 +279,15 @@ class havoc_generate_function_bodiest : public generate_function_bodiest
276
279
havoc_expr_rec (
277
280
dereference_expr,
278
281
1 , // depth 1 since we pass the dereferenced pointer
279
- function_symbol. location ,
282
+ location,
280
283
function_name,
281
284
symbol_table,
282
285
dest);
283
286
284
287
function.body .destructive_append (dest);
285
288
286
289
auto label_instruction =
287
- function.body .add (goto_programt::make_skip (function_symbol. location ));
290
+ function.body .add (goto_programt::make_skip (location));
288
291
goto_instruction->complete_goto (label_instruction);
289
292
}
290
293
}
@@ -298,7 +301,7 @@ class havoc_generate_function_bodiest : public generate_function_bodiest
298
301
havoc_expr_rec (
299
302
symbol_exprt (global_sym.name , global_sym.type ),
300
303
0 ,
301
- function_symbol. location ,
304
+ location,
302
305
irep_idt (),
303
306
symbol_table,
304
307
dest);
@@ -316,21 +319,21 @@ class havoc_generate_function_bodiest : public generate_function_bodiest
316
319
type,
317
320
id2string (function_name),
318
321
" return_value" ,
319
- function_symbol. location ,
322
+ location,
320
323
ID_C,
321
324
symbol_table);
322
325
323
326
aux_symbol.is_static_lifetime = false ;
324
327
325
- function.body .add (goto_programt::make_decl (
326
- aux_symbol.symbol_expr (), function_symbol. location ));
328
+ function.body .add (
329
+ goto_programt::make_decl ( aux_symbol.symbol_expr (), location));
327
330
328
331
goto_programt dest;
329
332
330
333
havoc_expr_rec (
331
334
aux_symbol.symbol_expr (),
332
335
0 ,
333
- function_symbol. location ,
336
+ location,
334
337
function_name,
335
338
symbol_table,
336
339
dest);
@@ -340,15 +343,14 @@ class havoc_generate_function_bodiest : public generate_function_bodiest
340
343
exprt return_expr =
341
344
typecast_exprt::conditional_cast (aux_symbol.symbol_expr (), return_type);
342
345
343
- function.body .add (goto_programt::make_set_return_value (
344
- std::move (return_expr), function_symbol. location ));
346
+ function.body .add (
347
+ goto_programt::make_set_return_value ( std::move (return_expr), location));
345
348
346
- function.body .add (goto_programt::make_dead (
347
- aux_symbol.symbol_expr (), function_symbol. location ));
349
+ function.body .add (
350
+ goto_programt::make_dead ( aux_symbol.symbol_expr (), location));
348
351
}
349
352
350
- function.body .add (
351
- goto_programt::make_end_function (function_symbol.location ));
353
+ function.body .add (goto_programt::make_end_function (location));
352
354
353
355
remove_skip (function.body );
354
356
}
0 commit comments