diff --git a/src/util/expr_initializer.cpp b/src/util/expr_initializer.cpp index 384d23aee02..2506b0c969f 100644 --- a/src/util/expr_initializer.cpp +++ b/src/util/expr_initializer.cpp @@ -199,7 +199,7 @@ exprt expr_initializert::expr_initializer_rec( { constant_exprt code_value(ID_nil, c.type()); code_value.add_source_location()=source_location; - value.copy_to_operands(code_value); + value.add_to_operands(std::move(code_value)); } else { @@ -207,7 +207,7 @@ exprt expr_initializert::expr_initializer_rec( if(member.is_nil()) return nil_exprt(); - value.copy_to_operands(member); + value.add_to_operands(std::move(member)); } } diff --git a/src/util/guard.cpp b/src/util/guard.cpp index f85100a8f46..9da74db2dcd 100644 --- a/src/util/guard.cpp +++ b/src/util/guard.cpp @@ -55,7 +55,7 @@ void guardt::add(const exprt &expr) else if(id()!=ID_and) { and_exprt a; - a.copy_to_operands(*this); + a.add_to_operands(*this); *this=a; } diff --git a/src/util/simplify_expr_array.cpp b/src/util/simplify_expr_array.cpp index 59e8be02dfc..d70962f9df0 100644 --- a/src/util/simplify_expr_array.cpp +++ b/src/util/simplify_expr_array.cpp @@ -201,7 +201,7 @@ bool simplify_exprt::simplify_index(exprt &expr) simplify_node(final_offset); exprt result(array.id(), expr.type()); - result.copy_to_operands(array.op0(), final_offset); + result.add_to_operands(array.op0(), final_offset); expr.swap(result); simplify_rec(expr); diff --git a/src/util/simplify_expr_int.cpp b/src/util/simplify_expr_int.cpp index 0e77748394f..df5deccfd45 100644 --- a/src/util/simplify_expr_int.cpp +++ b/src/util/simplify_expr_int.cpp @@ -477,7 +477,7 @@ bool simplify_exprt::simplify_plus(exprt &expr) exprt op0 = plus_expr.op0(); if(plus_expr.op0().op1().id() == ID_plus) - op0.op1().copy_to_operands(expr.op1()); + op0.op1().add_to_operands(expr.op1()); else op0.op1()=plus_exprt(op0.op1(), expr.op1()); diff --git a/src/util/std_code.h b/src/util/std_code.h index 7b550bd1c5e..6e17b9566a9 100644 --- a/src/util/std_code.h +++ b/src/util/std_code.h @@ -144,7 +144,7 @@ class code_blockt:public codet void add(const codet &code) { - copy_to_operands(code); + add_to_operands(code); } void add(codet &&code) @@ -219,7 +219,7 @@ class code_assignt:public codet code_assignt(const exprt &lhs, const exprt &rhs):codet(ID_assign) { - copy_to_operands(lhs, rhs); + add_to_operands(lhs, rhs); } exprt &lhs() @@ -284,7 +284,7 @@ class code_declt:public codet explicit code_declt(const exprt &symbol):codet(ID_decl) { - copy_to_operands(symbol); + add_to_operands(symbol); } exprt &symbol() @@ -400,7 +400,7 @@ class code_assumet:public codet explicit code_assumet(const exprt &expr):codet(ID_assume) { - copy_to_operands(expr); + add_to_operands(expr); } const exprt &assumption() const @@ -447,7 +447,7 @@ class code_assertt:public codet explicit code_assertt(const exprt &expr):codet(ID_assert) { - copy_to_operands(expr); + add_to_operands(expr); } const exprt &assertion() const @@ -1002,7 +1002,7 @@ class code_returnt:public codet explicit code_returnt(const exprt &_op):codet(ID_return) { - copy_to_operands(_op); + add_to_operands(_op); } const exprt &return_value() const @@ -1126,7 +1126,7 @@ class code_switch_caset:public codet code_switch_caset( const exprt &_case_op, const codet &_code):codet(ID_switch_case) { - copy_to_operands(_case_op, _code); + add_to_operands(_case_op, _code); } bool is_default() const @@ -1256,7 +1256,7 @@ class code_asmt:public codet explicit code_asmt(const exprt &expr):codet(ID_asm) { - copy_to_operands(expr); + add_to_operands(expr); } const irep_idt &get_flavor() const @@ -1303,7 +1303,7 @@ class code_expressiont:public codet explicit code_expressiont(const exprt &expr):codet(ID_expression) { - copy_to_operands(expr); + add_to_operands(expr); } const exprt &expression() const @@ -1748,7 +1748,7 @@ class code_landingpadt:public codet explicit code_landingpadt(const exprt &catch_expr): codet(ID_exception_landingpad) { - copy_to_operands(catch_expr); + add_to_operands(catch_expr); } const exprt &catch_expr() const { @@ -1825,9 +1825,7 @@ class code_try_catcht:public codet void add_catch(const code_declt &to_catch, const codet &code_catch) { - operands().reserve(operands().size()+2); - copy_to_operands(to_catch); - copy_to_operands(code_catch); + add_to_operands(to_catch, code_catch); } }; diff --git a/src/util/std_expr.h b/src/util/std_expr.h index 1c7161ed31d..60b9815ac2b 100644 --- a/src/util/std_expr.h +++ b/src/util/std_expr.h @@ -80,7 +80,7 @@ class ternary_exprt : public exprt const typet &_type) : exprt(_id, _type) { - copy_to_operands(_op0, _op1, _op2); + add_to_operands(_op0, _op1, _op2); } const exprt &op3() const = delete; @@ -347,7 +347,7 @@ class unary_exprt:public exprt const exprt &_op): exprt(_id, _op.type()) { - copy_to_operands(_op); + add_to_operands(_op); } unary_exprt( @@ -363,7 +363,7 @@ class unary_exprt:public exprt const typet &_type): exprt(_id, _type) { - copy_to_operands(_op); + add_to_operands(_op); } const exprt &op() const @@ -644,7 +644,7 @@ class predicate_exprt:public exprt const irep_idt &_id, const exprt &_op):exprt(_id, bool_typet()) { - copy_to_operands(_op); + add_to_operands(_op); } predicate_exprt( @@ -652,7 +652,7 @@ class predicate_exprt:public exprt const exprt &_op0, const exprt &_op1):exprt(_id, bool_typet()) { - copy_to_operands(_op0, _op1); + add_to_operands(_op0, _op1); } }; @@ -758,7 +758,7 @@ class binary_exprt:public exprt const exprt &_rhs): exprt(_id, _lhs.type()) { - copy_to_operands(_lhs, _rhs); + add_to_operands(_lhs, _rhs); } binary_exprt( @@ -768,7 +768,7 @@ class binary_exprt:public exprt const typet &_type): exprt(_id, _type) { - copy_to_operands(_lhs, _rhs); + add_to_operands(_lhs, _rhs); } const exprt &op2() const = delete; @@ -926,7 +926,7 @@ class multi_ary_exprt:public exprt const exprt &_rhs): exprt(_id, _lhs.type()) { - copy_to_operands(_lhs, _rhs); + add_to_operands(_lhs, _rhs); } multi_ary_exprt( @@ -936,7 +936,7 @@ class multi_ary_exprt:public exprt const typet &_type): exprt(_id, _type) { - copy_to_operands(_lhs, _rhs); + add_to_operands(_lhs, _rhs); } }; @@ -2326,7 +2326,7 @@ class and_exprt:public multi_ary_exprt and_exprt(const exprt &op0, const exprt &op1, const exprt &op2): multi_ary_exprt(ID_and, bool_typet()) { - copy_to_operands(op0, op1, op2); + add_to_operands(op0, op1, op2); } and_exprt( @@ -2448,7 +2448,7 @@ class or_exprt:public multi_ary_exprt or_exprt(const exprt &op0, const exprt &op1, const exprt &op2): multi_ary_exprt(ID_or, bool_typet()) { - copy_to_operands(op0, op1, op2); + add_to_operands(op0, op1, op2); } or_exprt( @@ -2615,7 +2615,7 @@ class bitor_exprt:public multi_ary_exprt bitor_exprt(const exprt &_op0, const exprt &_op1): multi_ary_exprt(ID_bitor, _op0.type()) { - copy_to_operands(_op0, _op1); + add_to_operands(_op0, _op1); } }; @@ -2724,7 +2724,7 @@ class bitand_exprt:public multi_ary_exprt bitand_exprt(const exprt &_op0, const exprt &_op1): multi_ary_exprt(ID_bitand, _op0.type()) { - copy_to_operands(_op0, _op1); + add_to_operands(_op0, _op1); } }; @@ -3073,7 +3073,7 @@ class extractbits_exprt:public exprt const exprt &_lower, const typet &_type):exprt(ID_extractbits, _type) { - copy_to_operands(_src, _upper, _lower); + add_to_operands(_src, _upper, _lower); } extractbits_exprt( @@ -3417,7 +3417,7 @@ class with_exprt:public exprt const exprt &_new_value): exprt(ID_with, _old.type()) { - copy_to_operands(_old, _where, _new_value); + add_to_operands(_old, _where, _new_value); } DEPRECATED("use with_exprt(old, where, new_value) instead") @@ -3501,7 +3501,7 @@ class index_designatort:public exprt explicit index_designatort(const exprt &_index): exprt(ID_index_designator) { - copy_to_operands(_index); + add_to_operands(_index); } const exprt &index() const @@ -3707,7 +3707,7 @@ class array_update_exprt:public exprt const exprt &_new_value): exprt(ID_array_update, _array.type()) { - copy_to_operands(_array, _index, _new_value); + add_to_operands(_array, _index, _new_value); } array_update_exprt():exprt(ID_array_update) @@ -4184,7 +4184,7 @@ class ieee_float_op_exprt:public exprt const exprt &_rm): exprt(_id) { - copy_to_operands(_lhs, _rhs, _rm); + add_to_operands(_lhs, _rhs, _rm); } exprt &lhs() @@ -4464,7 +4464,7 @@ class concatenation_exprt:public exprt const exprt &_op0, const exprt &_op1, const typet &_type): exprt(ID_concatenation, _type) { - copy_to_operands(_op0, _op1); + add_to_operands(_op0, _op1); } }; diff --git a/src/util/string_expr.h b/src/util/string_expr.h index dd44684140f..8c9e9f3d771 100644 --- a/src/util/string_expr.h +++ b/src/util/string_expr.h @@ -191,7 +191,7 @@ class refined_string_exprt : public struct_exprt, const typet &type) : struct_exprt(type) { - copy_to_operands(_length, _content); + add_to_operands(_length, _content); } refined_string_exprt(const exprt &_length, const exprt &_content)