20
20
template <class T >
21
21
struct procedure_local_cfg_baset <
22
22
T,
23
- const java_bytecode_convert_methodt::address_mapt ,
23
+ java_bytecode_convert_methodt::method_with_amapt ,
24
24
unsigned > :
25
25
public graph<cfg_base_nodet<T, unsigned > >
26
26
{
27
- typedef java_bytecode_convert_methodt::address_mapt address_mapt ;
27
+ typedef java_bytecode_convert_methodt::method_with_amapt method_with_amapt ;
28
28
typedef std::map<unsigned , unsigned > entry_mapt;
29
29
entry_mapt entry_map;
30
30
31
31
procedure_local_cfg_baset () {}
32
32
33
- void operator ()(const address_mapt& amap )
33
+ void operator ()(const method_with_amapt& args )
34
34
{
35
+ const auto & amap=args.second ;
35
36
for (const auto & inst : amap)
36
37
{
37
38
// Map instruction PCs onto node indices:
@@ -44,19 +45,21 @@ struct procedure_local_cfg_baset<
44
45
for (auto succ : inst.second .successors )
45
46
this ->add_edge (entry_map.at (inst.first ), entry_map.at (succ));
46
47
}
48
+ // Add edges declared in the exception table, which don't figure
49
+ // in the address map successors/predecessors as yet.
47
50
}
48
51
49
- unsigned get_first_node (const address_mapt& amap ) const
52
+ unsigned get_first_node (const method_with_amapt& args ) const
50
53
{
51
- return amap .begin ()->first ;
54
+ return args. second .begin ()->first ;
52
55
}
53
- unsigned get_last_node (const address_mapt& amap ) const
56
+ unsigned get_last_node (const method_with_amapt& args ) const
54
57
{
55
- return (--amap .end ())->first ;
58
+ return (--args. second .end ())->first ;
56
59
}
57
- unsigned nodes_empty (const address_mapt& amap ) const
60
+ unsigned nodes_empty (const method_with_amapt& args ) const
58
61
{
59
- return amap .empty ();
62
+ return args. second .empty ();
60
63
}
61
64
};
62
65
@@ -744,7 +747,8 @@ void java_bytecode_convert_methodt::setup_local_variables(
744
747
{
745
748
// Compute CFG dominator tree
746
749
java_cfg_dominatorst dominator_analysis;
747
- dominator_analysis (amap);
750
+ method_with_amapt dominator_args (m,amap);
751
+ dominator_analysis (dominator_args);
748
752
749
753
// Find out which local variable table entries should be merged:
750
754
// Wrap each entry so we have somewhere to record live ranges with holes:
0 commit comments