Skip to content

Commit dbbd568

Browse files
author
Daniel Kroening
committed
mark various 'partial constructors' as deprecated, and introduce complete ones
1 parent a354513 commit dbbd568

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

src/util/std_code.h

+60
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Author: Daniel Kroening, [email protected]
2121
class codet:public exprt
2222
{
2323
public:
24+
DEPRECATED("Use codet(statement) instead")
2425
codet():exprt(ID_code, typet(ID_code))
2526
{
2627
}
@@ -253,6 +254,7 @@ inline code_assignt &to_code_assign(codet &code)
253254
class code_declt:public codet
254255
{
255256
public:
257+
DEPRECATED("Use code_declt(symbol) instead")
256258
code_declt():codet(ID_decl)
257259
{
258260
operands().resize(1);
@@ -305,6 +307,7 @@ inline code_declt &to_code_decl(codet &code)
305307
class code_deadt:public codet
306308
{
307309
public:
310+
DEPRECATED("Use code_deadt(symbol) instead")
308311
code_deadt():codet(ID_dead)
309312
{
310313
operands().resize(1);
@@ -354,6 +357,7 @@ inline code_deadt &to_code_dead(codet &code)
354357
class code_assumet:public codet
355358
{
356359
public:
360+
DEPRECATED("Use code_assumet(expr) instead")
357361
code_assumet():codet(ID_assume)
358362
{
359363
operands().resize(1);
@@ -400,6 +404,7 @@ inline code_assumet &to_code_assume(codet &code)
400404
class code_assertt:public codet
401405
{
402406
public:
407+
DEPRECATED("Use code_assertt(expr) instead")
403408
code_assertt():codet(ID_assert)
404409
{
405410
operands().resize(1);
@@ -533,11 +538,19 @@ inline code_ifthenelset &to_code_ifthenelse(codet &code)
533538
class code_switcht:public codet
534539
{
535540
public:
541+
DEPRECATED("Use code_switcht(value, body) instead")
536542
code_switcht():codet(ID_switch)
537543
{
538544
operands().resize(2);
539545
}
540546

547+
code_switcht(const exprt &_value, const codet &_body) : codet(ID_switch)
548+
{
549+
operands().resize(2);
550+
value() = _value;
551+
body() = _body;
552+
}
553+
541554
const exprt &value() const
542555
{
543556
return op0();
@@ -588,11 +601,19 @@ inline code_switcht &to_code_switch(codet &code)
588601
class code_whilet:public codet
589602
{
590603
public:
604+
DEPRECATED("Use code_whilet(cond, body) instead")
591605
code_whilet():codet(ID_while)
592606
{
593607
operands().resize(2);
594608
}
595609

610+
code_whilet(const exprt &_cond, const codet &_body) : codet(ID_while)
611+
{
612+
operands().resize(2);
613+
cond() = _cond;
614+
body() = _body;
615+
}
616+
596617
const exprt &cond() const
597618
{
598619
return op0();
@@ -643,11 +664,19 @@ inline code_whilet &to_code_while(codet &code)
643664
class code_dowhilet:public codet
644665
{
645666
public:
667+
DEPRECATED("Use code_dowhilet(cond, body) instead")
646668
code_dowhilet():codet(ID_dowhile)
647669
{
648670
operands().resize(2);
649671
}
650672

673+
code_dowhilet(const exprt &_cond, const codet &_body) : codet(ID_dowhile)
674+
{
675+
operands().resize(2);
676+
cond() = _cond;
677+
body() = _body;
678+
}
679+
651680
const exprt &cond() const
652681
{
653682
return op0();
@@ -774,6 +803,7 @@ inline code_fort &to_code_for(codet &code)
774803
class code_gotot:public codet
775804
{
776805
public:
806+
DEPRECATED("Use code_gotot(label) instead")
777807
code_gotot():codet(ID_goto)
778808
{
779809
}
@@ -947,6 +977,7 @@ inline code_returnt &to_code_return(codet &code)
947977
class code_labelt:public codet
948978
{
949979
public:
980+
DEPRECATED("Use code_labelt(label) instead")
950981
code_labelt():codet(ID_label)
951982
{
952983
operands().resize(1);
@@ -1014,6 +1045,7 @@ inline code_labelt &to_code_label(codet &code)
10141045
class code_switch_caset:public codet
10151046
{
10161047
public:
1048+
DEPRECATED("Use code_switch_caset(case_op, code) instead")
10171049
code_switch_caset():codet(ID_switch_case)
10181050
{
10191051
operands().resize(2);
@@ -1188,6 +1220,7 @@ inline const code_asmt &to_code_asm(const codet &code)
11881220
class code_expressiont:public codet
11891221
{
11901222
public:
1223+
DEPRECATED("Use code_expressiont(expr) instead")
11911224
code_expressiont():codet(ID_expression)
11921225
{
11931226
operands().resize(1);
@@ -1238,6 +1271,7 @@ inline const code_expressiont &to_code_expression(const codet &code)
12381271
class side_effect_exprt:public exprt
12391272
{
12401273
public:
1274+
DEPRECATED("Use side_effect_exprt(statement, type) instead")
12411275
explicit side_effect_exprt(const irep_idt &statement):
12421276
exprt(ID_side_effect)
12431277
{
@@ -1301,6 +1335,7 @@ inline const side_effect_exprt &to_side_effect_expr(const exprt &expr)
13011335
class side_effect_expr_nondett:public side_effect_exprt
13021336
{
13031337
public:
1338+
DEPRECATED("Use side_effect_expr_nondett(statement, type) instead")
13041339
side_effect_expr_nondett():side_effect_exprt(ID_nondet)
13051340
{
13061341
set_nullable(true);
@@ -1352,12 +1387,36 @@ inline const side_effect_expr_nondett &to_side_effect_expr_nondet(
13521387
class side_effect_expr_function_callt:public side_effect_exprt
13531388
{
13541389
public:
1390+
DEPRECATED("Use side_effect_expr_function_callt(...) instead")
13551391
side_effect_expr_function_callt():side_effect_exprt(ID_function_call)
13561392
{
13571393
operands().resize(2);
13581394
op1().id(ID_arguments);
13591395
}
13601396

1397+
side_effect_expr_function_callt(
1398+
const exprt &_function,
1399+
const exprt::operandst &_arguments)
1400+
: side_effect_exprt(ID_function_call)
1401+
{
1402+
operands().resize(2);
1403+
op1().id(ID_arguments);
1404+
function() = _function;
1405+
arguments() = _arguments;
1406+
}
1407+
1408+
side_effect_expr_function_callt(
1409+
const exprt &_function,
1410+
const exprt::operandst &_arguments,
1411+
const typet &_type)
1412+
: side_effect_exprt(ID_function_call, _type)
1413+
{
1414+
operands().resize(2);
1415+
op1().id(ID_arguments);
1416+
function() = _function;
1417+
arguments() = _arguments;
1418+
}
1419+
13611420
exprt &function()
13621421
{
13631422
return op0();
@@ -1409,6 +1468,7 @@ inline const side_effect_expr_function_callt
14091468
class side_effect_expr_throwt:public side_effect_exprt
14101469
{
14111470
public:
1471+
DEPRECATED("Use side_effect_expr_throwt(exception_list) instead")
14121472
side_effect_expr_throwt():side_effect_exprt(ID_throw)
14131473
{
14141474
}

0 commit comments

Comments
 (0)