Skip to content

Commit c796942

Browse files
Apply clang-format suggestions
This commit only contains formatting changes.
1 parent ac86e55 commit c796942

File tree

1 file changed

+32
-28
lines changed

1 file changed

+32
-28
lines changed

src/goto-symex/symex_goto.cpp

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ void goto_symext::merge_value_sets(
359359
static void for_each2(
360360
const std::map<irep_idt, std::pair<ssa_exprt, unsigned>> &first_map,
361361
const std::map<irep_idt, std::pair<ssa_exprt, unsigned>> &second_map,
362-
std::function<void(const irep_idt &, const ssa_exprt &, unsigned, unsigned)> f)
362+
std::function<void(const irep_idt &, const ssa_exprt &, unsigned, unsigned)>
363+
f)
363364
{
364365
auto second_it = second_map.begin();
365366
for(const auto &first_pair : first_map)
@@ -399,7 +400,8 @@ static void for_each2(
399400
/// \param[out] target: equation that will receive the resulting assignment
400401
/// \param l1_identifier: name of the variable to merge
401402
/// \param ssa: SSA expression corresponding to \p l1_identifier
402-
/// \param goto_count: current level 2 count in \p goto_state of \p l1_identifier
403+
/// \param goto_count: current level 2 count in \p goto_state of
404+
/// \p l1_identifier
403405
/// \param dest_count: level 2 count in \p dest_state of \p l1_identifier
404406
static void merge_names(
405407
const goto_symext::statet::goto_statet &goto_state,
@@ -417,7 +419,7 @@ static void merge_names(
417419
{
418420
const irep_idt &obj_identifier = ssa.get_object_name();
419421

420-
if(obj_identifier==guard_identifier)
422+
if(obj_identifier == guard_identifier)
421423
return; // just a guard, don't bother
422424

423425
if(goto_count == dest_count)
@@ -427,12 +429,12 @@ static void merge_names(
427429

428430
// shared variables are renamed on every access anyway, we don't need to
429431
// merge anything
430-
const symbolt &symbol=ns.lookup(obj_identifier);
432+
const symbolt &symbol = ns.lookup(obj_identifier);
431433

432434
// shared?
433435
if(
434436
dest_state.atomic_section_id == 0 && dest_state.threads.size() >= 2 &&
435-
(symbol.is_shared() || (dest_state.dirty)(symbol.name)))
437+
(symbol.is_shared() || (dest_state.dirty)(symbol.name)))
436438
return; // no phi nodes for shared stuff
437439

438440
// don't merge (thread-)locals across different threads, which
@@ -441,7 +443,7 @@ static void merge_names(
441443
// once the thread is executed)
442444
if(
443445
!ssa.get_level_0().empty() &&
444-
ssa.get_level_0() != std::to_string(dest_state.source.thread_nr))
446+
ssa.get_level_0() != std::to_string(dest_state.source.thread_nr))
445447
return;
446448

447449
exprt goto_state_rhs = ssa, dest_state_rhs = ssa;
@@ -450,7 +452,7 @@ static void merge_names(
450452
const auto p_it = goto_state.propagation.find(l1_identifier);
451453

452454
if(p_it != goto_state.propagation.end())
453-
goto_state_rhs=p_it->second;
455+
goto_state_rhs = p_it->second;
454456
else
455457
to_ssa_expr(goto_state_rhs).set_level_2(goto_count);
456458
}
@@ -459,7 +461,7 @@ static void merge_names(
459461
const auto p_it = dest_state.propagation.find(l1_identifier);
460462

461463
if(p_it != dest_state.propagation.end())
462-
dest_state_rhs=p_it->second;
464+
dest_state_rhs = p_it->second;
463465
else
464466
to_ssa_expr(dest_state_rhs).set_level_2(dest_count);
465467
}
@@ -471,9 +473,9 @@ static void merge_names(
471473
// 2. Either identifier is of generation zero, and so hasn't been
472474
// initialized and therefor an invalid target.
473475
if(dest_state.guard.is_false())
474-
rhs=goto_state_rhs;
476+
rhs = goto_state_rhs;
475477
else if(goto_state.guard.is_false())
476-
rhs=dest_state_rhs;
478+
rhs = dest_state_rhs;
477479
else if(goto_count == 0)
478480
{
479481
rhs = dest_state_rhs;
@@ -484,28 +486,29 @@ static void merge_names(
484486
}
485487
else
486488
{
487-
rhs=if_exprt(diff_guard.as_expr(), goto_state_rhs, dest_state_rhs);
489+
rhs = if_exprt(diff_guard.as_expr(), goto_state_rhs, dest_state_rhs);
488490
if(do_simplify)
489491
simplify(rhs, ns);
490492
}
491493

492494
ssa_exprt new_lhs = ssa;
493-
const bool record_events=dest_state.record_events;
494-
dest_state.record_events=false;
495+
const bool record_events = dest_state.record_events;
496+
dest_state.record_events = false;
495497
dest_state.assignment(new_lhs, rhs, ns, true, true);
496-
dest_state.record_events=record_events;
498+
dest_state.record_events = record_events;
497499

498500
log.conditional_output(
499-
log.debug(),
500-
[ns, &new_lhs](messaget::mstreamt &mstream) {
501-
mstream << "Assignment to " << new_lhs.get_identifier()
502-
<< " [" << pointer_offset_bits(new_lhs.type(), ns).value_or(0) << " bits]"
501+
log.debug(), [ns, &new_lhs](messaget::mstreamt &mstream) {
502+
mstream << "Assignment to " << new_lhs.get_identifier() << " ["
503+
<< pointer_offset_bits(new_lhs.type(), ns).value_or(0) << " bits]"
503504
<< messaget::eom;
504505
});
505506

506507
target.assignment(
507508
true_exprt(),
508-
new_lhs, new_lhs, new_lhs.get_original_expr(),
509+
new_lhs,
510+
new_lhs,
511+
new_lhs.get_original_expr(),
509512
rhs,
510513
dest_state.source,
511514
symex_targett::assignment_typet::PHI);
@@ -516,22 +519,23 @@ void goto_symext::phi_function(
516519
statet &dest_state)
517520
{
518521
guardt diff_guard;
519-
if(goto_state.level2_current_names.empty() &&
520-
dest_state.level2.current_names.empty())
522+
if(
523+
goto_state.level2_current_names.empty() &&
524+
dest_state.level2.current_names.empty())
521525
return;
522526

523-
diff_guard=goto_state.guard;
527+
diff_guard = goto_state.guard;
524528
// this gets the diff between the guards
525-
diff_guard-=dest_state.guard;
529+
diff_guard -= dest_state.guard;
526530

527531
for_each2(
528532
goto_state.level2_current_names,
529533
dest_state.level2.current_names,
530-
[&](const irep_idt &l1_identifier,
531-
const ssa_exprt &ssa,
532-
unsigned goto_count,
533-
unsigned dest_count)
534-
{
534+
[&](
535+
const irep_idt &l1_identifier,
536+
const ssa_exprt &ssa,
537+
unsigned goto_count,
538+
unsigned dest_count) {
535539
merge_names(
536540
goto_state,
537541
dest_state,

0 commit comments

Comments
 (0)