Skip to content

Commit d733fe3

Browse files
authored
Merge pull request #2838 from diffblue/remove-init-statement
remove unused 'init' statement
2 parents 2b5e925 + 5cbfd8d commit d733fe3

File tree

9 files changed

+5
-26
lines changed

9 files changed

+5
-26
lines changed

src/analyses/invariant_set.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,8 +1076,7 @@ void invariant_sett::apply_code(const codet &code)
10761076
forall_operands(it, code)
10771077
apply_code(to_code(*it));
10781078
}
1079-
else if(statement==ID_assign ||
1080-
statement==ID_init)
1079+
else if(statement==ID_assign)
10811080
{
10821081
if(code.operands().size()!=2)
10831082
throw "assignment expected to have two operands";

src/ansi-c/expr2c.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,9 +2980,6 @@ std::string expr2ct::convert_code(
29802980
if(statement==ID_assign)
29812981
return convert_code_assign(to_code_assign(src), indent);
29822982

2983-
if(statement==ID_init)
2984-
return convert_code_init(src, indent);
2985-
29862983
if(statement=="lock")
29872984
return convert_code_lock(src, indent);
29882985

@@ -3049,15 +3046,6 @@ std::string expr2ct::convert_code_free(
30493046
return indent_str(indent)+"FREE("+convert(src.op0())+");";
30503047
}
30513048

3052-
std::string expr2ct::convert_code_init(
3053-
const codet &src,
3054-
unsigned indent)
3055-
{
3056-
std::string tmp=convert_binary(src, "=", 2, true);
3057-
3058-
return indent_str(indent)+"INIT "+tmp+";";
3059-
}
3060-
30613049
std::string expr2ct::convert_code_lock(
30623050
const codet &src,
30633051
unsigned indent)

src/ansi-c/expr2c_class.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ class expr2ct
188188
std::string convert_code_asm(const code_asmt &src, unsigned indent);
189189
std::string convert_code_assign(const code_assignt &src, unsigned indent);
190190
std::string convert_code_free(const codet &src, unsigned indent);
191-
std::string convert_code_init(const codet &src, unsigned indent);
192191
// NOLINTNEXTLINE(whitespace/line_length)
193192
std::string convert_code_ifthenelse(const code_ifthenelset &src, unsigned indent);
194193
std::string convert_code_for(const code_fort &src, unsigned indent);

src/goto-programs/goto_convert.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,6 @@ void goto_convertt::convert(
458458
convert_expression(to_code_expression(code), dest, mode);
459459
else if(statement==ID_assign)
460460
convert_assign(to_code_assign(code), dest, mode);
461-
else if(statement==ID_init)
462-
convert_init(code, dest, mode);
463461
else if(statement==ID_assert)
464462
convert_assert(to_code_assert(code), dest, mode);
465463
else if(statement==ID_assume)

src/pointer-analysis/value_set.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,8 +1569,7 @@ void value_sett::apply_code_rec(
15691569
// shouldn't be here
15701570
UNREACHABLE;
15711571
}
1572-
else if(statement==ID_assign ||
1573-
statement==ID_init)
1572+
else if(statement==ID_assign)
15741573
{
15751574
if(code.operands().size()!=2)
15761575
throw "assignment expected to have two operands";

src/pointer-analysis/value_set_fi.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,8 +1422,7 @@ void value_set_fit::apply_code(
14221422
// shouldn't be here
14231423
UNREACHABLE;
14241424
}
1425-
else if(statement==ID_assign ||
1426-
statement==ID_init)
1425+
else if(statement==ID_assign)
14271426
{
14281427
if(code.operands().size()!=2)
14291428
throw "assignment expected to have two operands";

src/pointer-analysis/value_set_fivr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,8 +1576,7 @@ void value_set_fivrt::apply_code(
15761576
// shouldn't be here
15771577
UNREACHABLE;
15781578
}
1579-
else if(statement==ID_assign ||
1580-
statement==ID_init)
1579+
else if(statement==ID_assign)
15811580
{
15821581
if(code.operands().size()!=2)
15831582
throw "assignment expected to have two operands";

src/pointer-analysis/value_set_fivrns.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,8 +1235,7 @@ void value_set_fivrnst::apply_code(
12351235
// shouldn't be here
12361236
UNREACHABLE;
12371237
}
1238-
else if(statement==ID_assign ||
1239-
statement==ID_init)
1238+
else if(statement==ID_assign)
12401239
{
12411240
if(code.operands().size()!=2)
12421241
throw "assignment expected to have two operands";

src/util/irep_ids.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ IREP_ID_ONE(byte_extract_little_endian)
372372
IREP_ID_ONE(byte_update_big_endian)
373373
IREP_ID_ONE(byte_update_little_endian)
374374
IREP_ID_ONE(replication)
375-
IREP_ID_ONE(init)
376375
IREP_ID_ONE(cprover_atomic)
377376
IREP_ID_ONE(atomic)
378377
IREP_ID_ONE(atomic_type_specifier)

0 commit comments

Comments
 (0)