Skip to content

Commit f2e4d43

Browse files
author
Daniel Kroening
committed
replace copy_to_operands by add_to_operands
1 parent 3028bf8 commit f2e4d43

File tree

7 files changed

+36
-38
lines changed

7 files changed

+36
-38
lines changed

src/util/expr_initializer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,15 @@ exprt expr_initializert<nondet>::expr_initializer_rec(
199199
{
200200
constant_exprt code_value(ID_nil, c.type());
201201
code_value.add_source_location()=source_location;
202-
value.copy_to_operands(code_value);
202+
value.add_to_operands(std::move(code_value));
203203
}
204204
else
205205
{
206206
const exprt member = expr_initializer_rec(c.type(), source_location);
207207
if(member.is_nil())
208208
return nil_exprt();
209209

210-
value.copy_to_operands(member);
210+
value.add_to_operands(std::move(member));
211211
}
212212
}
213213

src/util/guard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void guardt::add(const exprt &expr)
5555
else if(id()!=ID_and)
5656
{
5757
and_exprt a;
58-
a.copy_to_operands(*this);
58+
a.add_to_operands(*this);
5959
*this=a;
6060
}
6161

src/util/simplify_expr_array.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ bool simplify_exprt::simplify_index(exprt &expr)
201201
simplify_node(final_offset);
202202

203203
exprt result(array.id(), expr.type());
204-
result.copy_to_operands(array.op0(), final_offset);
204+
result.add_to_operands(array.op0(), final_offset);
205205
expr.swap(result);
206206

207207
simplify_rec(expr);

src/util/simplify_expr_int.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ bool simplify_exprt::simplify_plus(exprt &expr)
477477
exprt op0 = plus_expr.op0();
478478

479479
if(plus_expr.op0().op1().id() == ID_plus)
480-
op0.op1().copy_to_operands(expr.op1());
480+
op0.op1().add_to_operands(expr.op1());
481481
else
482482
op0.op1()=plus_exprt(op0.op1(), expr.op1());
483483

src/util/std_code.h

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class code_blockt:public codet
144144

145145
void add(const codet &code)
146146
{
147-
copy_to_operands(code);
147+
add_to_operands(code);
148148
}
149149

150150
void add(codet &&code)
@@ -219,7 +219,7 @@ class code_assignt:public codet
219219

220220
code_assignt(const exprt &lhs, const exprt &rhs):codet(ID_assign)
221221
{
222-
copy_to_operands(lhs, rhs);
222+
add_to_operands(lhs, rhs);
223223
}
224224

225225
exprt &lhs()
@@ -284,7 +284,7 @@ class code_declt:public codet
284284

285285
explicit code_declt(const exprt &symbol):codet(ID_decl)
286286
{
287-
copy_to_operands(symbol);
287+
add_to_operands(symbol);
288288
}
289289

290290
exprt &symbol()
@@ -400,7 +400,7 @@ class code_assumet:public codet
400400

401401
explicit code_assumet(const exprt &expr):codet(ID_assume)
402402
{
403-
copy_to_operands(expr);
403+
add_to_operands(expr);
404404
}
405405

406406
const exprt &assumption() const
@@ -447,7 +447,7 @@ class code_assertt:public codet
447447

448448
explicit code_assertt(const exprt &expr):codet(ID_assert)
449449
{
450-
copy_to_operands(expr);
450+
add_to_operands(expr);
451451
}
452452

453453
const exprt &assertion() const
@@ -1002,7 +1002,7 @@ class code_returnt:public codet
10021002

10031003
explicit code_returnt(const exprt &_op):codet(ID_return)
10041004
{
1005-
copy_to_operands(_op);
1005+
add_to_operands(_op);
10061006
}
10071007

10081008
const exprt &return_value() const
@@ -1126,7 +1126,7 @@ class code_switch_caset:public codet
11261126
code_switch_caset(
11271127
const exprt &_case_op, const codet &_code):codet(ID_switch_case)
11281128
{
1129-
copy_to_operands(_case_op, _code);
1129+
add_to_operands(_case_op, _code);
11301130
}
11311131

11321132
bool is_default() const
@@ -1256,7 +1256,7 @@ class code_asmt:public codet
12561256

