Skip to content

Commit 5284894

Browse files
authored
Merge pull request #4326 from karkhaz/kk-non-functional
Pre-contracts whitespace changes
2 parents 16c64cf + 8afda0b commit 5284894

File tree

7 files changed

+33
-17
lines changed

7 files changed

+33
-17
lines changed

src/analyses/dependence_graph.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ void dep_graph_domaint::data_dependencies(
176176
{
177177
bool found=false;
178178
for(const auto &wr : w_range.second)
179+
{
179180
for(const auto &r_range : r_ranges)
181+
{
180182
if(!found &&
181183
may_be_def_use_pair(wr.first, wr.second,
182184
r_range.first, r_range.second))
@@ -185,6 +187,8 @@ void dep_graph_domaint::data_dependencies(
185187
data_deps.insert(w_range.first);
186188
found=true;
187189
}
190+
}
191+
}
188192
}
189193

190194
dep_graph.reaching_definitions()[to].clear_cache(it->first);

src/analyses/goto_rw.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,18 @@ void rw_range_sett::get_objects_address_of(const exprt &object)
431431
object.id() == ID_label ||
432432
object.id() == ID_array ||
433433
object.id() == ID_null_object)
434+
{
434435
// constant, nothing to do
435436
return;
437+
}
436438
else if(object.id()==ID_symbol)
439+
{
437440
get_objects_rec(get_modet::READ, object);
441+
}
438442
else if(object.id()==ID_dereference)
443+
{
439444
get_objects_rec(get_modet::READ, object);
445+
}
440446
else if(object.id()==ID_index)
441447
{
442448
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
}
@@ -728,7 +728,7 @@ void bv_pointerst::add_addr(const exprt &expr, bvt &bv)
728728
void bv_pointerst::do_postponed(
729729
const postponedt &postponed)
730730
{
731-
if(postponed.expr.id()==ID_dynamic_object)
731+
if(postponed.expr.id() == ID_dynamic_object)
732732
{
733733
const pointer_logict::objectst &objects=
734734
pointer_logic.objects;

src/solvers/smt2/smt2_conv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ void smt2_convt::convert_expr(const exprt &expr)
13341334
if(ext>0)
13351335
out << ")"; // zero_extend
13361336
}
1337-
else if(expr.id()==ID_dynamic_object)
1337+
else if(expr.id() == ID_dynamic_object)
13381338
{
13391339
convert_is_dynamic_object(expr);
13401340
}

src/util/simplify_expr.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,8 +2403,10 @@ bool simplify_exprt::simplify_node(exprt &expr)
24032403
result=simplify_byte_extract(to_byte_extract_expr(expr)) && result;
24042404
else if(expr.id()==ID_pointer_object)
24052405
result=simplify_pointer_object(expr) && result;
2406-
else if(expr.id()==ID_dynamic_object)
2407-
result=simplify_dynamic_object(expr) && result;
2406+
else if(expr.id() == ID_dynamic_object)
2407+
{
2408+
result = simplify_dynamic_object(expr) && result;
2409+
}
24082410
else if(expr.id()==ID_invalid_pointer)
24092411
result=simplify_invalid_pointer(expr) && result;
24102412
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
@@ -1688,11 +1688,12 @@ bool simplify_exprt::simplify_inequality_constant(exprt &expr)
16881688
if(expr.op0().id()==ID_address_of &&
16891689
expr.op0().operands().size()==1)
16901690
{
1691-
if(expr.op0().op0().id()==ID_symbol ||
1692-
expr.op0().op0().id()==ID_dynamic_object ||
1693-
expr.op0().op0().id()==ID_member ||
1694-
expr.op0().op0().id()==ID_index ||
1695-
expr.op0().op0().id()==ID_string_constant)
1691+
if(
1692+
expr.op0().op0().id() == ID_symbol ||
1693+
expr.op0().op0().id() == ID_dynamic_object ||
1694+
expr.op0().op0().id() == ID_member ||
1695+
expr.op0().op0().id() == ID_index ||
1696+
expr.op0().op0().id() == ID_string_constant)
16961697
{
16971698
expr=false_exprt();
16981699
return false;

src/util/simplify_expr_pointer.cpp

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

467467
if(op.id()==ID_address_of)
468468
{
469-
if(op.operands().size()!=1 ||
470-
(op.op0().id()!=ID_symbol &&
471-
op.op0().id()!=ID_dynamic_object &&
472-
op.op0().id()!=ID_string_constant))
469+
if(
470+
op.operands().size() != 1 ||
471+
(op.op0().id() != ID_symbol && op.op0().id() != ID_dynamic_object &&
472+
op.op0().id() != ID_string_constant))
473+
{
473474
return true;
475+
}
474476
}
475-
else if(op.id()!=ID_constant ||
476-
op.get(ID_value)!=ID_NULL)
477+
else if(op.id() != ID_constant || op.get(ID_value) != ID_NULL)
478+
{
477479
return true;
480+
}
478481
}
479482

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

0 commit comments

Comments
 (0)