Skip to content

Commit 87e86bb

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 5e1c7bf commit 87e86bb

20 files changed

+42
-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
@@ -791,6 +791,7 @@ bool java_bytecode_languaget::typecheck(
791791

792792
// Now incrementally elaborate methods
793793
// that are reachable from this entry point.
794+
// clang-format off
794795
switch(lazy_methods_mode)
795796
{
796797
case LAZY_METHODS_MODE_CONTEXT_INSENSITIVE:
@@ -829,6 +830,7 @@ bool java_bytecode_languaget::typecheck(
829830
// Our caller is in charge of elaborating methods on demand.
830831
break;
831832
}
833+
// clang-format on
832834

833835
// now instrument runtime exceptions
834836
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
@@ -65,6 +65,7 @@ void goto_trace_stept::output(
6565
{
6666
out << "*** ";
6767

68+
// clang-format off
6869
switch(type)
6970
{
7071
case goto_trace_stept::typet::ASSERT: out << "ASSERT"; break;
@@ -90,6 +91,7 @@ void goto_trace_stept::output(
9091
case goto_trace_stept::typet::CONSTRAINT: out << "CONSTRAINT"; break;
9192
case goto_trace_stept::typet::NONE: out << "NONE"; break;
9293
}
94+
// clang-format on
9395

9496
if(is_assert() || is_assume() || is_goto())
9597
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().empty())
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().empty())
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
@@ -84,12 +84,14 @@ exprt boolbvt::bv_get_rec(
8484
{
8585
if(!unknown[offset])
8686
{
87+
// clang-format off
8788
switch(prop.l_get(bv[offset]).get_value())
8889
{
8990
case tvt::tv_enumt::TV_FALSE: return false_exprt();
9091
case tvt::tv_enumt::TV_TRUE: return true_exprt();
9192
case tvt::tv_enumt::TV_UNKNOWN: return false_exprt(); // default
9293
}
94+
// clang-format on
9395
}
9496

9597
return false_exprt{}; // default
@@ -243,6 +245,7 @@ exprt boolbvt::bv_get_rec(
243245
value=ch+value;
244246
}
245247

248+
// clang-format off
246249
switch(bvtype)
247250
{
248251
case bvtypet::IS_UNKNOWN:
@@ -289,6 +292,7 @@ exprt boolbvt::bv_get_rec(
289292
return constant_exprt(bvrep, type);
290293
}
291294
}
295+
// clang-format on
292296

293297
UNREACHABLE;
294298
}

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
@@ -448,6 +449,7 @@ bool boolbvt::type_conversion(
448449
return false;
449450
}
450451
}
452+
// clang-format on
451453
break;
452454

453455
case bvtypet::IS_VERILOG_UNSIGNED:

src/solvers/refinement/bv_refinement_loop.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,14 @@ decision_proceduret::resultt bv_refinementt::prop_solve()
105105
propt::resultt result=prop.prop_solve();
106106
pop();
107107

108+
// clang-format off
108109
switch(result)
109110
{
110111
case propt::resultt::P_SATISFIABLE: return resultt::D_SATISFIABLE;
111112
case propt::resultt::P_UNSATISFIABLE: return resultt::D_UNSATISFIABLE;
112113
case propt::resultt::P_ERROR: return resultt::D_ERROR;
113114
}
115+
// clang-format on
114116

115117
UNREACHABLE;
116118
}

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)