Skip to content

Commit 30a31c5

Browse files
Deprecate value_sett::location_number
This is set to zero and never modified, so there is no point in using this field.
1 parent 2c52ef6 commit 30a31c5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/pointer-analysis/value_set.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,8 @@ void value_sett::get_value_set_rec(
741741
static_cast<const typet &>(expr.find(ID_C_cxx_alloc_type));
742742

743743
dynamic_object_exprt dynamic_object(dynamic_type);
744-
dynamic_object.set_instance(location_number);
744+
PRECONDITION(location_number == 0);
745+
dynamic_object.set_instance(0);
745746
dynamic_object.valid()=true_exprt();
746747

747748
insert(dest, dynamic_object, 0);
@@ -753,7 +754,8 @@ void value_sett::get_value_set_rec(
753754
assert(expr_type.id()==ID_pointer);
754755

755756
dynamic_object_exprt dynamic_object(expr_type.subtype());
756-
dynamic_object.set_instance(location_number);
757+
PRECONDITION(location_number == 0);
758+
dynamic_object.set_instance(0);
757759
dynamic_object.valid()=true_exprt();
758760

759761
insert(dest, dynamic_object, 0);

src/pointer-analysis/value_set.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ class namespacet;
4444
class value_sett
4545
{
4646
public:
47-
value_sett():location_number(0)
47+
value_sett()
4848
{
4949
}
5050

51-
value_sett(value_sett &&other)
52-
: location_number(other.location_number), values(std::move(other.values))
51+
value_sett(value_sett &&other) : values(std::move(other.values))
5352
{
5453
}
5554

@@ -71,6 +70,7 @@ class value_sett
7170

7271
/// Matches the location_number field of the instruction that corresponds
7372
/// to this value_sett instance in value_set_domaint's state map
73+
DEPRECATED(SINCE(2019, 05, 22, "Always zero"))
7474
unsigned location_number;
7575

7676
/// Global shared object numbering, used to abbreviate expressions stored

0 commit comments

Comments
 (0)