File tree Expand file tree Collapse file tree 3 files changed +12
-15
lines changed Expand file tree Collapse file tree 3 files changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -660,17 +660,16 @@ void boolbvt::print_assignment(std::ostream &out) const
660
660
out << pair.first << " =" << pair.second .get_value (prop) << ' \n ' ;
661
661
}
662
662
663
- void boolbvt::build_offset_map (const struct_typet &src, offset_mapt &dest )
663
+ boolbvt::offset_mapt boolbvt::build_offset_map (const struct_typet &src)
664
664
{
665
- const struct_typet::componentst &components=
666
- src.components ();
667
-
668
- dest.resize (components.size ());
669
- std::size_t offset=0 ;
670
- for (std::size_t i=0 ; i<components.size (); i++)
665
+ const struct_typet::componentst &components = src.components ();
666
+ offset_mapt dest;
667
+ dest.reserve (components.size ());
668
+ std::size_t offset = 0 ;
669
+ for (const auto &comp : components)
671
670
{
672
- std::size_t comp_width=boolbv_width (components[i].type ());
673
- dest[i]=offset;
674
- offset+=comp_width;
671
+ dest.push_back (offset);
672
+ offset += boolbv_width (comp.type ());
675
673
}
674
+ return dest;
676
675
}
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ class boolbvt:public arrayst
250
250
void post_process_quantifiers ();
251
251
252
252
typedef std::vector<std::size_t > offset_mapt;
253
- void build_offset_map (const struct_typet &src, offset_mapt &dest );
253
+ offset_mapt build_offset_map (const struct_typet &src);
254
254
255
255
// strings
256
256
numbering<irep_idt> string_numbering;
Original file line number Diff line number Diff line change @@ -530,10 +530,8 @@ bool boolbvt::type_conversion(
530
530
op_struct.components ();
531
531
532
532
// build offset maps
533
- offset_mapt op_offsets, dest_offsets;
534
-
535
- build_offset_map (op_struct, op_offsets);
536
- build_offset_map (dest_struct, dest_offsets);
533
+ const offset_mapt op_offsets = build_offset_map (op_struct);
534
+ const offset_mapt dest_offsets = build_offset_map (dest_struct);
537
535
538
536
// build name map
539
537
typedef std::map<irep_idt, std::size_t > op_mapt;
You can’t perform that action at this time.
0 commit comments