Skip to content

Commit 0205d09

Browse files
Clang-format
1 parent 59cd7a2 commit 0205d09

File tree

4 files changed

+148
-173
lines changed

4 files changed

+148
-173
lines changed

src/goto-checker/symex_bmc.cpp

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Author: Daniel Kroening, [email protected]
1515

1616
#include <limits>
1717

18-
#include <util/source_location.h>
1918
#include <util/simplify_expr.h>
19+
#include <util/source_location.h>
2020

2121
symex_bmct::symex_bmct(
2222
message_handlert &mh,
@@ -35,28 +35,28 @@ void symex_bmct::symex_step(
3535
const get_goto_functiont &get_goto_function,
3636
statet &state)
3737
{
38-
const source_locationt &source_location=state.source.pc->source_location;
38+
const source_locationt &source_location = state.source.pc->source_location;
3939

40-
if(!source_location.is_nil() && last_source_location!=source_location)
40+
if(!source_location.is_nil() && last_source_location != source_location)
4141
{
42-
log.debug() << "BMC at " << source_location.as_string()
43-
<< " (depth " << state.depth << ')' << log.eom;
42+
log.debug() << "BMC at " << source_location.as_string() << " (depth "
43+
<< state.depth << ')' << log.eom;
4444

45-
last_source_location=source_location;
45+
last_source_location = source_location;
4646
}
4747

48-
const goto_programt::const_targett cur_pc=state.source.pc;
49-
const guardt cur_guard=state.guard;
48+
const goto_programt::const_targett cur_pc = state.source.pc;
49+
const guardt cur_guard = state.guard;
5050

51-
if(!state.guard.is_false() &&
52-
state.source.pc->is_assume() &&
53-
simplify_expr(state.source.pc->guard, ns).is_false())
51+
if(
52+
!state.guard.is_false() && state.source.pc->is_assume() &&
53+
simplify_expr(state.source.pc->guard, ns).is_false())
5454
{
5555
log.statistics() << "aborting path on assume(false) at "
5656
<< state.source.pc->source_location << " thread "
5757
<< state.source.thread_nr;
5858

59-
const irep_idt &c=state.source.pc->source_location.get_comment();
59+
const irep_idt &c = state.source.pc->source_location.get_comment();
6060
if(!c.empty())
6161
log.statistics() << ": " << c;
6262

@@ -77,9 +77,9 @@ void symex_bmct::symex_step(
7777
// taken an impossible transition); thus we synthesize a
7878
// transition from the goto instruction to its target to make
7979
// sure the goto is considered covered
80-
if(cur_pc->is_goto() &&
81-
cur_pc->get_target()!=state.source.pc &&
82-
cur_pc->guard.is_true())
80+
if(
81+
cur_pc->is_goto() && cur_pc->get_target() != state.source.pc &&
82+
cur_pc->guard.is_true())
8383
symex_coverage.covered(cur_pc, cur_pc->get_target());
8484
else if(!state.guard.is_false())
8585
symex_coverage.covered(cur_pc, state.source.pc);
@@ -90,18 +90,18 @@ void symex_bmct::merge_goto(
9090
const statet::goto_statet &goto_state,
9191
statet &state)
9292
{
93-
const goto_programt::const_targett prev_pc=goto_state.source.pc;
94-
const guardt prev_guard=goto_state.guard;
93+
const goto_programt::const_targett prev_pc = goto_state.source.pc;
94+
const guardt prev_guard = goto_state.guard;
9595

9696
goto_symext::merge_goto(goto_state, state);
9797

9898
PRECONDITION(prev_pc->is_goto());
99-
if(record_coverage &&
100-
// could the branch possibly be taken?
101-
!prev_guard.is_false() &&
102-
!state.guard.is_false() &&
103-
// branches only, no single-successor goto
104-
!prev_pc->guard.is_true())
99+
if(
100+
record_coverage &&
101+
// could the branch possibly be taken?
102+
!prev_guard.is_false() && !state.guard.is_false() &&
103+
// branches only, no single-successor goto
104+
!prev_pc->guard.is_true())
105105
symex_coverage.covered(prev_pc, state.source.pc);
106106
}
107107

@@ -110,10 +110,10 @@ bool symex_bmct::should_stop_unwind(
110110
const goto_symex_statet::call_stackt &context,
111111
unsigned unwind)
112112
{
113-
const irep_idt id=goto_programt::loop_id(*source.pc);
113+
const irep_idt id = goto_programt::loop_id(*source.pc);
114114

115115
tvt abort_unwind_decision;
116-
unsigned this_loop_limit=std::numeric_limits<unsigned>::max();
116+
unsigned this_loop_limit = std::numeric_limits<unsigned>::max();
117117

118118
for(auto handler : loop_unwind_handlers)
119119
{
@@ -127,7 +127,7 @@ bool symex_bmct::should_stop_unwind(
127127
// / --unwind options to decide:
128128
if(abort_unwind_decision.is_unknown())
129129
{
130-
auto limit=unwindset.get_limit(id, source.thread_nr);
130+
auto limit = unwindset.get_limit(id, source.thread_nr);
131131

132132
if(!limit.has_value())
133133
abort_unwind_decision = tvt(false);
@@ -142,7 +142,7 @@ bool symex_bmct::should_stop_unwind(
142142
log.statistics() << (abort ? "Not unwinding" : "Unwinding") << " loop " << id
143143
<< " iteration " << unwind;
144144

145-
if(this_loop_limit!=std::numeric_limits<unsigned>::max())
145+
if(this_loop_limit != std::numeric_limits<unsigned>::max())
146146
log.statistics() << " (" << this_loop_limit << " max)";
147147

148148
log.statistics() << " " << source.pc->source_location << " thread "
@@ -157,7 +157,7 @@ bool symex_bmct::get_unwind_recursion(
157157
unsigned unwind)
158158
{
159159
tvt abort_unwind_decision;
160-
unsigned this_loop_limit=std::numeric_limits<unsigned>::max();
160+
unsigned this_loop_limit = std::numeric_limits<unsigned>::max();
161161

162162
for(auto handler : recursion_unwind_handlers)
163163
{
@@ -170,7 +170,7 @@ bool symex_bmct::get_unwind_recursion(
170170
// / --unwind options to decide:
171171
if(abort_unwind_decision.is_unknown())
172172
{
173-
auto limit=unwindset.get_limit(id, thread_nr);
173+
auto limit = unwindset.get_limit(id, thread_nr);
174174

175175
if(!limit.has_value())
176176
abort_unwind_decision = tvt(false);
@@ -182,14 +182,14 @@ bool symex_bmct::get_unwind_recursion(
182182
abort_unwind_decision.is_known(), "unwind decision should be taken by now");
183183
bool abort = abort_unwind_decision.is_true();
184184

185-
if(unwind>0 || abort)
185+
if(unwind > 0 || abort)
186186
{
187-
const symbolt &symbol=ns.lookup(id);
187+
const symbolt &symbol = ns.lookup(id);
188188

189189
log.statistics() << (abort ? "Not unwinding" : "Unwinding") << " recursion "
190190
<< symbol.display_name() << " iteration " << unwind;
191191

192-
if(this_loop_limit!=std::numeric_limits<unsigned>::max())
192+
if(this_loop_limit != std::numeric_limits<unsigned>::max())
193193
log.statistics() << " (" << this_loop_limit << " max)";
194194

195195
log.statistics() << log.eom;

src/goto-checker/symex_bmc.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ Author: Daniel Kroening, [email protected]
1515
#include <util/message.h>
1616
#include <util/threeval.h>
1717

18-
#include <goto-symex/path_storage.h>
1918
#include <goto-symex/goto_symex.h>
19+
#include <goto-symex/path_storage.h>
2020

2121
#include <goto-instrument/unwindset.h>
2222

2323
#include "symex_coverage.h"
2424

25-
class symex_bmct: public goto_symext
25+
class symex_bmct : public goto_symext
2626
{
2727
public:
2828
symex_bmct(
@@ -41,9 +41,8 @@ class symex_bmct: public goto_symext
4141
/// information for the user (e.g. "unwinding iteration N, max M"), and is not
4242
/// enforced. They return true to halt unwinding, false to authorise
4343
/// unwinding, or Unknown to indicate they have no opinion.
44-
typedef
45-
std::function<tvt(
46-
const goto_symex_statet::call_stackt &, unsigned, unsigned, unsigned &)>
44+
typedef std::function<
45+
tvt(const goto_symex_statet::call_stackt &, unsigned, unsigned, unsigned &)>
4746
loop_unwind_handlert;
4847

4948
/// Recursion unwind handlers take the function ID, the unwind count so far,

0 commit comments

Comments
 (0)