Skip to content

Commit 7fd404d

Browse files
committed
Disable clang-format for recently touched switch statements
We should not re-indent a large number of lines of code just because some case statements were added. Silence clang-format for these instead.
1 parent 3ce78b4 commit 7fd404d

21 files changed

+44
-0
lines changed

jbmc/src/java_bytecode/java_bytecode_language.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ bool java_bytecode_languaget::typecheck(
777777

778778
// Now incrementally elaborate methods
779779
// that are reachable from this entry point.
780+
// clang-format off
780781
switch(lazy_methods_mode)
781782
{
782783
case LAZY_METHODS_MODE_CONTEXT_INSENSITIVE:
@@ -815,6 +816,7 @@ bool java_bytecode_languaget::typecheck(
815816
// Our caller is in charge of elaborating methods on demand.
816817
break;
817818
}
819+
// clang-format on
818820

819821
// now instrument runtime exceptions
820822
java_bytecode_instrument(

src/analyses/escape_analysis.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ void escape_analysist::instrument(
457457

458458
const goto_programt::instructiont &instruction=*i_it;
459459

460+
// clang-format off
460461
if(instruction.type == ASSIGN)
461462
{
462463
const code_assignt &code_assign=to_code_assign(instruction.code);
@@ -521,6 +522,7 @@ void escape_analysist::instrument(
521522
i_it++;
522523
}
523524
}
525+
// clang-format on
524526
}
525527

526528
Forall_goto_program_instructions(i_it, f_it->second.body)

src/analyses/global_may_alias.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ void global_may_alias_domaint::transform(
103103

104104
const goto_programt::instructiont &instruction=*from;
105105

106+
// clang-format off
106107
switch(instruction.type)
107108
{
108109
case ASSIGN:
@@ -148,6 +149,7 @@ void global_may_alias_domaint::transform(
148149
case NO_INSTRUCTION_TYPE:
149150
break;
150151
}
152+
// clang-format on
151153
}
152154

153155
void global_may_alias_domaint::output(

src/analyses/interval_domain.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ void interval_domaint::transform(
6464
ai_baset &,
6565
const namespacet &ns)
6666
{
67+
// clang-format off
6768
const goto_programt::instructiont &instruction=*from;
6869
switch(instruction.type)
6970
{
@@ -124,6 +125,7 @@ void interval_domaint::transform(
124125
case NO_INSTRUCTION_TYPE:
125126
break;
126127
}
128+
// clang-format on
127129
}
128130

129131
/// Sets *this to the mathematical join between the two domains. This can be

src/analyses/local_bitvector_analysis.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ void local_bitvector_analysist::build()
266266
auto &loc_info_src=loc_infos[loc_nr];
267267
auto loc_info_dest=loc_infos[loc_nr];
268268

269+
// clang-format off
269270
switch(instruction.type)
270271
{
271272
case ASSIGN:
@@ -326,6 +327,7 @@ void local_bitvector_analysist::build()
326327
case NO_INSTRUCTION_TYPE:
327328
break;
328329
}
330+
// clang-format on
329331

330332
for(const auto &succ : node.successors)
331333
{

src/analyses/local_may_alias.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ void local_may_aliast::build(const goto_functiont &goto_function)
365365
const loc_infot &loc_info_src=loc_infos[loc_nr];
366366
loc_infot loc_info_dest=loc_infos[loc_nr];
367367

368+
// clang-format off
368369
switch(instruction.type)
369370
{
370371
case ASSIGN:
@@ -437,6 +438,7 @@ void local_may_aliast::build(const goto_functiont &goto_function)
437438
case NO_INSTRUCTION_TYPE:
438439
break;
439440
}
441+
// clang-format on
440442

441443
for(local_cfgt::successorst::const_iterator
442444
it=node.successors.begin();

src/analyses/uninitialized_domain.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ void uninitialized_domaint::transform(
2929
if(has_values.is_false())
3030
return;
3131

32+
// clang-format off
3233
if(from->is_decl())
3334
{
3435
const irep_idt &identifier=
@@ -50,6 +51,7 @@ void uninitialized_domaint::transform(
5051
for(const auto &expr : read)
5152
assign(expr);
5253
}
54+
// clang-format on
5355
}
5456

5557
void uninitialized_domaint::assign(const exprt &lhs)

src/cpp/cpp_id.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ std::ostream &operator<<(std::ostream &out, const cpp_idt &cpp_id)
9999

100100
std::ostream &operator<<(std::ostream &out, const cpp_idt::id_classt &id_class)
101101
{
102+
// clang-format off
102103
switch(id_class)
103104
{
104105
case cpp_idt::id_classt::UNKNOWN: return out<<"UNKNOWN";
@@ -113,6 +114,7 @@ std::ostream &operator<<(std::ostream &out, const cpp_idt::id_classt &id_class)
113114
case cpp_idt::id_classt::NAMESPACE: return out<<"NAMESPACE";
114115
case cpp_idt::id_classt::ENUM: return out<<"ENUM";
115116
}
117+
// clang-format on
116118

117119
UNREACHABLE;
118120
}

src/goto-analyzer/taint_analysis.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ void taint_analysist::instrument(
7171

7272
goto_programt insert_before, insert_after;
7373

74+
// clang-format off
7475
if(instruction.is_function_call())
7576
{
7677
const code_function_callt &function_call =
@@ -203,6 +204,7 @@ void taint_analysist::instrument(
203204
}
204205
}
205206
}
207+
// clang-format off
206208

207209
if(!insert_before.empty())
208210
{

src/goto-programs/goto_program.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ std::list<exprt> expressions_read(
271271
{
272272
std::list<exprt> dest;
273273

274+
// clang-format off
274275
switch(instruction.type)
275276
{
276277
case ASSUME:
@@ -319,6 +320,7 @@ std::list<exprt> expressions_read(
319320
case NO_INSTRUCTION_TYPE:
320321
break;
321322
}
323+
// clang-format on
322324

323325
return dest;
324326
}

src/goto-programs/goto_trace.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ void goto_trace_stept::output(
5858
{
5959
out << "*** ";
6060

61+
// clang-format off
6162
switch(type)
6263
{
6364
case goto_trace_stept::typet::ASSERT: out << "ASSERT"; break;
@@ -83,6 +84,7 @@ void goto_trace_stept::output(
8384
case goto_trace_stept::typet::CONSTRAINT: out << "CONSTRAINT"; break;
8485
case goto_trace_stept::typet::NONE: out << "NONE"; break;
8586
}
87+
// clang-format on
8688

8789
if(is_assert() || is_assume() || is_goto())
8890
out << " (" << cond_value << ')';

src/goto-programs/vcd_goto_trace.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ void output_vcd(
113113

114114
for(const auto &step : goto_trace.steps)
115115
{
116+
// clang-format off
116117
if(step.is_assignment())
117118
{
118119
auto lhs_object=step.get_lhs_object();
@@ -145,5 +146,6 @@ void output_vcd(
145146
}
146147
}
147148
}
149+
// clang-format on
148150
}
149151
}

src/goto-programs/xml_goto_trace.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ void convert(
4040
if(source_location.is_not_nil() && source_location.get_file()!="")
4141
xml_location=xml(source_location);
4242

43+
// clang-format off
4344
switch(step.type)
4445
{
4546
case goto_trace_stept::typet::ASSERT:
@@ -227,6 +228,7 @@ void convert(
227228
}
228229
}
229230
}
231+
// clang-format on
230232

231233
if(source_location.is_not_nil() && source_location.get_file()!="")
232234
previous_source_location=source_location;

src/pointer-analysis/value_set_domain_fi.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ bool value_set_domain_fit::transform(
3030
// from_l->function << " " << from_l->location_number << " to " <<
3131
// to_l->function << " " << to_l->location_number << '\n';
3232

33+
// clang-format off
3334
switch(from_l->type)
3435
{
3536
case GOTO:
@@ -71,6 +72,7 @@ bool value_set_domain_fit::transform(
7172
// do nothing
7273
break;
7374
}
75+
// clang-format on
7476

7577
return (value_set.changed);
7678
}

src/pointer-analysis/value_set_domain_fivr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ bool value_set_domain_fivrt::transform(
3030
to_l->function << " " << to_l->location_number << '\n';
3131
#endif
3232

33+
// clang-format off
3334
switch(from_l->type)
3435
{
3536
case END_FUNCTION:
@@ -68,6 +69,7 @@ bool value_set_domain_fivrt::transform(
6869
case NO_INSTRUCTION_TYPE:
6970
break;
7071
}
72+
// clang-format on
7173

7274
return value_set.handover();
7375
}

src/pointer-analysis/value_set_domain_fivrns.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ bool value_set_domain_fivrnst::transform(
3030
to_l->function << " " << to_l->location_number << '\n';
3131
#endif
3232

33+
// clang-format off
3334
switch(from_l->type)
3435
{
3536
case END_FUNCTION:
@@ -68,6 +69,7 @@ bool value_set_domain_fivrnst::transform(
6869
case NO_INSTRUCTION_TYPE:
6970
break;
7071
}
72+
// clang-format on
7173

7274
return value_set.handover();
7375
}

src/solvers/flattening/boolbv_get.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,14 @@ exprt boolbvt::bv_get_rec(
8585
{
8686
if(!unknown[offset])
8787
{
88+
// clang-format off
8889
switch(prop.l_get(bv[offset]).get_value())
8990
{
9091
case tvt::tv_enumt::TV_FALSE: return false_exprt();
9192
case tvt::tv_enumt::TV_TRUE: return true_exprt();
9293
case tvt::tv_enumt::TV_UNKNOWN: return false_exprt(); // default
9394
}
95+
// clang-format on
9496
}
9597

9698
return nil_exprt();
@@ -233,6 +235,7 @@ exprt boolbvt::bv_get_rec(
233235
value=ch+value;
234236
}
235237

238+
// clang-format off
236239
switch(bvtype)
237240
{
238241
case bvtypet::IS_UNKNOWN:
@@ -274,6 +277,7 @@ exprt boolbvt::bv_get_rec(
274277
return constant_exprt(bvrep, type);
275278
}
276279
}
280+
// clang-format on
277281

278282
return nil_exprt();
279283
}

src/solvers/flattening/boolbv_typecast.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ bool boolbvt::type_conversion(
325325
case bvtypet::IS_UNSIGNED:
326326
case bvtypet::IS_SIGNED:
327327
case bvtypet::IS_C_ENUM:
328+
// clang-format off
328329
switch(src_bvtype)
329330
{
330331
case bvtypet::IS_FLOAT: // float to integer
@@ -442,6 +443,7 @@ bool boolbvt::type_conversion(
442443
return false;
443444
}
444445
}
446+
// clang-format on
445447
break;
446448

447449
case bvtypet::IS_VERILOG_UNSIGNED:

src/solvers/prop/prop_conv.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,14 @@ decision_proceduret::resultt prop_conv_solvert::dec_solve()
473473

474474
statistics() << "Solving with " << prop.solver_text() << eom;
475475

476+
// clang-format off
476477
switch(prop.prop_solve())
477478
{
478479
case propt::resultt::P_SATISFIABLE: return resultt::D_SATISFIABLE;
479480
case propt::resultt::P_UNSATISFIABLE: return resultt::D_UNSATISFIABLE;
480481
case propt::resultt::P_ERROR: return resultt::D_ERROR;
481482
}
483+
// clang-format on
482484

483485
UNREACHABLE;
484486
}

src/solvers/refinement/bv_refinement_loop.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,14 @@ decision_proceduret::resultt bv_refinementt::prop_solve()
102102
propt::resultt result=prop.prop_solve();
103103
prop.set_assumptions(parent_assumptions);
104104

105+
// clang-format off
105106
switch(result)
106107
{
107108
case propt::resultt::P_SATISFIABLE: return resultt::D_SATISFIABLE;
108109
case propt::resultt::P_UNSATISFIABLE: return resultt::D_UNSATISFIABLE;
109110
case propt::resultt::P_ERROR: return resultt::D_ERROR;
110111
}
112+
// clang-format on
111113

112114
UNREACHABLE;
113115
}

src/util/config.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,13 +1096,15 @@ bool configt::set(const cmdlinet &cmdline)
10961096

10971097
std::string configt::ansi_ct::os_to_string(ost os)
10981098
{
1099+
// clang-format off
10991100
switch(os)
11001101
{
11011102
case ost::OS_LINUX: return "linux";
11021103
case ost::OS_MACOS: return "macos";
11031104
case ost::OS_WIN: return "win";
11041105
case ost::NO_OS: return "none";
11051106
}
1107+
// clang-format on
11061108

11071109
UNREACHABLE;
11081110
}

0 commit comments

Comments
 (0)