Skip to content

Commit cb92548

Browse files
committed
Replace all uses of move_to_operands
move_to_operands is deprecated, use add_to_operands(std::move(...)) or proper constructors instead.
1 parent ba017d2 commit cb92548

38 files changed

+207
-256
lines changed

jbmc/src/java_bytecode/character_refine_preprocess.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,9 +1189,7 @@ exprt character_refine_preprocesst::expr_of_to_chars(
11891189
const typet &char_type=array_type.subtype();
11901190
exprt low_surrogate=expr_of_low_surrogate(chr, char_type);
11911191
array_exprt case1({low_surrogate}, array_type);
1192-
array_exprt case2({std::move(low_surrogate)}, array_type);
1193-
exprt high_surrogate=expr_of_high_surrogate(chr, char_type);
1194-
case2.move_to_operands(high_surrogate);
1192+
array_exprt case2({std::move(low_surrogate), expr_of_high_surrogate(chr, char_type)}, array_type);
11951193
return if_exprt(expr_of_is_bmp_code_point(chr, type), case1, case2);
11961194
}
11971195

jbmc/src/java_bytecode/java_bytecode_convert_class.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -879,9 +879,8 @@ void java_bytecode_convert_classt::add_array_types(symbol_tablet &symbol_table)
879879
// TODO use this instead of a loop.
880880
codet array_copy;
881881
array_copy.set_statement(ID_array_copy);
882-
array_copy.move_to_operands(new_data);
883-
array_copy.move_to_operands(old_data);
884-
clone_body.move_to_operands(array_copy);
882+
array_copy.add_to_operands(std::move(new_data), std::move(old_data));
883+
clone_body.add_to_operands(std::move(array_copy));
885884
*/
886885

887886
// Begin for-loop to replace:

