Skip to content

Commit 28f14a3

Browse files
committed
array_typet::subtype is now array_typet::element_type
1 parent 33a9b73 commit 28f14a3

File tree

10 files changed

+19
-19
lines changed

10 files changed

+19
-19
lines changed

src/ebmc/output_verilog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ std::string output_verilog_baset::type_string_base(const typet &type)
532532
}
533533
else if(type.id()==ID_array)
534534
{
535-
return type_string_base(to_array_type(type).subtype());
535+
return type_string_base(to_array_type(type).element_type());
536536
}
537537
else
538538
{
@@ -564,7 +564,7 @@ std::string output_verilog_baset::type_string_array(const typet &type)
564564
auto &array_type = to_array_type(type);
565565
mp_integer size;
566566
to_integer_non_constant(array_type.size(), size);
567-
return type_string_array(array_type.subtype()) +
567+
return type_string_array(array_type.element_type()) +
568568
" [0:" + integer2string(size) + ']';
569569
}
570570

src/hw-cbmc/gen_interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ std::string gen_interfacet::type_to_string(const typet& type)
159159
mp_integer size = 0;
160160
to_integer_non_constant(size_expr, size);
161161

162-
std::string stype_str = type_to_string(array_type.subtype());
162+
std::string stype_str = type_to_string(array_type.element_type());
163163
std::string array_str = "[" + integer2string(size)+"]" ;
164164
std::string key_str = stype_str + array_str;
165165

src/hw-cbmc/map_vars.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,10 @@ bool map_varst::array_types_eq(
241241
}
242242

243243
namespacet ns(symbol_table);
244-
245-
const typet &s1=ns.follow(type1.subtype());
246-
const typet &s2=ns.follow(type2.subtype());
247-
244+
245+
const typet &s1 = ns.follow(type1.element_type());
246+
const typet &s2 = ns.follow(type2.element_type());
247+
248248
if(s1.id()==ID_array && s2.id()==ID_array)
249249
return array_types_eq(to_array_type(s1), to_array_type(s2), error_msg);
250250

@@ -298,7 +298,7 @@ bool map_varst::check_types_rec(
298298
return array_types_eq(to_array_type(type1), to_array_type(type2), error_msg);
299299

300300
// bool-array is mapped to bit-vector
301-
if(to_array_type(type1).subtype().id() != ID_bool)
301+
if(to_array_type(type1).element_type().id() != ID_bool)
302302
{
303303
error_msg = "type `" + from_type(ns, "", type1) +
304304
"' does not match type `" + from_type(ns, "", type2) +
@@ -720,7 +720,7 @@ void map_varst::map_vars(const irep_idt &top_module)
720720
index_exprt expr(
721721
symbol_expr,
722722
timeframe_expr,
723-
to_array_type(ns.follow(symbol_expr.type())).subtype());
723+
to_array_type(ns.follow(symbol_expr.type())).element_type());
724724

725725
top_level_inputs.clear();
726726

src/smvlang/expr2smv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ bool type2smv(const typet &type, std::string &code)
550550
else if(type.id()==ID_array)
551551
{
552552
std::string tmp;
553-
if(type2smv(to_array_type(type).subtype(), tmp))
553+
if(type2smv(to_array_type(type).element_type(), tmp))
554554
return true;
555555
code="array ";
556556
code+="..";

src/trans-netlist/trans_trace.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static mp_integer vcd_width(
267267
else if(type.id()==ID_array)
268268
{
269269
auto &array_type = to_array_type(type);
270-
mp_integer sub = vcd_width(array_type.subtype(), ns);
270+
mp_integer sub = vcd_width(array_type.element_type(), ns);
271271

272272
// get size
273273
const exprt &size = array_type.size();
@@ -526,7 +526,7 @@ static std::string vcd_suffix(
526526

527527
return "[" + integer2string(left_bound) + ":" +
528528
integer2string(right_bound) + "]" +
529-
vcd_suffix(array_type.subtype(), ns);
529+
vcd_suffix(array_type.element_type(), ns);
530530
}
531531
else if(type.id()==ID_bool)
532532
return "";

src/trans-netlist/trans_trace_netlist.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ exprt bitstring_to_expr(const std::string &src, const typet &type)
7171
std::size_t op_width=src.size()/size_int;
7272

7373
for(std::size_t i=0; i<size_int; i++)
74-
value_expr.operands()[size_int-i-1]=bitstring_to_expr(
75-
std::string(src, i*op_width, op_width), array_type.subtype());
74+
value_expr.operands()[size_int - i - 1] = bitstring_to_expr(
75+
std::string(src, i * op_width, op_width), array_type.element_type());
7676
}
7777

7878
return value_expr;

src/verilog/expr2verilog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ std::string expr2verilogt::convert(const typet &type)
11201120
dest += convert(array_type.size());
11211121

11221122
dest+="] of ";
1123-
dest += convert(array_type.subtype());
1123+
dest += convert(array_type.element_type());
11241124

11251125
return dest;
11261126
}

src/verilog/verilog_typecheck_base.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ std::size_t verilog_typecheck_baset::get_width(const typet &type)
185185

186186
if(type.id()==ID_array)
187187
{
188-
mp_integer subtype_width = get_width(to_array_type(type).subtype());
189-
return (array_size(type) * subtype_width).to_ulong();
188+
mp_integer element_width = get_width(to_array_type(type).element_type());
189+
return (array_size(type) * element_width).to_ulong();
190190
}
191191

192192
if(type.id()==ID_integer)

src/verilog/verilog_typecheck_expr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ void verilog_typecheck_exprt::convert_extractbit_expr(extractbit_exprt &expr)
16211621
op1 = typecast_exprt{op1, _index_type};
16221622
}
16231623

1624-
expr.type() = to_array_type(op0.type()).subtype();
1624+
expr.type() = to_array_type(op0.type()).element_type();
16251625
expr.id(ID_index);
16261626
}
16271627
else

src/vhdl/expr2vhdl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ std::string expr2vhdlt::convert(const typet &type)
801801
dest += convert(array_type.size());
802802

803803
dest+="] of ";
804-
dest += convert(array_type.subtype());
804+
dest += convert(array_type.element_type());
805805

806806
return dest;
807807
}

0 commit comments

Comments
 (0)