Skip to content

Commit 8afda0b

Browse files
committed
Whitespace fixes in prep for contracts patchset
This commit is whitespace changes to code that will be changed in a future commit. The code changes will all be fairly subtle, so this commit aims to do the whitespace changes in advance to make reviewers' lives easier.
1 parent 66c662f commit 8afda0b

File tree

6 files changed

+29
-17
lines changed

6 files changed

+29
-17
lines changed

src/analyses/goto_rw.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,18 @@ void rw_range_sett::get_objects_address_of(const exprt &object)
432432
object.id() == ID_label ||
433433
object.id() == ID_array ||
434434
object.id() == ID_null_object)
435+
{
435436
// constant, nothing to do
436437
return;
438+
}
437439
else if(object.id()==ID_symbol)
440+
{
438441
get_objects_rec(get_modet::READ, object);
442+
}
439443
else if(object.id()==ID_dereference)
444+
{
440445
get_objects_rec(get_modet::READ, object);
446+
}
441447
else if(object.id()==ID_index)
442448
{
443449
const index_exprt &index=to_index_expr(object);

src/solvers/flattening/bv_pointers.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ literalt bv_pointerst::convert_rest(const exprt &expr)
5454
literalt l=prop.new_variable();
5555

5656
postponed_list.push_back(postponedt());
57-
postponed_list.back().op=convert_bv(operands[0]);
57+
postponed_list.back().op = convert_bv(operands[0]);
5858
postponed_list.back().bv.push_back(l);
59-
postponed_list.back().expr=expr;
59+
postponed_list.back().expr = expr;
6060

6161
return l;
6262
}
@@ -734,7 +734,7 @@ void bv_pointerst::add_addr(const exprt &expr, bvt &bv)
734734
void bv_pointerst::do_postponed(
735735
const postponedt &postponed)
736736
{
737-
if(postponed.expr.id()==ID_dynamic_object)
737+
if(postponed.expr.id() == ID_dynamic_object)
738738
{
739739
const pointer_logict::objectst &objects=
740740
pointer_logic.objects;

src/solvers/smt2/smt2_conv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ void smt2_convt::convert_expr(const exprt &expr)
13981398
if(ext>0)
13991399
out << ")"; // zero_extend
14001400
}
1401-
else if(expr.id()==ID_dynamic_object)
1401+
else if(expr.id() == ID_dynamic_object)
14021402
{
14031403
convert_is_dynamic_object(expr);
14041404
}

src/util/simplify_expr.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,8 +2166,10 @@ bool simplify_exprt::simplify_node(exprt &expr)
21662166
result=simplify_byte_extract(to_byte_extract_expr(expr)) && result;
21672167
else if(expr.id()==ID_pointer_object)
21682168
result=simplify_pointer_object(expr) && result;
2169-
else if(expr.id()==ID_dynamic_object)
2170-
result=simplify_dynamic_object(expr) && result;
2169+
else if(expr.id() == ID_dynamic_object)
2170+
{
2171+
result = simplify_dynamic_object(expr) && result;
2172+
}
21712173
else if(expr.id()==ID_invalid_pointer)
21722174
result=simplify_invalid_pointer(expr) && result;
21732175
else if(expr.id()==ID_object_size)

src/util/simplify_expr_int.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,11 +1706,12 @@ bool simplify_exprt::simplify_inequality_constant(exprt &expr)
17061706
if(expr.op0().id()==ID_address_of &&
17071707
expr.op0().operands().size()==1)
17081708
{
1709-
if(expr.op0().op0().id()==ID_symbol ||
1710-
expr.op0().op0().id()==ID_dynamic_object ||
1711-
expr.op0().op0().id()==ID_member ||
1712-
expr.op0().op0().id()==ID_index ||
1713-
expr.op0().op0().id()==ID_string_constant)
1709+
if(
1710+
expr.op0().op0().id() == ID_symbol ||
1711+
expr.op0().op0().id() == ID_dynamic_object ||
1712+
expr.op0().op0().id() == ID_member ||
1713+
expr.op0().op0().id() == ID_index ||
1714+
expr.op0().op0().id() == ID_string_constant)
17141715
{
17151716
expr=false_exprt();
17161717
return false;

src/util/simplify_expr_pointer.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,15 +463,18 @@ bool simplify_exprt::simplify_inequality_pointer_object(exprt &expr)
463463

464464
if(op.id()==ID_address_of)
465465
{
466-
if(op.operands().size()!=1 ||
467-
(op.op0().id()!=ID_symbol &&
468-
op.op0().id()!=ID_dynamic_object &&
469-
op.op0().id()!=ID_string_constant))
466+
if(
467+
op.operands().size() != 1 ||
468+
(op.op0().id() != ID_symbol && op.op0().id() != ID_dynamic_object &&
469+
op.op0().id() != ID_string_constant))
470+
{
470471
return true;
472+
}
471473
}
472-
else if(op.id()!=ID_constant ||
473-
op.get(ID_value)!=ID_NULL)
474+
else if(op.id() != ID_constant || op.get(ID_value) != ID_NULL)
475+
{
474476
return true;
477+
}
475478
}
476479

477480
bool equal=expr.op0().op0()==expr.op1().op0();

0 commit comments

Comments
 (0)