jbmc/src/java_bytecode/java_string_literals.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ symbol_exprt get_or_create_string_literal_symbol(
173173
// _return_value global for its side-effects.
174174
exprt init_comma_expr(ID_comma);
175175
init_comma_expr.type() = literal_init.type();
176-
init_comma_expr.copy_to_operands(return_symbol.symbol_expr());
177-
init_comma_expr.move_to_operands(literal_init);
176+
init_comma_expr.add_to_operands(
177+
return_symbol.symbol_expr(), std::move(literal_init));
178178
new_symbol.value = init_comma_expr;
179179
}
180180
else if(jls_struct.components().size()>=1 &&

jbmc/unit/util/expr_iterator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ SCENARIO("depth_iterator_mutate_root", "[core][utils][depth_iterator]")
176176
exprt test_root;
177177
// This is the expression we might mutate when we find it
178178
exprt test_operand(ID_1);
179-
test_root.move_to_operands(test_operand);
180-
test_expr.move_to_operands(test_root);
179+
test_root.add_to_operands(std::move(test_operand));
180+
test_expr.add_to_operands(std::move(test_root));
181181
WHEN("Iteration occurs without mutation")
182182
{
183183
// Create shared copies

src/analyses/goto_check.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,10 +1412,7 @@ void goto_checkt::add_guarded_claim(
14121412
if(guard_expr.is_true())
14131413
new_expr.swap(expr);
14141414
else
1415-
{
1416-
new_expr=exprt(ID_implies, bool_typet());
1417-
new_expr.move_to_operands(guard_expr, expr);
1418-
}
1415+
new_expr = implies_exprt(std::move(guard_expr), std::move(expr));
14191416

14201417
if(assertions.insert(new_expr).second)
14211418
{

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ void c_typecheck_baset::typecheck_side_effect_statement_expression(
943943
{
944944
side_effect_exprt assign(
945945
ID_assign, sideeffect.type(), fc.source_location());
946-
assign.move_to_operands(fc.lhs(), sideeffect);
946+
assign.add_to_operands(fc.lhs(), std::move(sideeffect));
947947

948948
code_expressiont code_expr(assign);
949949
code_expr.add_source_location() = fc.source_location();
@@ -1302,7 +1302,7 @@ void c_typecheck_baset::typecheck_expr_index(exprt &expr)
13021302
typecheck_arithmetic_pointer(expr.op0());
13031303
exprt addition(ID_plus, array_expr.type());
13041304
addition.operands().swap(expr.operands());
1305-
expr.move_to_operands(addition);
1305+
expr.add_to_operands(std::move(addition));
13061306
expr.id(ID_dereference);
13071307
expr.set(ID_C_lvalue, true);
13081308
expr.type() = final_array_type.subtype();

src/ansi-c/parser.y

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,7 @@ offsetof_member_designator:
442442
{
443443
$$=$1;
444444
set($2, ID_index);
445-
exprt tmp=convert_integer_literal("0");
446-
stack($2).move_to_operands(tmp);
445+
stack($2).add_to_operands(convert_integer_literal("0"));
447446
mto($$, $2);
448447
set($2, ID_member);
449448
stack($2).set(ID_component_name, stack($3).get(ID_C_base_name));
@@ -574,7 +573,7 @@ postfix_expression:
574573
tmp.operands().swap(stack($5).operands());
575574
$$=$1;
576575
set($$, ID_typecast);
577-
stack($$).move_to_operands(tmp);
576+
stack($$).add_to_operands(std::move(tmp));
578577
stack($$).type().swap(stack($2));
579578
}
580579
| '(' type_name ')' '{' initializer_list ',' '}'
@@ -585,7 +584,7 @@ postfix_expression:
585584
tmp.operands().swap(stack($5).operands());
586585
$$=$1;
587586
set($$, ID_typecast);
588-
stack($$).move_to_operands(tmp);
587+
stack($$).add_to_operands(std::move(tmp));
589588
stack($$).type().swap(stack($2));
590589
}
591590
;
@@ -2080,7 +2079,7 @@ initializer_list:
20802079
exprt tmp;
20812080
tmp.swap(stack($$));
20822081
stack($$).clear();
2083-
stack($$).move_to_operands(tmp);
2082+
stack($$).add_to_operands(std::move(tmp));
20842083
}
20852084
| initializer_list ',' designated_initializer
20862085
{
@@ -2123,7 +2122,7 @@ designated_initializer:
21232122
exprt designator;
21242123
exprt member(ID_member);
21252124
member.set(ID_component_name, stack($1).get(ID_C_base_name));
2126-
designator.move_to_operands(member);
2125+
designator.add_to_operands(std::move(member));
21272126
stack($$).add(ID_designator).swap(designator);
21282127
mto($$, $3);
21292128
}
@@ -2638,14 +2637,14 @@ gcc_asm_output:
26382637
{
26392638
$$=$2;
26402639
stack($$).id(ID_gcc_asm_output);
2641-
stack($$).move_to_operands(stack($1), stack($3));
2640+
stack($$).add_to_operands(std::move(stack($1)), std::move(stack($3)));
26422641
}
26432642
| '[' identifier_or_typedef_name ']'
26442643
string '(' comma_expression ')'
26452644
{
26462645
$$=$5;
26472646
stack($$).id(ID_gcc_asm_output);
2648-
stack($$).move_to_operands(stack($4), stack($6));
2647+
stack($$).add_to_operands(std::move(stack($4)), std::move(stack($6)));
26492648
}
26502649
;
26512650

@@ -2675,14 +2674,14 @@ gcc_asm_input:
26752674
{
26762675
$$=$2;
26772676
stack($$).id(ID_gcc_asm_input);
2678-
stack($$).move_to_operands(stack($1), stack($3));
2677+
stack($$).add_to_operands(std::move(stack($1)), std::move(stack($3)));
26792678
}
26802679
| '[' identifier_or_typedef_name ']'
26812680
string '(' comma_expression ')'
26822681
{
26832682
$$=$5;
26842683
stack($$).id(ID_gcc_asm_input);
2685-
stack($$).move_to_operands(stack($4), stack($6));
2684+
stack($$).add_to_operands(std::move(stack($4)), std::move(stack($6)));
26862685
}
26872686
;
26882687

src/ansi-c/parser_static.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define YYSTYPE unsigned
1010
#define YYSTYPE_IS_TRIVIAL 1
1111

12-
#define mto(x, y) stack(x).move_to_operands(stack(y))
12+
#define mto(x, y) stack(x).add_to_operands(std::move(stack(y)))
1313
#define mts(x, y) (to_type_with_subtypes(stack_type(x)).move_to_subtypes(stack_type(y)))
1414
#define binary(x, y, l, id, z) { init(x, id); \
1515
stack(x).add_source_location()=stack(l).source_location(); \

src/cpp/cpp_constructor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ optionalt<codet> cpp_typecheckt::cpp_constructor(
190190
val=true_exprt();
191191

192192
side_effect_exprt assign(ID_assign, typet(), source_location);
193-
assign.move_to_operands(member, val);
193+
assign.add_to_operands(std::move(member), std::move(val));
194194
typecheck_side_effect_assignment(assign);
195195
block.add(code_expressiont(std::move(assign)));
196196
}
@@ -285,7 +285,7 @@ void cpp_typecheckt::new_temporary(
285285
if(new_code.has_value())
286286
{
287287
if(new_code->get_statement() == ID_assign)
288-
tmp_object_expr.move_to_operands(new_code->op1());
288+
tmp_object_expr.add_to_operands(std::move(new_code->op1()));
289289
else
290290
tmp_object_expr.add(ID_initializer) = *new_code;
291291
}

src/cpp/cpp_destructor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ optionalt<codet> cpp_typecheckt::cpp_destructor(
6868

6969
auto i_code = cpp_destructor(source_location, index);
7070
if(i_code.has_value())
71-
new_code.move_to_operands(i_code.value());
71+
new_code.add_to_operands(std::move(i_code.value()));
7272
}
7373
}
7474
else

0 commit comments

Comments
 (0)