Skip to content

Commit 087296a

Browse files
authored
Merge pull request #6577 from diffblue/c_index_type
rename index_type and enum_constant_type
2 parents 5887174 + 4271a0a commit 087296a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+131
-122
lines changed

src/analyses/local_may_alias.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void local_may_aliast::get_rec(
217217
if(index_expr.array().id()==ID_symbol)
218218
{
219219
index_exprt tmp1=index_expr;
220-
tmp1.index()=from_integer(0, index_type());
220+
tmp1.index() = from_integer(0, c_index_type());
221221
address_of_exprt tmp2(tmp1);
222222
unsigned object_nr=objects.number(tmp2);
223223
dest.insert(object_nr);
@@ -229,7 +229,7 @@ void local_may_aliast::get_rec(
229229
else if(index_expr.array().id()==ID_string_constant)
230230
{
231231
index_exprt tmp1=index_expr;
232-
tmp1.index()=from_integer(0, index_type());
232+
tmp1.index() = from_integer(0, c_index_type());
233233
address_of_exprt tmp2(tmp1);
234234
unsigned object_nr=objects.number(tmp2);
235235
dest.insert(object_nr);

src/ansi-c/ansi_c_entry_point.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ bool generate_ansi_c_start_function(
448448

449449
{
450450
index_exprt index_expr(
451-
argv_symbol.symbol_expr(), from_integer(0, index_type()));
451+
argv_symbol.symbol_expr(), from_integer(0, c_index_type()));
452452

453453
// disable bounds check on that one
454454
index_expr.set(ID_C_bounds_check, false);
@@ -466,7 +466,7 @@ bool generate_ansi_c_start_function(
466466
const symbolt &envp_symbol=ns.lookup("envp'");
467467

468468
index_exprt index_expr(
469-
envp_symbol.symbol_expr(), from_integer(0, index_type()));
469+
envp_symbol.symbol_expr(), from_integer(0, c_index_type()));
470470

471471
const pointer_typet &pointer_type =
472472
to_pointer_type(parameters[2].type());

src/ansi-c/c_typecast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ void c_typecastt::do_typecast(exprt &expr, const typet &dest_type)
722722

723723
if(src_type.id()==ID_array)
724724
{
725-
index_exprt index(expr, from_integer(0, index_type()));
725+
index_exprt index(expr, from_integer(0, c_index_type()));
726726
expr = typecast_exprt::conditional_cast(address_of_exprt(index), dest_type);
727727
return;
728728
}

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr)
11851185
}
11861186
else if(op_type.id()==ID_array)
11871187
{
1188-
index_exprt index(op, from_integer(0, index_type()));
1188+
index_exprt index(op, from_integer(0, c_index_type()));
11891189
op=address_of_exprt(index);
11901190
}
11911191
else if(op_type.id()==ID_empty)
@@ -1245,7 +1245,7 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr)
12451245

12461246
void c_typecheck_baset::make_index_type(exprt &expr)
12471247
{
1248-
implicit_typecast(expr, index_type());
1248+
implicit_typecast(expr, c_index_type());
12491249
}
12501250

12511251
void c_typecheck_baset::typecheck_expr_index(exprt &expr)
@@ -1456,7 +1456,7 @@ void c_typecheck_baset::typecheck_expr_ptrmember(exprt &expr)
14561456
if(op0_type.id() == ID_array)
14571457
{
14581458
// a->f is the same as a[0].f
1459-
exprt zero=from_integer(0, index_type());
1459+
exprt zero = from_integer(0, c_index_type());
14601460
index_exprt index_expr(op, zero, op0_type.subtype());
14611461
index_expr.set(ID_C_lvalue, true);
14621462
op.swap(index_expr);
@@ -1774,7 +1774,7 @@ void c_typecheck_baset::typecheck_expr_dereference(exprt &expr)
17741774
// *a is the same as a[0]
17751775
expr.id(ID_index);
17761776
expr.type()=op_type.subtype();
1777-
expr.copy_to_operands(from_integer(0, index_type()));
1777+
expr.copy_to_operands(from_integer(0, c_index_type()));
17781778
assert(expr.operands().size()==2);
17791779
}
17801780
else if(op_type.id()==ID_pointer)

src/ansi-c/c_typecheck_gcc_polymorphic_builtins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ exprt c_typecheck_baset::typecheck_shuffle_vector(
14451445
for(std::size_t i = 0; i < indices_size; ++i)
14461446
{
14471447
// only the least significant bits of each mask element are considered
1448-
mod_exprt mod_index{index_exprt{indices, from_integer(i, index_type())},
1448+
mod_exprt mod_index{index_exprt{indices, from_integer(i, c_index_type())},
14491449
size};
14501450
mod_index.add_source_location() = source_location;
14511451
operands.push_back(std::move(mod_index));

src/ansi-c/c_typecheck_initializer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ exprt::operandst::const_iterator c_typecheck_baset::do_designated_initializer(
542542
if(current_symbol.is_static_lifetime)
543543
{
544544
byte_update_exprt byte_update =
545-
make_byte_update(*dest, from_integer(0, index_type()), *zero);
545+
make_byte_update(*dest, from_integer(0, c_index_type()), *zero);
546546
byte_update.add_source_location() = value.source_location();
547547
*dest = std::move(byte_update);
548548
dest = &(to_byte_update_expr(*dest).op2());
@@ -1029,7 +1029,7 @@ exprt c_typecheck_baset::do_initializer_list(
10291029
// make complete by setting array size
10301030
size_t size=result.operands().size();
10311031
result.type().id(ID_array);
1032-
result.type().set(ID_size, from_integer(size, index_type()));
1032+
result.type().set(ID_size, from_integer(size, c_index_type()));
10331033
}
10341034

10351035
return result;

src/ansi-c/c_typecheck_type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ void c_typecheck_baset::typecheck_compound_body(
10111011

10121012
// make it zero-length
10131013
c_type.id(ID_array);
1014-
c_type.set(ID_size, from_integer(0, index_type()));
1014+
c_type.set(ID_size, from_integer(0, c_index_type()));
10151015
}
10161016
}
10171017
}

src/ansi-c/literals/convert_string_literal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ exprt convert_string_literal(const std::string &src)
127127
result.set(ID_C_string_constant, true);
128128
result.type()=typet(ID_array);
129129
result.type().subtype()=subtype;
130-
result.type().set(ID_size, from_integer(value.size(), index_type()));
130+
result.type().set(ID_size, from_integer(value.size(), c_index_type()));
131131

132132
result.operands().resize(value.size());
133133
for(std::size_t i=0; i<value.size(); i++)

src/cpp/cpp_constructor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ optionalt<codet> cpp_typecheckt::cpp_constructor(
9797
{
9898
exprt::operandst tmp_operands;
9999

100-
exprt constant=from_integer(i, index_type());
100+
exprt constant = from_integer(i, c_index_type());
101101
constant.add_source_location()=source_location;
102102

103103
index_exprt index(object, constant);

src/cpp/cpp_destructor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ optionalt<codet> cpp_typecheckt::cpp_destructor(
5656
// for each element of the array, call the destructor
5757
for(mp_integer i=0; i < s; ++i)
5858
{
59-
exprt constant=from_integer(i, index_type());
59+
exprt constant = from_integer(i, c_index_type());
6060
constant.add_source_location()=source_location;
6161

6262
index_exprt index(object, constant);

0 commit comments

Comments
 (0)