@@ -41,16 +41,16 @@ void local_bitvector_analysist::flagst::print(std::ostream &out) const
4141 out << " +integer_address" ;
4242}
4343
44- bool local_bitvector_analysist::loc_infot:: merge (const loc_infot &src )
44+ bool local_bitvector_analysist::merge (points_tot &a, points_tot &b )
4545{
4646 bool result=false ;
4747
4848 std::size_t max_index=
49- std::max (src. points_to . size (), points_to .size ());
49+ std::max (a. size (), b .size ());
5050
5151 for (std::size_t i=0 ; i<max_index; i++)
5252 {
53- if (points_to [i].merge (src. points_to [i]))
53+ if (a [i].merge (b [i]))
5454 result=true ;
5555 }
5656
@@ -72,8 +72,8 @@ bool local_bitvector_analysist::is_tracked(const irep_idt &identifier)
7272void local_bitvector_analysist::assign_lhs (
7373 const exprt &lhs,
7474 const exprt &rhs,
75- const loc_infot &loc_info_src,
76- loc_infot &loc_info_dest)
75+ points_tot &loc_info_src,
76+ points_tot &loc_info_dest)
7777{
7878 if (lhs.id ()==ID_symbol)
7979 {
@@ -83,7 +83,7 @@ void local_bitvector_analysist::assign_lhs(
8383 {
8484 unsigned dest_pointer=pointers.number (identifier);
8585 flagst rhs_flags=get_rec (rhs, loc_info_src);
86- loc_info_dest. points_to [dest_pointer]=rhs_flags;
86+ loc_info_dest[dest_pointer]=rhs_flags;
8787 }
8888 }
8989 else if (lhs.id ()==ID_dereference)
@@ -117,14 +117,12 @@ local_bitvector_analysist::flagst local_bitvector_analysist::get(
117117
118118 assert (loc_it!=cfg.loc_map .end ());
119119
120- const loc_infot &loc_info_src=loc_infos[loc_it->second ];
121-
122- return get_rec (rhs, loc_info_src);
120+ return get_rec (rhs, loc_infos[loc_it->second ]);
123121}
124122
125123local_bitvector_analysist::flagst local_bitvector_analysist::get_rec (
126124 const exprt &rhs,
127- const loc_infot &loc_info_src)
125+ points_tot &loc_info_src)
128126{
129127 if (rhs.id ()==ID_constant)
130128 {
@@ -139,7 +137,7 @@ local_bitvector_analysist::flagst local_bitvector_analysist::get_rec(
139137 if (is_tracked (identifier))
140138 {
141139 unsigned src_pointer=pointers.number (identifier);
142- return loc_info_src. points_to [src_pointer];
140+ return loc_info_src[src_pointer];
143141 }
144142 else
145143 return flagst::mk_unknown ();
@@ -258,7 +256,7 @@ void local_bitvector_analysist::build(const goto_functiont &goto_function)
258256 // in the entry location.
259257 for (const auto &local : locals.locals_map )
260258 if (is_tracked (local.first ))
261- loc_infos[0 ]. points_to [pointers.number (local.first )]=flagst::mk_unknown ();
259+ loc_infos[0 ][pointers.number (local.first )]=flagst::mk_unknown ();
262260
263261 while (!work_queue.empty ())
264262 {
@@ -267,8 +265,8 @@ void local_bitvector_analysist::build(const goto_functiont &goto_function)
267265 const goto_programt::instructiont &instruction=*node.t ;
268266 work_queue.pop ();
269267
270- const loc_infot &loc_info_src=loc_infos[loc_nr];
271- loc_infot loc_info_dest=loc_infos[loc_nr];
268+ auto &loc_info_src=loc_infos[loc_nr];
269+ auto loc_info_dest=loc_infos[loc_nr];
272270
273271 switch (instruction.type )
274272 {
@@ -320,7 +318,7 @@ void local_bitvector_analysist::build(const goto_functiont &goto_function)
320318 for (const auto &succ : node.successors )
321319 {
322320 assert (succ<loc_infos.size ());
323- if (loc_infos[succ]. merge (loc_info_dest))
321+ if (merge ( loc_infos[succ], (loc_info_dest) ))
324322 work_queue.push (succ);
325323 }
326324 }
@@ -337,14 +335,14 @@ void local_bitvector_analysist::output(
337335 {
338336 out << " **** " << i_it->source_location << " \n " ;
339337
340- const loc_infot &loc_info=loc_infos[l];
338+ const auto &loc_info=loc_infos[l];
341339
342340 for (points_tot::const_iterator
343- p_it=loc_info.points_to . begin ();
344- p_it!=loc_info.points_to . end ();
341+ p_it=loc_info.begin ();
342+ p_it!=loc_info.end ();
345343 p_it++)
346344 {
347- out << " " << pointers[p_it-loc_info.points_to . begin ()]
345+ out << " " << pointers[p_it-loc_info.begin ()]
348346 << " : "
349347 << *p_it
350348 << " \n " ;
0 commit comments