Skip to content

Commit 72c857a

Browse files
committed
Adjusts formatting according to code review
1 parent b22524d commit 72c857a

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

src/goto-instrument/code_contracts.cpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static void check_apply_invariants(
149149

150150
// change the back edge into assume(false) or assume(guard)
151151
loop_end->targets.clear();
152-
loop_end->type = ASSUME;
152+
loop_end->type=ASSUME;
153153
if(loop_head->is_goto())
154154
loop_end->set_condition(false_exprt());
155155
else
@@ -265,7 +265,7 @@ bool code_contractst::apply_function_contract(
265265
}
266266

267267
// Replace formal parameters
268-
code_function_callt::argumentst::const_iterator a_it =
268+
code_function_callt::argumentst::const_iterator a_it=
269269
call.arguments().begin();
270270
for(code_typet::parameterst::const_iterator p_it = type.parameters().begin();
271271
p_it != type.parameters().end() && a_it != call.arguments().end();
@@ -480,38 +480,38 @@ void code_contractst::instrument_call_statement(
480480

481481
return;
482482
}
483-
else // Called function has assigns clause
484-
{
485-
replace_symbolt replace;
486-
// Replace formal parameters
487-
code_function_callt::argumentst::const_iterator a_it =
488-
call.arguments().begin();
489-
for(code_typet::parameterst::const_iterator p_it =
490-
called_type.parameters().begin();
491-
p_it != called_type.parameters().end() &&
492-
a_it != call.arguments().end();
493-
++p_it, ++a_it)
483+
else // Called function has assigns clause
494484
{
495-
if(!p_it->get_identifier().empty())
485+
replace_symbolt replace;
486+
// Replace formal parameters
487+
code_function_callt::argumentst::const_iterator a_it =
488+
call.arguments().begin();
489+
for(code_typet::parameterst::const_iterator p_it =
490+
called_type.parameters().begin();
491+
p_it != called_type.parameters().end() &&
492+
a_it != call.arguments().end();
493+
++p_it, ++a_it)
496494
{
497-
symbol_exprt p(p_it->get_identifier(), p_it->type());
498-
replace.insert(p, *a_it);
495+
if(!p_it->get_identifier().empty())
496+
{
497+
symbol_exprt p(p_it->get_identifier(), p_it->type());
498+
replace.insert(p, *a_it);
499+
}
499500
}
500-
}
501501

502-
replace(called_assigns);
503-
504-
// check compatibility of assigns clause with the called function
505-
assigns_clauset called_assigns_clause(
506-
called_assigns, *this, function_id, log);
507-
exprt compatible =
508-
assigns_clause.compatible_expression(called_assigns_clause);
509-
goto_programt alias_assertion;
510-
alias_assertion.add(goto_programt::make_assertion(
511-
compatible, instruction_iterator->source_location));
512-
program.insert_before_swap(instruction_iterator, alias_assertion);
513-
++instruction_iterator;
514-
}
502+
replace(called_assigns);
503+
504+
// check compatibility of assigns clause with the called function
505+
assigns_clauset called_assigns_clause(
506+
called_assigns, *this, function_id, log);
507+
exprt compatible =
508+
assigns_clause.compatible_expression(called_assigns_clause);
509+
goto_programt alias_assertion;
510+
alias_assertion.add(goto_programt::make_assertion(
511+
compatible, instruction_iterator->source_location));
512+
program.insert_before_swap(instruction_iterator, alias_assertion);
513+
++instruction_iterator;
514+
}
515515
}
516516

517517
bool code_contractst::check_for_looped_mallocs(const goto_programt &program)
@@ -785,7 +785,7 @@ void code_contractst::add_contract_check(
785785
.symbol_expr();
786786
check.add(goto_programt::make_decl(r, skip->source_location));
787787

788-
call.lhs() = r;
788+
call.lhs()=r;
789789
return_stmt = code_returnt(r);
790790

791791
symbol_exprt ret_val(CPROVER_PREFIX "return_value", call.lhs().type());

src/goto-instrument/code_contracts.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ class code_contractst
167167
void
168168
add_contract_check(const irep_idt &, const irep_idt &, goto_programt &dest);
169169

170-
// If the expression is a quantified expression, this function adds
171-
// the quantified variable to the symbol table and to the expression map
170+
/// If the expression is a quantified expression, this function adds
171+
/// the quantified variable to the symbol table and to the expression map
172172
void add_quantified_variable(
173173
exprt expression,
174174
replace_symbolt &replace,

0 commit comments

Comments
 (0)