Skip to content

Commit 52ad618

Browse files
Daniel Kroeningtautschnig
authored andcommitted
remove goto_programt::instructiont::function member
1 parent abd4572 commit 52ad618

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+13
-263
lines changed

jbmc/src/java_bytecode/remove_exceptions.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ void remove_exceptionst::instrument_exception_handler(
237237
t_null->code=code_assignt(
238238
thrown_global_symbol,
239239
null_voidptr);
240-
t_null->function=instr_it->function;
241240

242241
// add the assignment exc = @inflight_exception (before the null assignment)
243242
goto_programt::targett t_exc=goto_program.insert_after(instr_it);
@@ -246,7 +245,6 @@ void remove_exceptionst::instrument_exception_handler(
246245
t_exc->code=code_assignt(
247246
thrown_exception_local,
248247
typecast_exprt(thrown_global_symbol, thrown_exception_local.type()));
249-
t_exc->function=instr_it->function;
250248
}
251249
instr_it->make_skip();
252250
}
@@ -352,7 +350,6 @@ void remove_exceptionst::add_exception_dispatch_sequence(
352350
goto_programt::targett t_exc=goto_program.insert_after(instr_it);
353351
t_exc->make_goto(new_state_pc);
354352
t_exc->source_location=instr_it->source_location;
355-
t_exc->function=instr_it->function;
356353

357354
// use instanceof to check that this is the correct handler
358355
struct_tag_typet type(stack_catch[i][j].first);
@@ -377,7 +374,6 @@ void remove_exceptionst::add_exception_dispatch_sequence(
377374

378375
default_dispatch->make_goto(default_target);
379376
default_dispatch->source_location=instr_it->source_location;
380-
default_dispatch->function=instr_it->function;
381377

382378
// add dead instructions
383379
for(const auto &local : locals)
@@ -386,7 +382,6 @@ void remove_exceptionst::add_exception_dispatch_sequence(
386382
t_dead->make_dead();
387383
t_dead->code=code_deadt(local);
388384
t_dead->source_location=instr_it->source_location;
389-
t_dead->function=instr_it->function;
390385
}
391386
}
392387

@@ -466,7 +461,6 @@ bool remove_exceptionst::instrument_function_call(
466461
goto_programt::targett t_null=goto_program.insert_after(instr_it);
467462
t_null->make_goto(next_it);
468463
t_null->source_location=instr_it->source_location;
469-
t_null->function=instr_it->function;
470464
t_null->guard=no_exception_currently_in_flight;
471465
}
472466

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -840,9 +840,6 @@ void jbmc_parse_optionst::process_goto_function(
840840
function.compute_location_numbers();
841841
goto_function.body.compute_loop_numbers();
842842
}
843-
844-
// update the function member in each instruction
845-
function.update_instructions_function();
846843
}
847844
}
848845

jbmc/src/jdiff/java_syntactic_diff.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,6 @@ bool java_syntactic_difft::operator()()
7575
modified_functions.insert(it->first);
7676
continue;
7777
}
78-
79-
goto_programt::instructionst::const_iterator i_it1 =
80-
it->second.body.instructions.begin();
81-
for(goto_programt::instructionst::const_iterator
82-
i_it2 = f_it->second.body.instructions.begin();
83-
i_it1 != it->second.body.instructions.end() &&
84-
i_it2 != f_it->second.body.instructions.end();
85-
++i_it1, ++i_it2)
86-
{
87-
if(i_it1->function != i_it2->function)
88-
{
89-
modified_functions.insert(it->first);
90-
break;
91-
}
92-
}
9378
}
9479
forall_goto_functions(it, goto_model2.goto_functions)
9580
{

src/analyses/flow_insensitive_analysis.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,9 @@ bool flow_insensitive_analysis_baset::do_function_call(
216216
goto_programt::targett r=temp.add_instruction();
217217
r->make_return();
218218
r->code=code_returnt(rhs);
219-
r->function=f_it->first;
220219
r->location_number=0;
221220

222221
goto_programt::targett t=temp.add_instruction(END_FUNCTION);
223-
t->function=f_it->first;
224222
t->location_number=1;
225223

226224
locationt l_next=l_call; l_next++;
@@ -245,9 +243,6 @@ bool flow_insensitive_analysis_baset::do_function_call(
245243
// get the state at the beginning of the function
246244
locationt l_begin=goto_function.body.instructions.begin();
247245

248-
DATA_INVARIANT(
249-
l_begin->function == f_it->first, "function names have to match");
250-
251246
// do the edge from the call site to the beginning of the function
252247
new_data =
253248
state.transform(ns, calling_function, l_call, f_it->first, l_begin);

src/analyses/goto_check.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,9 +1903,6 @@ void goto_checkt::goto_check(
19031903
i_it->source_location.set_java_bytecode_index(
19041904
it->source_location.get_java_bytecode_index());
19051905
}
1906-
1907-
if(i_it->function.empty())
1908-
i_it->function=it->function;
19091906
}
19101907

19111908
// insert new instructions -- make sure targets are not moved

src/analyses/interval_analysis.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ void instrument_intervals(
8282
t->make_assumption(conjunction(assertion));
8383
i_it++; // goes to original instruction
8484
t->source_location=i_it->source_location;
85-
t->function=i_it->function;
8685
}
8786
}
8887
}

src/assembler/remove_asm.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,6 @@ void remove_asmt::process_function(
493493
it->make_skip();
494494
did_something = true;
495495

496-
for(auto &instruction : tmp_dest.instructions)
497-
instruction.function = it->function;
498-
499496
goto_programt::targett next = it;
500497
next++;
501498

src/goto-diff/syntactic_diff.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,6 @@ bool syntactic_difft::operator()()
7474
modified_functions.insert(it->first);
7575
continue;
7676
}
77-
78-
goto_programt::instructionst::const_iterator
79-
i_it1=it->second.body.instructions.begin();
80-
for(goto_programt::instructionst::const_iterator
81-
i_it2=f_it->second.body.instructions.begin();
82-
i_it1!=it->second.body.instructions.end() &&
83-
i_it2!=f_it->second.body.instructions.end();
84-
++i_it1, ++i_it2)
85-
{
86-
if(i_it1->function != i_it2->function)
87-
{
88-
modified_functions.insert(it->first);
89-
break;
90-
}
91-
}
9277
}
9378
forall_goto_functions(it, goto_model2.goto_functions)
9479
{

src/goto-diff/unified_diff.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ bool unified_difft::instructions_equal(
392392
const goto_programt::instructiont &ins1,
393393
const goto_programt::instructiont &ins2)
394394
{
395-
return ins1.equals(ins2) && ins1.function == ins2.function &&
395+
return ins1.equals(ins2) &&
396396
(ins1.targets.empty() ||
397397
instructions_equal(*ins1.get_target(), *ins2.get_target()));
398398
}

src/goto-instrument/branch.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,13 @@ void branch(
5454
goto_programt::targett t1=body.insert_after(i_it);
5555
t1->make_function_call(
5656
function_to_call(goto_model.symbol_table, id, "taken"));
57-
t1->function=f_it->first;
5857

5958
goto_programt::targett t2=body.insert_after(t1);
6059
t2->make_goto(i_it->get_target());
6160

6261
goto_programt::targett t3=body.insert_after(t2);
6362
t3->make_function_call(
6463
function_to_call(goto_model.symbol_table, id, "not-taken"));
65-
t3->function=f_it->first;
6664
i_it->targets.clear();
6765
i_it->targets.push_back(t3);
6866
}

0 commit comments

Comments
 (0)