@@ -245,45 +245,49 @@ class change_impactt
245
245
246
246
goto_functions_change_impactt old_change_impact, new_change_impact;
247
247
248
- void change_impact (const irep_idt &function );
248
+ void change_impact (const irep_idt &function_id );
249
249
250
250
void change_impact (
251
+ const irep_idt &function_id,
251
252
const goto_programt &old_goto_program,
252
253
const goto_programt &new_goto_program,
253
254
const unified_difft::goto_program_difft &diff,
254
255
goto_program_change_impactt &old_impact,
255
256
goto_program_change_impactt &new_impact);
256
257
257
258
void propogate_dep_back (
259
+ const irep_idt &function_id,
258
260
const dependence_grapht::nodet &d_node,
259
261
const dependence_grapht &dep_graph,
260
262
goto_functions_change_impactt &change_impact,
261
263
bool del);
262
264
void propogate_dep_forward (
265
+ const irep_idt &function_id,
263
266
const dependence_grapht::nodet &d_node,
264
267
const dependence_grapht &dep_graph,
265
268
goto_functions_change_impactt &change_impact,
266
269
bool del);
267
270
268
271
void output_change_impact (
269
- const irep_idt &function ,
272
+ const irep_idt &function_id ,
270
273
const goto_program_change_impactt &c_i,
271
274
const goto_functionst &goto_functions,
272
275
const namespacet &ns) const ;
273
276
void output_change_impact (
274
- const irep_idt &function ,
277
+ const irep_idt &function_id ,
275
278
const goto_program_change_impactt &o_c_i,
276
279
const goto_functionst &o_goto_functions,
277
280
const namespacet &o_ns,
278
281
const goto_program_change_impactt &n_c_i,
279
282
const goto_functionst &n_goto_functions,
280
283
const namespacet &n_ns) const ;
281
284
282
- void output_instruction (char prefix,
283
- const goto_programt &goto_program,
284
- const namespacet &ns,
285
- const irep_idt &function,
286
- goto_programt::const_targett &target) const ;
285
+ void output_instruction (
286
+ char prefix,
287
+ const goto_programt &goto_program,
288
+ const namespacet &ns,
289
+ const irep_idt &function_id,
290
+ goto_programt::const_targett &target) const ;
287
291
};
288
292
289
293
change_impactt::change_impactt (
@@ -312,17 +316,17 @@ change_impactt::change_impactt(
312
316
new_dep_graph (new_goto_functions, ns_new);
313
317
}
314
318
315
- void change_impactt::change_impact (const irep_idt &function )
319
+ void change_impactt::change_impact (const irep_idt &function_id )
316
320
{
317
- unified_difft::goto_program_difft diff = unified_diff.get_diff (function );
321
+ unified_difft::goto_program_difft diff = unified_diff.get_diff (function_id );
318
322
319
323
if (diff.empty ())
320
324
return ;
321
325
322
- goto_functionst::function_mapt::const_iterator old_fit=
323
- old_goto_functions.function_map .find (function );
324
- goto_functionst::function_mapt::const_iterator new_fit=
325
- new_goto_functions.function_map .find (function );
326
+ goto_functionst::function_mapt::const_iterator old_fit =
327
+ old_goto_functions.function_map .find (function_id );
328
+ goto_functionst::function_mapt::const_iterator new_fit =
329
+ new_goto_functions.function_map .find (function_id );
326
330
327
331
goto_programt empty;
328
332
@@ -336,14 +340,16 @@ void change_impactt::change_impact(const irep_idt &function)
336
340
new_fit->second .body ;
337
341
338
342
change_impact (
343
+ function_id,
339
344
old_goto_program,
340
345
new_goto_program,
341
346
diff,
342
- old_change_impact[function ],
343
- new_change_impact[function ]);
347
+ old_change_impact[function_id ],
348
+ new_change_impact[function_id ]);
344
349
}
345
350
346
351
void change_impactt::change_impact (
352
+ const irep_idt &function_id,
347
353
const goto_programt &old_goto_program,
348
354
const goto_programt &new_goto_program,
349
355
const unified_difft::goto_program_difft &diff,
@@ -378,17 +384,11 @@ void change_impactt::change_impact(
378
384
if (impact_mode==impact_modet::BACKWARD ||
379
385
impact_mode==impact_modet::BOTH)
380
386
propogate_dep_back (
381
- d_node,
382
- old_dep_graph,
383
- old_change_impact,
384
- true );
387
+ function_id, d_node, old_dep_graph, old_change_impact, true );
385
388
if (impact_mode==impact_modet::FORWARD ||
386
389
impact_mode==impact_modet::BOTH)
387
390
propogate_dep_forward (
388
- d_node,
389
- old_dep_graph,
390
- old_change_impact,
391
- true );
391
+ function_id, d_node, old_dep_graph, old_change_impact, true );
392
392
}
393
393
old_impact[o_it]|=DELETED;
394
394
++o_it;
@@ -402,18 +402,16 @@ void change_impactt::change_impact(
402
402
403
403
if (impact_mode==impact_modet::BACKWARD ||
404
404
impact_mode==impact_modet::BOTH)
405
+ {
405
406
propogate_dep_back (
406
- d_node,
407
- new_dep_graph,
408
- new_change_impact,
409
- false );
407
+ function_id, d_node, new_dep_graph, new_change_impact, false );
408
+ }
410
409
if (impact_mode==impact_modet::FORWARD ||
411
410
impact_mode==impact_modet::BOTH)
411
+ {
412
412
propogate_dep_forward (
413
- d_node,
414
- new_dep_graph,
415
- new_change_impact,
416
- false );
413
+ function_id, d_node, new_dep_graph, new_change_impact, false );
414
+ }
417
415
}
418
416
new_impact[n_it]|=NEW;
419
417
++n_it;
@@ -422,8 +420,8 @@ void change_impactt::change_impact(
422
420
}
423
421
}
424
422
425
-
426
423
void change_impactt::propogate_dep_forward (
424
+ const irep_idt &function_id,
427
425
const dependence_grapht::nodet &d_node,
428
426
const dependence_grapht &dep_graph,
429
427
goto_functions_change_impactt &change_impact,
@@ -437,20 +435,26 @@ void change_impactt::propogate_dep_forward(
437
435
mod_flagt data_flag = del ? DEL_DATA_DEP : NEW_DATA_DEP;
438
436
mod_flagt ctrl_flag = del ? DEL_CTRL_DEP : NEW_CTRL_DEP;
439
437
440
- if ((change_impact[src->function ][src] &data_flag)
441
- || (change_impact[src->function ][src] &ctrl_flag))
438
+ if (
439
+ (change_impact[function_id][src] & data_flag) ||
440
+ (change_impact[function_id][src] & ctrl_flag))
442
441
continue ;
443
442
if (it->second .get () == dep_edget::kindt::DATA
444
443
|| it->second .get () == dep_edget::kindt::BOTH)
445
- change_impact[src-> function ][src] |= data_flag;
444
+ change_impact[function_id ][src] |= data_flag;
446
445
else
447
- change_impact[src->function ][src] |= ctrl_flag;
448
- propogate_dep_forward (dep_graph[dep_graph[src].get_node_id ()], dep_graph,
449
- change_impact, del);
446
+ change_impact[function_id][src] |= ctrl_flag;
447
+ propogate_dep_forward (
448
+ function_id,
449
+ dep_graph[dep_graph[src].get_node_id ()],
450
+ dep_graph,
451
+ change_impact,
452
+ del);
450
453
}
451
454
}
452
455
453
456
void change_impactt::propogate_dep_back (
457
+ const irep_idt &function_id,
454
458
const dependence_grapht::nodet &d_node,
455
459
const dependence_grapht &dep_graph,
456
460
goto_functions_change_impactt &change_impact,
@@ -464,19 +468,24 @@ void change_impactt::propogate_dep_back(
464
468
mod_flagt data_flag = del ? DEL_DATA_DEP : NEW_DATA_DEP;
465
469
mod_flagt ctrl_flag = del ? DEL_CTRL_DEP : NEW_CTRL_DEP;
466
470
467
- if ((change_impact[src->function ][src] &data_flag)
468
- || (change_impact[src->function ][src] &ctrl_flag))
471
+ if (
472
+ (change_impact[function_id][src] & data_flag) ||
473
+ (change_impact[function_id][src] & ctrl_flag))
469
474
{
470
475
continue ;
471
476
}
472
477
if (it->second .get () == dep_edget::kindt::DATA
473
478
|| it->second .get () == dep_edget::kindt::BOTH)
474
- change_impact[src-> function ][src] |= data_flag;
479
+ change_impact[function_id ][src] |= data_flag;
475
480
else
476
- change_impact[src->function ][src] |= ctrl_flag;
477
-
478
- propogate_dep_back (dep_graph[dep_graph[src].get_node_id ()], dep_graph,
479
- change_impact, del);
481
+ change_impact[function_id][src] |= ctrl_flag;
482
+
483
+ propogate_dep_back (
484
+ function_id,
485
+ dep_graph[dep_graph[src].get_node_id ()],
486
+ dep_graph,
487
+ change_impact,
488
+ del);
480
489
}
481
490
}
482
491
@@ -551,18 +560,18 @@ void change_impactt::operator()()
551
560
}
552
561
553
562
void change_impactt::output_change_impact (
554
- const irep_idt &function ,
563
+ const irep_idt &function_id ,
555
564
const goto_program_change_impactt &c_i,
556
565
const goto_functionst &goto_functions,
557
566
const namespacet &ns) const
558
567
{
559
- goto_functionst::function_mapt::const_iterator f_it=
560
- goto_functions.function_map .find (function );
568
+ goto_functionst::function_mapt::const_iterator f_it =
569
+ goto_functions.function_map .find (function_id );
561
570
assert (f_it!=goto_functions.function_map .end ());
562
571
const goto_programt &goto_program=f_it->second .body ;
563
572
564
573
if (!compact_output)
565
- std::cout << " /** " << function << " **/\n " ;
574
+ std::cout << " /** " << function_id << " **/\n " ;
566
575
567
576
forall_goto_program_instructions (target, goto_program)
568
577
{
@@ -591,31 +600,31 @@ void change_impactt::output_change_impact(
591
600
else
592
601
UNREACHABLE;
593
602
594
- output_instruction (prefix, goto_program, ns, function , target);
603
+ output_instruction (prefix, goto_program, ns, function_id , target);
595
604
}
596
605
}
597
606
598
607
void change_impactt::output_change_impact (
599
- const irep_idt &function ,
608
+ const irep_idt &function_id ,
600
609
const goto_program_change_impactt &o_c_i,
601
610
const goto_functionst &o_goto_functions,
602
611
const namespacet &o_ns,
603
612
const goto_program_change_impactt &n_c_i,
604
613
const goto_functionst &n_goto_functions,
605
614
const namespacet &n_ns) const
606
615
{
607
- goto_functionst::function_mapt::const_iterator o_f_it=
608
- o_goto_functions.function_map .find (function );
616
+ goto_functionst::function_mapt::const_iterator o_f_it =
617
+ o_goto_functions.function_map .find (function_id );
609
618
assert (o_f_it!=o_goto_functions.function_map .end ());
610
619
const goto_programt &old_goto_program=o_f_it->second .body ;
611
620
612
- goto_functionst::function_mapt::const_iterator f_it=
613
- n_goto_functions.function_map .find (function );
621
+ goto_functionst::function_mapt::const_iterator f_it =
622
+ n_goto_functions.function_map .find (function_id );
614
623
assert (f_it!=n_goto_functions.function_map .end ());
615
624
const goto_programt &goto_program=f_it->second .body ;
616
625
617
626
if (!compact_output)
618
- std::cout << " /** " << function << " **/\n " ;
627
+ std::cout << " /** " << function_id << " **/\n " ;
619
628
620
629
goto_programt::const_targett o_target=
621
630
old_goto_program.instructions .begin ();
@@ -629,7 +638,7 @@ void change_impactt::output_change_impact(
629
638
630
639
if (old_mod_flags&DELETED)
631
640
{
632
- output_instruction (' -' , goto_program, o_ns, function , o_target);
641
+ output_instruction (' -' , goto_program, o_ns, function_id , o_target);
633
642
++o_target;
634
643
--target;
635
644
continue ;
@@ -681,7 +690,7 @@ void change_impactt::output_change_impact(
681
690
else
682
691
UNREACHABLE;
683
692
684
- output_instruction (prefix, goto_program, n_ns, function , target);
693
+ output_instruction (prefix, goto_program, n_ns, function_id , target);
685
694
}
686
695
for ( ;
687
696
o_target!=old_goto_program.instructions .end ();
@@ -709,15 +718,16 @@ void change_impactt::output_change_impact(
709
718
else
710
719
UNREACHABLE;
711
720
712
- output_instruction (prefix, goto_program, o_ns, function , o_target);
721
+ output_instruction (prefix, goto_program, o_ns, function_id , o_target);
713
722
}
714
723
}
715
724
716
- void change_impactt::output_instruction (char prefix,
717
- const goto_programt &goto_program,
718
- const namespacet &ns,
719
- const irep_idt &function,
720
- goto_programt::const_targett &target) const
725
+ void change_impactt::output_instruction (
726
+ char prefix,
727
+ const goto_programt &goto_program,
728
+ const namespacet &ns,
729
+ const irep_idt &function_id,
730
+ goto_programt::const_targett &target) const
721
731
{
722
732
if (compact_output)
723
733
{
@@ -732,7 +742,7 @@ void change_impactt::output_instruction(char prefix,
732
742
else
733
743
{
734
744
std::cout << prefix;
735
- goto_program.output_instruction (ns, function , std::cout, *target);
745
+ goto_program.output_instruction (ns, function_id , std::cout, *target);
736
746
}
737
747
}
738
748
0 commit comments