Skip to content

Commit d82e489

Browse files
committed
bump CBMC dependency
1 parent 11158c9 commit d82e489

File tree

7 files changed

+27
-33
lines changed

7 files changed

+27
-33
lines changed

lib/cbmc

Submodule cbmc updated 511 files

src/hw-cbmc/map_vars.cpp

+11-17
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ bool map_varst::array_types_eq(
243243

244244
namespacet ns(symbol_table);
245245

246-
const typet &s1 = ns.follow(type1.element_type());
247-
const typet &s2 = ns.follow(type2.element_type());
246+
const typet &s1 = type1.element_type();
247+
const typet &s2 = type2.element_type();
248248

249249
if(s1.id()==ID_array && s2.id()==ID_array)
250250
return array_types_eq(to_array_type(s1), to_array_type(s2), error_msg);
@@ -279,12 +279,6 @@ bool map_varst::check_types_rec(
279279
{
280280
namespacet ns(symbol_table);
281281

282-
if(type1.id()==ID_symbol)
283-
return check_types_rec(ns.follow(type1), type2, error_msg);
284-
285-
if(type2.id()==ID_symbol)
286-
return check_types_rec(type1, ns.follow(type2), error_msg);
287-
288282
// type is the same?
289283
if(type1 == type2)
290284
return false;
@@ -357,8 +351,8 @@ void map_varst::add_constraint_rec(
357351
{
358352
namespacet ns(symbol_table);
359353

360-
const typet &t1=ns.follow(program_symbol.type());
361-
const typet &t2=ns.follow(module_symbol.type());
354+
const typet &t1=program_symbol.type();
355+
const typet &t2=module_symbol.type();
362356

363357
// check the type
364358
if(t1==t2)
@@ -426,7 +420,7 @@ const symbolt &map_varst::add_array(symbolt &symbol)
426420
{
427421
const namespacet ns(symbol_table);
428422

429-
const typet &full_type=ns.follow(symbol.type);
423+
const typet &full_type=symbol.type;
430424

431425
if(full_type.id()==ID_incomplete_array)
432426
{
@@ -514,7 +508,7 @@ void map_varst::map_var_rec(
514508
const irep_idt &prefix)
515509
{
516510
const namespacet ns(symbol_table);
517-
const typet &expr_type=ns.follow(expr.type());
511+
const typet &expr_type=expr.type();
518512
const struct_typet &struct_type=to_struct_type(expr_type);
519513
const struct_typet::componentst &components=struct_type.components();
520514

@@ -535,7 +529,7 @@ void map_varst::map_var_rec(
535529
else
536530
base_name=name;
537531

538-
bool module_instance=ns.follow(c_it->type()).id()==ID_struct;
532+
bool module_instance=c_it->type().id()==ID_struct;
539533

540534
irep_idt full_name=id2string(prefix)+"."+id2string(base_name);
541535

@@ -603,8 +597,8 @@ void map_varst::map_var(
603597

604598
const namespacet ns(symbol_table);
605599

606-
const typet &type1=ns.follow(program_symbol.type());
607-
const typet &type2=ns.follow(module_symbol.type);
600+
const typet &type1=program_symbol.type();
601+
const typet &type2=module_symbol.type;
608602

609603
std::string error_msg;
610604
if(check_types_rec(type1, type2, error_msg))
@@ -721,7 +715,7 @@ void map_varst::map_vars(const irep_idt &top_module)
721715
index_exprt expr(
722716
symbol_expr,
723717
timeframe_expr,
724-
to_array_type(ns.follow(symbol_expr.type())).element_type());
718+
to_array_type(symbol_expr.type()).element_type());
725719

726720
top_level_inputs.clear();
727721

@@ -733,7 +727,7 @@ void map_varst::map_vars(const irep_idt &top_module)
733727
const irep_idt &base_name = entry.second.base_name;
734728
symbolt &symbol = symbol_table.get_writeable_ref(entry.first);
735729
if (symbol.type.id() == ID_struct_tag)
736-
symbol.type = ns.follow(symbol.type);
730+
symbol.type = symbol.type;
737731
if (base_name == "next_timeframe" && symbol.type.id() == ID_code) {
738732
namespacet ns(symbol_table);
739733
add_next_timeframe(symbol, struct_symbol, top_level_inputs, ns);

src/hw-cbmc/next_timeframe.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void add_next_timeframe(
5151
block.add(assignment_increase);
5252

5353
const struct_typet &struct_type =
54-
to_struct_type(ns.follow(struct_symbol.type));
54+
to_struct_type(struct_symbol.type);
5555

5656
// now assign the non-inputs in the module symbol
5757
const index_exprt index_expr(array_symbol.symbol_expr(),

src/hw-cbmc/set_inputs.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void add_set_inputs(
4040
const symbolt &timeframe_symbol=ns.lookup("hw-cbmc::timeframe");
4141

4242
const struct_typet &struct_type=
43-
to_struct_type(ns.follow(struct_symbol.type));
43+
to_struct_type(struct_symbol.type);
4444

4545
// We now assume current input values to be equal,
4646
// with the goal of adding assumptions on inputs.

src/trans-netlist/trans_trace.cpp

+6-10
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,10 @@ static mp_integer vcd_width(
387387
const typet &type,
388388
const namespacet &ns)
389389
{
390-
if(type.id()==ID_symbol)
391-
return vcd_width(ns.follow(type), ns);
392-
else if(type.id()==ID_unsignedbv ||
393-
type.id()==ID_signedbv ||
394-
type.id()==ID_bv ||
395-
type.id()==ID_fixedbv ||
396-
type.id()==ID_floatbv ||
397-
type.id()==ID_pointer)
390+
if(
391+
type.id() == ID_unsignedbv || type.id() == ID_signedbv ||
392+
type.id() == ID_bv || type.id() == ID_fixedbv || type.id() == ID_floatbv ||
393+
type.id() == ID_pointer)
398394
{
399395
return to_bitvector_type(type).get_width();
400396
}
@@ -456,8 +452,8 @@ static std::string as_vcd_binary(
456452
const exprt &expr,
457453
const namespacet &ns)
458454
{
459-
const typet &type=ns.follow(expr.type());
460-
455+
const auto &type = expr.type();
456+
461457
if(expr.id()==ID_constant)
462458
{
463459
if(

src/verilog/convert_literals.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ constant_exprt convert_real_literal(const irep_idt &value)
103103
// adjust exponent
104104
exponent -= str_fraction_part.size();
105105

106-
ieee_floatt ieee_float{ieee_float_spect::double_precision()};
106+
// IEEE 1800-2017 5.7.2 says that real literal constants
107+
// are IEEE 754 double-precision, but doesn't specify
108+
// how to round when converting decimals.
109+
ieee_floatt ieee_float{
110+
ieee_float_spect::double_precision(),
111+
ieee_floatt::rounding_modet::ROUND_TO_EVEN};
107112

108113
ieee_float.from_base10(significand, exponent);
109114

src/verilog/expr2verilog.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1246,8 +1246,7 @@ expr2verilogt::convert_constant(const constant_exprt &src)
12461246
{
12471247
constant_exprt tmp = src;
12481248
tmp.type() = ieee_float_spect::double_precision().to_type();
1249-
ieee_floatt ieee_float;
1250-
ieee_float.from_expr(tmp);
1249+
auto ieee_float = ieee_float_valuet{tmp};
12511250
return {precedence, ieee_float.to_ansi_c_string()};
12521251
}
12531252
else if(type.id() == ID_string)

0 commit comments

Comments
 (0)