@@ -178,9 +178,6 @@ class goto_programt
178
178
public:
179
179
codet code;
180
180
181
- // / The function this instruction belongs to
182
- irep_idt function;
183
-
184
181
// / The location of the instruction in the source file
185
182
source_locationt source_location;
186
183
@@ -347,7 +344,6 @@ class goto_programt
347
344
swap (instruction.type , type);
348
345
swap (instruction.guard , guard);
349
346
swap (instruction.targets , targets);
350
- swap (instruction.function , function);
351
347
}
352
348
353
349
#if (defined _MSC_VER && _MSC_VER <= 1800)
@@ -424,42 +420,6 @@ class goto_programt
424
420
return t;
425
421
}
426
422
427
- // / Get the id of the function that contains the instruction pointed-to by the
428
- // / given instruction iterator.
429
- // /
430
- // / \param l: instruction iterator
431
- // / \return id of the function that contains the pointed-to goto instruction
432
- static const irep_idt get_function_id (
433
- const_targett l)
434
- {
435
- // The field `function` of an instruction may not always contain the id of
436
- // the function it is currently in, due to goto program modifications such
437
- // as inlining. For example, if an instruction in a function `f` is inlined
438
- // into a function `g`, the instruction may, depending on the arguments to
439
- // the inliner, retain the original value of `f` in the function field.
440
- // However, instructions of type END_FUNCTION are never inlined into other
441
- // functions, hence they contain the id of the function they are in. Thus,
442
- // this function takes the END_FUNCTION instruction of the goto program and
443
- // returns the value of its function field.
444
-
445
- while (!l->is_end_function ())
446
- ++l;
447
-
448
- return l->function ;
449
- }
450
-
451
- // / Get the id of the function that contains the given goto program.
452
- // /
453
- // / \param p: the goto program
454
- // / \return id of the function that contains the goto program
455
- static const irep_idt get_function_id (
456
- const goto_programt &p)
457
- {
458
- PRECONDITION (!p.empty ());
459
-
460
- return get_function_id (--p.instructions .end ());
461
- }
462
-
463
423
template <typename Target>
464
424
std::list<Target> get_successors (Target target) const ;
465
425
@@ -578,22 +538,6 @@ class goto_programt
578
538
}
579
539
}
580
540
581
- // / Sets the `function` member of each instruction if not yet set
582
- // / Note that a goto program need not be a goto function and therefore,
583
- // / we cannot do this in update(), but only at the level of
584
- // / of goto_functionst where goto programs are guaranteed to be
585
- // / named functions.
586
- void update_instructions_function (const irep_idt &function_id)
587
- {
588
- for (auto &instruction : instructions)
589
- {
590
- if (instruction.function .empty ())
591
- {
592
- instruction.function = function_id;
593
- }
594
- }
595
- }
596
-
597
541
// / Compute location numbers
598
542
void compute_location_numbers ()
599
543
{
@@ -608,9 +552,11 @@ class goto_programt
608
552
void update ();
609
553
610
554
// / Human-readable loop name
611
- static irep_idt loop_id (const instructiont &instruction)
555
+ static irep_idt loop_id (
556
+ const irep_idt &function_id,
557
+ const instructiont &instruction)
612
558
{
613
- return id2string (instruction. function )+" ." +
559
+ return id2string (function_id )+" ." +
614
560
std::to_string (instruction.loop_number );
615
561
}
616
562
0 commit comments