12571257
explicit code_asmt(const exprt &expr):codet(ID_asm)
12581258
{
1259-
copy_to_operands(expr);
1259+
add_to_operands(expr);
12601260
}
12611261

12621262
const irep_idt &get_flavor() const
@@ -1303,7 +1303,7 @@ class code_expressiont:public codet
13031303

13041304
explicit code_expressiont(const exprt &expr):codet(ID_expression)
13051305
{
1306-
copy_to_operands(expr);
1306+
add_to_operands(expr);
13071307
}
13081308

13091309
const exprt &expression() const
@@ -1748,7 +1748,7 @@ class code_landingpadt:public codet
17481748
explicit code_landingpadt(const exprt &catch_expr):
17491749
codet(ID_exception_landingpad)
17501750
{
1751-
copy_to_operands(catch_expr);
1751+
add_to_operands(catch_expr);
17521752
}
17531753
const exprt &catch_expr() const
17541754
{
@@ -1825,9 +1825,7 @@ class code_try_catcht:public codet
18251825

18261826
void add_catch(const code_declt &to_catch, const codet &code_catch)
18271827
{
1828-
operands().reserve(operands().size()+2);
1829-
copy_to_operands(to_catch);
1830-
copy_to_operands(code_catch);
1828+
add_to_operands(to_catch, code_catch);
18311829
}
18321830
};
18331831

src/util/std_expr.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ternary_exprt : public exprt
8080
const typet &_type)
8181
: exprt(_id, _type)
8282
{
83-
copy_to_operands(_op0, _op1, _op2);
83+
add_to_operands(_op0, _op1, _op2);
8484
}
8585

8686
const exprt &op3() const = delete;
@@ -347,7 +347,7 @@ class unary_exprt:public exprt
347347
const exprt &_op):
348348
exprt(_id, _op.type())
349349
{
350-
copy_to_operands(_op);
350+
add_to_operands(_op);
351351
}
352352

353353
unary_exprt(
@@ -363,7 +363,7 @@ class unary_exprt:public exprt
363363
const typet &_type):
364364
exprt(_id, _type)
365365
{
366-
copy_to_operands(_op);
366+
add_to_operands(_op);
367367
}
368368

369369
const exprt &op() const
@@ -644,15 +644,15 @@ class predicate_exprt:public exprt
644644
const irep_idt &_id,
645645
const exprt &_op):exprt(_id, bool_typet())
646646
{
647-
copy_to_operands(_op);
647+
add_to_operands(_op);
648648
}
649649

650650
predicate_exprt(
651651
const irep_idt &_id,
652652
const exprt &_op0,
653653
const exprt &_op1):exprt(_id, bool_typet())
654654
{
655-
copy_to_operands(_op0, _op1);
655+
add_to_operands(_op0, _op1);
656656
}
657657
};
658658

@@ -758,7 +758,7 @@ class binary_exprt:public exprt
758758
const exprt &_rhs):
759759
exprt(_id, _lhs.type())
760760
{
761-
copy_to_operands(_lhs, _rhs);
761+
add_to_operands(_lhs, _rhs);
762762
}
763763

764764
binary_exprt(
@@ -768,7 +768,7 @@ class binary_exprt:public exprt
768768
const typet &_type):
769769
exprt(_id, _type)
770770
{
771-
copy_to_operands(_lhs, _rhs);
771+
add_to_operands(_lhs, _rhs);
772772
}
773773

774774
const exprt &op2() const = delete;
@@ -926,7 +926,7 @@ class multi_ary_exprt:public exprt
926926
const exprt &_rhs):
927927
exprt(_id, _lhs.type())
928928
{
929-
copy_to_operands(_lhs, _rhs);
929+
add_to_operands(_lhs, _rhs);
930930
}
931931

932932
multi_ary_exprt(
@@ -936,7 +936,7 @@ class multi_ary_exprt:public exprt
936936
const typet &_type):
937937
exprt(_id, _type)
938938
{
939-
copy_to_operands(_lhs, _rhs);
939+
add_to_operands(_lhs, _rhs);
940940
}
941941
};
942942

