Skip to content

Commit cd9d007

Browse files
committed
Whitespace and line breaks to match coding guidelines (part 2)
1 parent 9dda7a9 commit cd9d007

File tree

484 files changed

+11652
-7928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

484 files changed

+11652
-7928
lines changed

src/aa-path-symex/path_symex.cpp

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Author: Daniel Kroening, [email protected]
1919

2020
#include "path_symex.h"
2121

22-
//#define DEBUG
22+
// #define DEBUG
2323

2424
#ifdef DEBUG
2525
#include <iostream>
@@ -304,7 +304,8 @@ void path_symext::symex_malloc(
304304
mp_integer elements=alloc_size/elem_size;
305305

306306
if(elements*elem_size==alloc_size)
307-
object_type=array_typet(tmp_type, from_integer(elements, tmp_size.type()));
307+
object_type=
308+
array_typet(tmp_type, from_integer(elements, tmp_size.type()));
308309
}
309310
}
310311
}
@@ -329,8 +330,6 @@ void path_symext::symex_malloc(
329330
size_symbol.type=tmp_size.type();
330331
size_symbol.mode=ID_C;
331332

332-
//state.var_map(size_symbol.name, suffix, size_symbol.type);
333-
334333
assign(state,
335334
size_symbol.symbol_expr(),
336335
size);
@@ -342,15 +341,14 @@ void path_symext::symex_malloc(
342341
// value
343342
symbolt value_symbol;
344343

345-
value_symbol.base_name="dynamic_object"+std::to_string(state.var_map.dynamic_count);
344+
value_symbol.base_name=
345+
"dynamic_object"+std::to_string(state.var_map.dynamic_count);
346346
value_symbol.name="symex_dynamic::"+id2string(value_symbol.base_name);
347347
value_symbol.is_lvalue=true;
348348
value_symbol.type=object_type;
349349
value_symbol.type.set("#dynamic", true);
350350
value_symbol.mode=ID_C;
351351

352-
//state.var_map(value_symbol.name, suffix, value_symbol.type);
353-
354352
address_of_exprt rhs;
355353

356354
if(object_type.id()==ID_array)
@@ -391,11 +389,11 @@ void path_symext::assign_rec(
391389
const exprt &ssa_lhs,
392390
const exprt &ssa_rhs)
393391
{
394-
//const typet &ssa_lhs_type=state.var_map.ns.follow(ssa_lhs.type());
392+
// const typet &ssa_lhs_type=state.var_map.ns.follow(ssa_lhs.type());
395393

396394
#ifdef DEBUG
397395
std::cout << "assign_rec: " << ssa_lhs.pretty() << std::endl;
398-
//std::cout << "ssa_lhs_type: " << ssa_lhs_type.id() << std::endl;
396+
// std::cout << "ssa_lhs_type: " << ssa_lhs_type.id() << std::endl;
399397
#endif
400398

401399
if(ssa_lhs.id()==ID_symbol)
@@ -586,7 +584,8 @@ void path_symext::assign_rec(
586584
{
587585
exprt new_rhs=
588586
ssa_rhs.is_nil()?ssa_rhs:
589-
simplify_expr(member_exprt(ssa_rhs, components[i].get_name(), components[i].type()),
587+
simplify_expr(
588+
member_exprt(ssa_rhs, components[i].get_name(), components[i].type()),
590589
state.var_map.ns);
591590
assign_rec(state, guard, operands[i], new_rhs);
592591
}
@@ -608,7 +607,11 @@ void path_symext::assign_rec(
608607
{
609608
exprt new_rhs=
610609
ssa_rhs.is_nil()?ssa_rhs:
611-
simplify_expr(index_exprt(ssa_rhs, from_integer(i, index_type()), array_type.subtype()),
610+
simplify_expr(
611+
index_exprt(
612+
ssa_rhs,
613+
from_integer(i, index_type()),
614+
array_type.subtype()),
612615
state.var_map.ns);
613616
assign_rec(state, guard, operands[i], new_rhs);
614617
}
@@ -625,7 +628,11 @@ void path_symext::assign_rec(
625628
{
626629
exprt new_rhs=
627630
ssa_rhs.is_nil()?ssa_rhs:
628-
simplify_expr(index_exprt(ssa_rhs, from_integer(i, index_type()), vector_type.subtype()),
631+
simplify_expr(
632+
index_exprt(
633+
ssa_rhs,
634+
from_integer(i, index_type()),
635+
vector_type.subtype()),
629636
state.var_map.ns);
630637
assign_rec(state, guard, operands[i], new_rhs);
631638
}
@@ -677,7 +684,9 @@ void path_symext::function_call_rec(
677684
state.locs.function_map.find(function_identifier);
678685

679686
if(f_it==state.locs.function_map.end())
680-
throw "failed to find `"+id2string(function_identifier)+"' in function_map";
687+
throw
688+
"failed to find `"+id2string(function_identifier)+
689+
"' in function_map";
681690

682691
const locst::function_entryt &function_entry=f_it->second;
683692

@@ -697,7 +706,8 @@ void path_symext::function_call_rec(
697706
}
698707

699708
// push a frame on the call stack
700-
path_symex_statet::threadt &thread=state.threads[state.get_current_thread()];
709+
path_symex_statet::threadt &thread=
710+
state.threads[state.get_current_thread()];
701711
thread.call_stack.push_back(path_symex_statet::framet());
702712
thread.call_stack.back().current_function=function_identifier;
703713
thread.call_stack.back().return_location=thread.pc.next_loc();
@@ -748,7 +758,7 @@ void path_symext::function_call_rec(
748758
const if_exprt &if_expr=to_if_expr(function);
749759
exprt guard=if_expr.cond();
750760

751-
if (state.is_lazy())
761+
if(state.is_lazy())
752762
{
753763
const exprt &case_expr=state.restore_branch()?
754764
if_expr.true_case():if_expr.false_case();
@@ -762,7 +772,8 @@ void path_symext::function_call_rec(
762772
path_symex_statet &false_state=further_states.back();
763773
false_state.record_branch_step(false);
764774
false_state.history->guard=not_exprt(guard);
765-
function_call_rec(further_states.back(), call, if_expr.false_case(), further_states);
775+
function_call_rec(
776+
further_states.back(), call, if_expr.false_case(), further_states);
766777
}
767778

768779
// do the true-case in 'state'
@@ -893,11 +904,10 @@ void path_symext::do_goto(
893904
#endif
894905

895906
#ifdef PATH_SYMEX_FORK
896-
if (pid==-1)
897-
// forking failed so continue as if PATH_SYMEX_FORK were undefined
907+
// forking failed so continue as if PATH_SYMEX_FORK were undefined
908+
if(pid==-1) // NOLINT(readability/braces)
898909
#endif
899910
{
900-
901911
#ifdef PATH_SYMEX_LAZY_STATE
902912
// lazily copy the state into 'further_states'
903913
further_states.push_back(path_symex_statet::lazy_copy(state));
@@ -913,9 +923,9 @@ void path_symext::do_goto(
913923
}
914924

915925
#ifdef PATH_SYMEX_FORK
916-
if (pid!=0)
917-
// parent process (regardless of any possible fork errors)
918-
// should finish to explore all current 'further_states'
926+
// parent process (regardless of any possible fork errors)
927+
// should finish to explore all current 'further_states'
928+
if(pid!=0) // NOLINT(readability/braces)
919929
#endif
920930
{
921931
// branch not taken case
@@ -1024,7 +1034,8 @@ void path_symext::operator()(
10241034

10251035
// ordering of the following matters due to vector instability
10261036
path_symex_statet::threadt &new_thread=state.add_thread();
1027-
path_symex_statet::threadt &old_thread=state.threads[state.get_current_thread()];
1037+
path_symex_statet::threadt &old_thread=
1038+
state.threads[state.get_current_thread()];
10281039
new_thread.pc=loc.branch_target;
10291040
new_thread.local_vars=old_thread.local_vars;
10301041
}
@@ -1036,7 +1047,7 @@ void path_symext::operator()(
10361047
break;
10371048

10381049
case GOTO:
1039-
if (state.is_lazy())
1050+
if(state.is_lazy())
10401051
do_goto(state, state.restore_branch());
10411052
else
10421053
do_goto(state, further_states);
@@ -1103,7 +1114,8 @@ void path_symext::operator()(
11031114

11041115
case FUNCTION_CALL:
11051116
state.record_step();
1106-
function_call(state, to_code_function_call(instruction.code), further_states);
1117+
function_call(
1118+
state, to_code_function_call(instruction.code), further_states);
11071119
break;
11081120

11091121
case OTHER:

src/aa-path-symex/path_symex_state.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Author: Daniel Kroening, [email protected]
2020

2121
#include "path_symex_state.h"
2222

23-
//#define DEBUG
23+
// #define DEBUG
2424

2525
#ifdef DEBUG
2626
#include <iostream>
@@ -151,7 +151,7 @@ Function: path_symex_statet::read
151151
exprt path_symex_statet::read(const exprt &src, bool propagate)
152152
{
153153
#ifdef DEBUG
154-
//std::cout << "path_symex_statet::read " << src.pretty() << std::endl;
154+
// std::cout << "path_symex_statet::read " << src.pretty() << std::endl;
155155
#endif
156156

157157
// This has five phases!
@@ -175,7 +175,7 @@ exprt path_symex_statet::read(const exprt &src, bool propagate)
175175
exprt tmp5=simplify_expr(tmp4, var_map.ns);
176176

177177
#ifdef DEBUG
178-
//std::cout << " ==> " << tmp.pretty() << std::endl;
178+
// std::cout << " ==> " << tmp.pretty() << std::endl;
179179
#endif
180180

181181
return tmp5;
@@ -634,7 +634,8 @@ exprt path_symex_statet::instantiate_rec_address(
634634
{
635635
if_exprt if_expr=to_if_expr(src);
636636
if_expr.true_case()=instantiate_rec_address(if_expr.true_case(), propagate);
637-
if_expr.false_case()=instantiate_rec_address(if_expr.false_case(), propagate);
637+
if_expr.false_case()=
638+
instantiate_rec_address(if_expr.false_case(), propagate);
638639
if_expr.cond()=instantiate_rec(if_expr.cond(), propagate);
639640
return if_expr;
640641
}

src/aa-symex/path_search.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ path_searcht::resultt path_searcht::operator()(
177177
{
178178
// either a child found and reported a bug or
179179
// the parent's search partition is safe
180-
switch (exit_status)
180+
switch(exit_status)
181181
{
182182
case 0: return SAFE;
183183
case 10: return UNSAFE;

src/analyses/cfg_dominators.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,15 @@ void cfg_dominators_templatet<P, T, post_dom>::fixedpoint(P &program)
149149
bool changed=false;
150150
typename cfgt::nodet &node=cfg[cfg.entry_map[current]];
151151
if(node.dominators.empty())
152+
{
152153
for(const auto &edge : (post_dom ? node.out : node.in))
153154
if(!cfg[edge.first].dominators.empty())
154155
{
155156
node.dominators=cfg[edge.first].dominators;
156157
node.dominators.insert(current);
157158
changed=true;
158159
}
160+
}
159161

160162
// compute intersection of predecessors
161163
for(const auto &edge : (post_dom ? node.out : node.in))
@@ -200,7 +202,7 @@ void cfg_dominators_templatet<P, T, post_dom>::fixedpoint(P &program)
200202

201203
if(changed) // fixed point for node reached?
202204
{
203-
for(const auto & edge : (post_dom?node.in:node.out))
205+
for(const auto &edge : (post_dom ? node.in : node.out))
204206
{
205207
worklist.push_back(cfg[edge.first].PC);
206208
}
@@ -263,10 +265,12 @@ void cfg_dominators_templatet<P, T, post_dom>::output(std::ostream &out) const
263265
}
264266
}
265267

266-
typedef cfg_dominators_templatet<const goto_programt, goto_programt::const_targett, false>
268+
typedef cfg_dominators_templatet<
269+
const goto_programt, goto_programt::const_targett, false>
267270
cfg_dominatorst;
268271

269-
typedef cfg_dominators_templatet<const goto_programt, goto_programt::const_targett, true>
272+
typedef cfg_dominators_templatet<
273+
const goto_programt, goto_programt::const_targett, true>
270274
cfg_post_dominatorst;
271275

272276
template<>

src/analyses/constant_propagator.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Author: Peter Schrammel
66
77
\*******************************************************************/
88

9-
//#define DEBUG
9+
// #define DEBUG
1010

1111
#ifdef DEBUG
1212
#include <iostream>
@@ -52,7 +52,7 @@ void constant_propagator_domaint::assign_rec(
5252
values.set_to_top(to_symbol_expr(lhs));
5353
}
5454
#if 0
55-
else //TODO: could make field or array element-sensitive
55+
else // TODO: could make field or array element-sensitive
5656
{
5757
}
5858
#endif
@@ -273,7 +273,8 @@ Function: constant_propagator_domaint::valuest::is_constant_address_of
273273
274274
\*******************************************************************/
275275

276-
bool constant_propagator_domaint::valuest::is_constant_address_of(const exprt &expr) const
276+
bool constant_propagator_domaint::valuest::is_constant_address_of(
277+
const exprt &expr) const
277278
{
278279
if(expr.id()==ID_index)
279280
return is_constant_address_of(to_index_expr(expr).array()) &&
@@ -380,11 +381,11 @@ Function: constant_propagator_domaint::valuest::merge
380381

381382
bool constant_propagator_domaint::valuest::merge(const valuest &src)
382383
{
383-
//nothing to do
384+
// nothing to do
384385
if(src.is_bottom)
385386
return false;
386387

387-
//just copy
388+
// just copy
388389
if(is_bottom)
389390
{
390391
replace_const = src.replace_const;
@@ -394,7 +395,7 @@ bool constant_propagator_domaint::valuest::merge(const valuest &src)
394395

395396
bool changed = false;
396397

397-
//set everything to top that is not in src
398+
// set everything to top that is not in src
398399
for(replace_symbolt::expr_mapt::const_iterator
399400
it=replace_const.expr_map.begin();
400401
it!=replace_const.expr_map.end();
@@ -403,7 +404,7 @@ bool constant_propagator_domaint::valuest::merge(const valuest &src)
403404
if(src.replace_const.expr_map.find(it->first) ==
404405
src.replace_const.expr_map.end())
405406
{
406-
//cannot use set_to_top here
407+
// cannot use set_to_top here
407408
replace_const.expr_map.erase(it++);
408409
changed = true;
409410
}
@@ -557,7 +558,8 @@ void constant_propagator_ait::replace(
557558
}
558559
else if(it->is_function_call())
559560
{
560-
s_it->second.values.replace_const(to_code_function_call(it->code).function());
561+
s_it->second.values.replace_const(
562+
to_code_function_call(it->code).function());
561563
simplify_expr(to_code_function_call(it->code).function(), ns);
562564

563565
exprt::operandst &args =

src/analyses/custom_bitvector_analysis.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@ void custom_bitvector_domaint::transform(
387387

388388
case FUNCTION_CALL:
389389
{
390-
const code_function_callt &code_function_call=to_code_function_call(instruction.code);
390+
const code_function_callt &code_function_call=
391+
to_code_function_call(instruction.code);
391392
const exprt &function=code_function_call.function();
392393

393394
if(function.id()==ID_symbol)

src/analyses/custom_bitvector_analysis.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ class custom_bitvector_analysist:public ait<custom_bitvector_domaint>
132132
{
133133
public:
134134
void instrument(goto_functionst &);
135-
void check(const namespacet &, const goto_functionst &, bool xml, std::ostream &);
135+
void check(
136+
const namespacet &,
137+
const goto_functionst &,
138+
bool xml, std::ostream &);
136139

137140
exprt eval(const exprt &src, locationt loc)
138141
{

src/analyses/dependence_graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ void dependence_grapht::add_dep(
355355

356356
// add_edge is redundant as the subsequent operations also insert
357357
// entries into the edge maps (implicitly)
358-
//add_edge(n_from, n_to);
358+
// add_edge(n_from, n_to);
359359
nodes[n_from].out[n_to].add(kind);
360360
nodes[n_to].in[n_from].add(kind);
361361
}

0 commit comments

Comments
 (0)