Skip to content

Commit

Permalink
Remove deprecated code_*t and side_effect_expr*t constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig committed Jan 21, 2019
1 parent 2e9cd84 commit 9022d37
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 158 deletions.
3 changes: 1 addition & 2 deletions src/jsil/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ instruction: TOK_LABEL TOK_IDENTIFIER
rhs: expression
| proc_ident_expr '(' expressions_opt ')' with_opt
{
side_effect_expr_function_callt f;
f.function().swap(stack($1));
side_effect_expr_function_callt f(stack($1), {}, typet{}, {});
if(stack($3).is_not_nil())
f.arguments().swap(stack($3).operands());

Expand Down
156 changes: 0 additions & 156 deletions src/util/std_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ Author: Daniel Kroening, [email protected]
class codet:public exprt
{
public:
DEPRECATED("use codet(statement) instead")
codet():exprt(ID_code, typet(ID_code))
{
}

/// \param statement: Specifies the type of the `codet` to be constructed,
/// e.g. `ID_block` for a \ref code_blockt or `ID_assign` for a
/// \ref code_assignt.
Expand Down Expand Up @@ -496,12 +491,6 @@ inline code_deadt &to_code_dead(codet &code)
class code_assumet:public codet
{
public:
DEPRECATED("use code_assumet(expr) instead")
code_assumet():codet(ID_assume)
{
operands().resize(1);
}

explicit code_assumet(const exprt &expr):codet(ID_assume)
{
add_to_operands(expr);
Expand Down Expand Up @@ -548,12 +537,6 @@ inline void validate_expr(const code_assumet &x)
class code_assertt:public codet
{
public:
DEPRECATED("use code_assertt(expr) instead")
code_assertt():codet(ID_assert)
{
operands().resize(1);
}

explicit code_assertt(const exprt &expr):codet(ID_assert)
{
add_to_operands(expr);
Expand Down Expand Up @@ -614,14 +597,6 @@ code_blockt create_fatal_assertion(
class code_ifthenelset:public codet
{
public:
DEPRECATED("use code_ifthenelset(condition, then_code[, else_code]) instead")
code_ifthenelset():codet(ID_ifthenelse)
{
operands().resize(3);
op1().make_nil();
op2().make_nil();
}

/// An if \p condition then \p then_code else \p else_code statement.
code_ifthenelset(
const exprt &condition,
Expand Down Expand Up @@ -705,12 +680,6 @@ inline code_ifthenelset &to_code_ifthenelse(codet &code)
class code_switcht:public codet
{
public:
DEPRECATED("use code_switcht(value, body) instead")
code_switcht():codet(ID_switch)
{
operands().resize(2);
}

code_switcht(const exprt &_value, const codet &_body) : codet(ID_switch)
{
operands().resize(2);
Expand Down Expand Up @@ -767,12 +736,6 @@ inline code_switcht &to_code_switch(codet &code)
class code_whilet:public codet
{
public:
DEPRECATED("use code_whilet(cond, body) instead")
code_whilet():codet(ID_while)
{
operands().resize(2);
}

code_whilet(const exprt &_cond, const codet &_body) : codet(ID_while)
{
operands().resize(2);
Expand Down Expand Up @@ -829,12 +792,6 @@ inline code_whilet &to_code_while(codet &code)
class code_dowhilet:public codet
{
public:
DEPRECATED("use code_dowhilet(cond, body) instead")
code_dowhilet():codet(ID_dowhile)
{
operands().resize(2);
}

code_dowhilet(const exprt &_cond, const codet &_body) : codet(ID_dowhile)
{
operands().resize(2);
Expand Down Expand Up @@ -893,12 +850,6 @@ inline code_dowhilet &to_code_dowhile(codet &code)
class code_fort:public codet
{
public:
DEPRECATED("use code_fort(init, cond, iter, body) instead")
code_fort():codet(ID_for)
{
operands().resize(4);
}

/// A statement describing a for loop with initializer \p _init, loop
/// condition \p _cond, increment \p _iter, and body \p _body.
code_fort(
Expand Down Expand Up @@ -983,11 +934,6 @@ inline code_fort &to_code_for(codet &code)
class code_gotot:public codet
{
public:
DEPRECATED("use code_gotot(label) instead")
code_gotot():codet(ID_goto)
{
}

explicit code_gotot(const irep_idt &label):codet(ID_goto)
{
set_destination(label);
Expand Down Expand Up @@ -1036,14 +982,6 @@ inline code_gotot &to_code_goto(codet &code)
class code_function_callt:public codet
{
public:
DEPRECATED("Use code_function_callt(...) instead")
code_function_callt():codet(ID_function_call)
{
operands().resize(3);
lhs().make_nil();
op2().id(ID_arguments);
}

explicit code_function_callt(const exprt &_function) : codet(ID_function_call)
{
operands().resize(3);
Expand Down Expand Up @@ -1256,12 +1194,6 @@ inline void validate_expr(const code_returnt &x)
class code_labelt:public codet
{
public:
DEPRECATED("use code_labelt(label) instead")
code_labelt():codet(ID_label)
{
operands().resize(1);
}

explicit code_labelt(const irep_idt &_label):codet(ID_label)
{
operands().resize(1);
Expand Down Expand Up @@ -1326,12 +1258,6 @@ inline code_labelt &to_code_label(codet &code)
class code_switch_caset:public codet
{
public:
DEPRECATED("use code_switch_caset(case_op, code) instead")
code_switch_caset():codet(ID_switch_case)
{
operands().resize(2);
}

code_switch_caset(
const exprt &_case_op, const codet &_code):codet(ID_switch_case)
{
Expand Down Expand Up @@ -1504,12 +1430,6 @@ inline const code_asmt &to_code_asm(const codet &code)
class code_expressiont:public codet
{
public:
DEPRECATED("use code_expressiont(expr) instead")
code_expressiont():codet(ID_expression)
{
operands().resize(1);
}

explicit code_expressiont(const exprt &expr):codet(ID_expression)
{
add_to_operands(expr);
Expand Down Expand Up @@ -1560,19 +1480,6 @@ inline const code_expressiont &to_code_expression(const codet &code)
class side_effect_exprt:public exprt
{
public:
DEPRECATED("use side_effect_exprt(statement, type, loc) instead")
explicit side_effect_exprt(const irep_idt &statement) : exprt(ID_side_effect)
{
set_statement(statement);
}

DEPRECATED("use side_effect_exprt(statement, type, loc) instead")
side_effect_exprt(const irep_idt &statement, const typet &_type):
exprt(ID_side_effect, _type)
{
set_statement(statement);
}

side_effect_exprt(
const irep_idt &statement,
const typet &_type,
Expand Down Expand Up @@ -1633,19 +1540,6 @@ inline const side_effect_exprt &to_side_effect_expr(const exprt &expr)
class side_effect_expr_nondett:public side_effect_exprt
{
public:
DEPRECATED("use side_effect_expr_nondett(statement, type, loc) instead")
side_effect_expr_nondett():side_effect_exprt(ID_nondet)
{
set_nullable(true);
}

DEPRECATED("use side_effect_expr_nondett(statement, type, loc) instead")
explicit side_effect_expr_nondett(const typet &_type):
side_effect_exprt(ID_nondet, _type)
{
set_nullable(true);
}

side_effect_expr_nondett(const typet &_type, const source_locationt &loc)
: side_effect_exprt(ID_nondet, _type, loc)
{
Expand Down Expand Up @@ -1691,45 +1585,6 @@ inline const side_effect_expr_nondett &to_side_effect_expr_nondet(
class side_effect_expr_function_callt:public side_effect_exprt
{
public:
DEPRECATED(
"use side_effect_expr_function_callt("
"function, arguments, type, loc) instead")
side_effect_expr_function_callt()
: side_effect_exprt(ID_function_call, typet(), source_locationt())
{
operands().resize(2);
op1().id(ID_arguments);
}

DEPRECATED(
"use side_effect_expr_function_callt("
"function, arguments, type, loc) instead")
side_effect_expr_function_callt(
const exprt &_function,
const exprt::operandst &_arguments)
: side_effect_exprt(ID_function_call)
{
operands().resize(2);
op1().id(ID_arguments);
function() = _function;
arguments() = _arguments;
}

DEPRECATED(
"use side_effect_expr_function_callt("
"function, arguments, type, loc) instead")
side_effect_expr_function_callt(
const exprt &_function,
const exprt::operandst &_arguments,
const typet &_type)
: side_effect_exprt(ID_function_call, _type)
{
operands().resize(2);
op1().id(ID_arguments);
function() = _function;
arguments() = _arguments;
}

side_effect_expr_function_callt(
const exprt &_function,
const exprt::operandst &_arguments,
Expand Down Expand Up @@ -1792,11 +1647,6 @@ inline const side_effect_expr_function_callt
class side_effect_expr_throwt:public side_effect_exprt
{
public:
DEPRECATED("use side_effect_expr_throwt(exception_list) instead")
side_effect_expr_throwt():side_effect_exprt(ID_throw)
{
}

side_effect_expr_throwt(
const irept &exception_list,
const typet &type,
Expand Down Expand Up @@ -2007,12 +1857,6 @@ static inline const code_landingpadt &to_code_landingpad(const codet &code)
class code_try_catcht:public codet
{
public:
DEPRECATED("use code_try_catcht(try_code) instead")
code_try_catcht():codet(ID_try_catch)
{
operands().resize(1);
}

/// A statement representing try \p _try_code catch ...
explicit code_try_catcht(const codet &_try_code) : codet(ID_try_catch)
{
Expand Down

0 comments on commit 9022d37

Please sign in to comment.