@@ -2326,7 +2326,7 @@ class and_exprt:public multi_ary_exprt
23262326
and_exprt(const exprt &op0, const exprt &op1, const exprt &op2):
23272327
multi_ary_exprt(ID_and, bool_typet())
23282328
{
2329-
copy_to_operands(op0, op1, op2);
2329+
add_to_operands(op0, op1, op2);
23302330
}
23312331

23322332
and_exprt(
@@ -2448,7 +2448,7 @@ class or_exprt:public multi_ary_exprt
24482448
or_exprt(const exprt &op0, const exprt &op1, const exprt &op2):
24492449
multi_ary_exprt(ID_or, bool_typet())
24502450
{
2451-
copy_to_operands(op0, op1, op2);
2451+
add_to_operands(op0, op1, op2);
24522452
}
24532453

24542454
or_exprt(
@@ -2615,7 +2615,7 @@ class bitor_exprt:public multi_ary_exprt
26152615
bitor_exprt(const exprt &_op0, const exprt &_op1):
26162616
multi_ary_exprt(ID_bitor, _op0.type())
26172617
{
2618-
copy_to_operands(_op0, _op1);
2618+
add_to_operands(_op0, _op1);
26192619
}
26202620
};
26212621

@@ -2724,7 +2724,7 @@ class bitand_exprt:public multi_ary_exprt
27242724
bitand_exprt(const exprt &_op0, const exprt &_op1):
27252725
multi_ary_exprt(ID_bitand, _op0.type())
27262726
{
2727-
copy_to_operands(_op0, _op1);
2727+
add_to_operands(_op0, _op1);
27282728
}
27292729
};
27302730

@@ -3073,7 +3073,7 @@ class extractbits_exprt:public exprt
30733073
const exprt &_lower,
30743074
const typet &_type):exprt(ID_extractbits, _type)
30753075
{
3076-
copy_to_operands(_src, _upper, _lower);
3076+
add_to_operands(_src, _upper, _lower);
30773077
}
30783078

30793079
extractbits_exprt(
@@ -3417,7 +3417,7 @@ class with_exprt:public exprt
34173417
const exprt &_new_value):
34183418
exprt(ID_with, _old.type())
34193419
{
3420-
copy_to_operands(_old, _where, _new_value);
3420+
add_to_operands(_old, _where, _new_value);
34213421
}
34223422

34233423
DEPRECATED("use with_exprt(old, where, new_value) instead")
@@ -3501,7 +3501,7 @@ class index_designatort:public exprt
35013501
explicit index_designatort(const exprt &_index):
35023502
exprt(ID_index_designator)
35033503
{
3504-
copy_to_operands(_index);
3504+
add_to_operands(_index);
35053505
}
35063506

35073507
const exprt &index() const
@@ -3707,7 +3707,7 @@ class array_update_exprt:public exprt
37073707
const exprt &_new_value):
37083708
exprt(ID_array_update, _array.type())
37093709
{
3710-
copy_to_operands(_array, _index, _new_value);
3710+
add_to_operands(_array, _index, _new_value);
37113711
}
37123712

37133713
array_update_exprt():exprt(ID_array_update)
@@ -4184,7 +4184,7 @@ class ieee_float_op_exprt:public exprt
41844184
const exprt &_rm):
41854185
exprt(_id)
41864186
{
4187-
copy_to_operands(_lhs, _rhs, _rm);
4187+
add_to_operands(_lhs, _rhs, _rm);
41884188
}
41894189

41904190
exprt &lhs()
@@ -4464,7 +4464,7 @@ class concatenation_exprt:public exprt
44644464
const exprt &_op0, const exprt &_op1, const typet &_type):
44654465
exprt(ID_concatenation, _type)
44664466
{
4467-
copy_to_operands(_op0, _op1);
4467+
add_to_operands(_op0, _op1);
44684468
}
44694469
};
44704470

src/util/string_expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class refined_string_exprt : public struct_exprt,
191191
const typet &type)
192192
: struct_exprt(type)
193193
{
194-
copy_to_operands(_length, _content);
194+
add_to_operands(_length, _content);
195195
}
196196

197197
refined_string_exprt(const exprt &_length, const exprt &_content)

0 commit comments

Comments
 (0)