@@ -102,8 +102,8 @@ void value_set_fit::output(
102
102
{
103
103
result=" <" +from_expr (ns, identifier, o)+" , " ;
104
104
105
- if (o_it->second . offset_is_set )
106
- result+= integer2string (o_it->second . offset )+ " " ;
105
+ if (o_it->second )
106
+ result += integer2string (* o_it->second ) + " " ;
107
107
else
108
108
result+=' *' ;
109
109
@@ -197,13 +197,12 @@ void value_set_fit::flatten_rec(
197
197
t_it!=temp.write ().end ();
198
198
t_it++)
199
199
{
200
- if (t_it->second .offset_is_set &&
201
- it->second .offset_is_set )
200
+ if (t_it->second && it->second )
202
201
{
203
- t_it->second . offset += it->second . offset ;
202
+ * t_it->second += * it->second ;
204
203
}
205
204
else
206
- t_it->second .offset_is_set = false ;
205
+ t_it->second .reset () ;
207
206
}
208
207
209
208
forall_objects (oit, temp.read ())
@@ -217,7 +216,7 @@ void value_set_fit::flatten_rec(
217
216
if (generalize_index) // this means we had recursive symbols in there
218
217
{
219
218
Forall_objects (it, dest.write ())
220
- it->second .offset_is_set = false ;
219
+ it->second .reset () ;
221
220
}
222
221
223
222
seen.erase (identifier + e.suffix );
@@ -235,8 +234,8 @@ exprt value_set_fit::to_expr(const object_map_dt::value_type &it) const
235
234
236
235
od.object ()=object;
237
236
238
- if (it.second . offset_is_set )
239
- od.offset ()= from_integer (it.second . offset , index_type ());
237
+ if (it.second )
238
+ od.offset () = from_integer (* it.second , index_type ());
240
239
241
240
od.type ()=od.object ().type ();
242
241
@@ -324,13 +323,12 @@ void value_set_fit::get_value_set(
324
323
t_it!=temp.write ().end ();
325
324
t_it++)
326
325
{
327
- if (t_it->second .offset_is_set &&
328
- it->second .offset_is_set )
326
+ if (t_it->second && it->second )
329
327
{
330
- t_it->second . offset += it->second . offset ;
328
+ * t_it->second += * it->second ;
331
329
}
332
330
else
333
- t_it->second .offset_is_set = false ;
331
+ t_it->second .reset () ;
334
332
335
333
flat_map.write ()[t_it->first ]=t_it->second ;
336
334
}
@@ -573,32 +571,31 @@ void value_set_fit::get_value_set_rec(
573
571
574
572
forall_objects (it, pointer_expr_set.read ())
575
573
{
576
- objectt object= it->second ;
574
+ offsett offset = it->second ;
577
575
578
- if (object.offset_is_zero () &&
579
- expr.operands ().size ()==2 )
576
+ if (offset_is_zero (offset) && expr.operands ().size () == 2 )
580
577
{
581
578
if (expr.op0 ().type ().id ()!=ID_pointer)
582
579
{
583
580
mp_integer i;
584
581
if (to_integer (expr.op0 (), i))
585
- object. offset_is_set = false ;
582
+ offset. reset () ;
586
583
else
587
- object. offset = (expr.id ()== ID_plus)? i : -i;
584
+ * offset = (expr.id () == ID_plus) ? i : -i;
588
585
}
589
586
else
590
587
{
591
588
mp_integer i;
592
589
if (to_integer (expr.op1 (), i))
593
- object. offset_is_set = false ;
590
+ offset. reset () ;
594
591
else
595
- object. offset = (expr.id ()== ID_plus)? i : -i;
592
+ * offset = (expr.id () == ID_plus) ? i : -i;
596
593
}
597
594
}
598
595
else
599
- object. offset_is_set = false ;
596
+ offset. reset () ;
600
597
601
- insert (dest, it->first , object );
598
+ insert (dest, it->first , offset );
602
599
}
603
600
604
601
return ;
@@ -737,13 +734,12 @@ void value_set_fit::get_reference_set(
737
734
t_it!=omt.write ().end ();
738
735
t_it++)
739
736
{
740
- if (t_it->second .offset_is_set &&
741
- it->second .offset_is_set )
737
+ if (t_it->second && it->second )
742
738
{
743
- t_it->second . offset += it->second . offset ;
739
+ * t_it->second += * it->second ;
744
740
}
745
741
else
746
- t_it->second .offset_is_set = false ;
742
+ t_it->second .reset () ;
747
743
}
748
744
749
745
forall_objects (it, omt.read ())
@@ -826,13 +822,12 @@ void value_set_fit::get_reference_set_sharing_rec(
826
822
t_it!=t2.write ().end ();
827
823
t_it++)
828
824
{
829
- if (t_it->second .offset_is_set &&
830
- it->second .offset_is_set )
825
+ if (t_it->second && it->second )
831
826
{
832
- t_it->second . offset += it->second . offset ;
827
+ * t_it->second += * it->second ;
833
828
}
834
829
else
835
- t_it->second .offset_is_set = false ;
830
+ t_it->second .reset () ;
836
831
}
837
832
838
833
forall_objects (it2, t2.read ())
@@ -889,17 +884,16 @@ void value_set_fit::get_reference_set_sharing_rec(
889
884
ns.follow (object.type ())!=array_type)
890
885
index_expr.make_typecast (array.type ());
891
886
892
- objectt o= a_it->second ;
887
+ offsett o = a_it->second ;
893
888
mp_integer i;
894
889
895
890
if (offset.is_zero ())
896
891
{
897
892
}
898
- else if (!to_integer (offset, i) &&
899
- o.offset_is_zero ())
900
- o.offset =i;
893
+ else if (!to_integer (offset, i) && offset_is_zero (o))
894
+ *o = i;
901
895
else
902
- o.offset_is_set = false ;
896
+ o.reset () ;
903
897
904
898
insert (dest, index_expr, o);
905
899
}
@@ -936,7 +930,7 @@ void value_set_fit::get_reference_set_sharing_rec(
936
930
}
937
931
else
938
932
{
939
- objectt o= it->second ;
933
+ offsett o = it->second ;
940
934
941
935
exprt member_expr (ID_member, expr.type ());
942
936
member_expr.copy_to_operands (object);
@@ -1189,7 +1183,7 @@ void value_set_fit::do_free(
1189
1183
else
1190
1184
{
1191
1185
// adjust
1192
- objectt o= o_it->second ;
1186
+ offsett o = o_it->second ;
1193
1187
exprt tmp (object);
1194
1188
to_dynamic_object_expr (tmp).valid ()=exprt (ID_unknown);
1195
1189
insert (new_object_map, tmp, o);
0 commit comments