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