Skip to content

Commit 0a63cb2

Browse files
author
Daniel Kroening
committed
use code_blockt::add and ::move for adding a statement
1 parent 82a1bd3 commit 0a63cb2

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/ansi-c/ansi_c_entry_point.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void record_function_outputs(
7373
output.op1()=return_symbol.symbol_expr();
7474
output.add_source_location()=function.location;
7575

76-
init_code.move_to_operands(output);
76+
init_code.move(output);
7777
}
7878

7979
#if 0
@@ -218,7 +218,7 @@ bool generate_ansi_c_start_function(
218218
call_init.add_source_location()=symbol.location;
219219
call_init.function()=init_it->second.symbol_expr();
220220

221-
init_code.move_to_operands(call_init);
221+
init_code.move(call_init);
222222
}
223223

224224
// build call to main function
@@ -264,7 +264,7 @@ bool generate_ansi_c_start_function(
264264
const binary_relation_exprt ge(argc_symbol.symbol_expr(), ID_ge, one);
265265

266266
code_assumet assumption(ge);
267-
init_code.move_to_operands(assumption);
267+
init_code.move(assumption);
268268
}
269269

270270
{
@@ -278,7 +278,7 @@ bool generate_ansi_c_start_function(
278278
argc_symbol.symbol_expr(), ID_le, bound_expr);
279279

280280
code_assumet assumption(le);
281-
init_code.move_to_operands(assumption);
281+
init_code.move(assumption);
282282
}
283283

284284
{
@@ -288,7 +288,7 @@ bool generate_ansi_c_start_function(
288288
input.op0()=address_of_exprt(
289289
index_exprt(string_constantt("argc"), from_integer(0, index_type())));
290290
input.op1()=argc_symbol.symbol_expr();
291-
init_code.move_to_operands(input);
291+
init_code.move(input);
292292
}
293293

294294
if(parameters.size()==3)
@@ -315,7 +315,7 @@ bool generate_ansi_c_start_function(
315315
envp_size_symbol.symbol_expr(), ID_le, max_minus_one);
316316

317317
code_assumet assumption(le);
318-
init_code.move_to_operands(assumption);
318+
init_code.move(assumption);
319319
}
320320

321321
{
@@ -350,7 +350,7 @@ bool generate_ansi_c_start_function(
350350
// disable bounds check on that one
351351
index_expr.set("bounds_check", false);
352352

353-
init_code.copy_to_operands(code_assignt(index_expr, null));
353+
init_code.add(code_assignt(index_expr, null));
354354
}
355355

356356
if(parameters.size()==3)
@@ -370,7 +370,7 @@ bool generate_ansi_c_start_function(
370370
const equal_exprt is_null(index_expr, null);
371371

372372
code_assumet assumption2(is_null);
373-
init_code.move_to_operands(assumption2);
373+
init_code.move(assumption2);
374374
}
375375

376376
{
@@ -434,7 +434,7 @@ bool generate_ansi_c_start_function(
434434
symbol_table);
435435
}
436436

437-
init_code.move_to_operands(call_main);
437+
init_code.move(call_main);
438438

439439
// TODO: add read/modified (recursively in call graph) globals as INPUT/OUTPUT
440440

src/ansi-c/c_typecheck_code.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void c_typecheck_baset::typecheck_block(codet &code)
188188

189189
// do decl-blocks
190190

191-
exprt new_ops;
191+
code_blockt new_ops;
192192
new_ops.operands().reserve(code.operands().size());
193193

194194
Forall_operands(it1, code)
@@ -211,10 +211,10 @@ void c_typecheck_baset::typecheck_block(codet &code)
211211

212212
// codet &label_op=*code_ptr;
213213

214-
new_ops.move_to_operands(code_op);
214+
new_ops.move(code_op);
215215
}
216216
else
217-
new_ops.move_to_operands(code_op);
217+
new_ops.move(code_op);
218218
}
219219

220220
code.operands().swap(new_ops.operands());
@@ -486,7 +486,7 @@ void c_typecheck_baset::typecheck_for(codet &code)
486486
code_block.reserve_operands(2);
487487
code_block.move_to_operands(code.op0());
488488
code.op0().make_nil();
489-
code_block.move_to_operands(code);
489+
code_block.move(code);
490490
code.swap(code_block);
491491
typecheck_code(code); // recursive call
492492
}
@@ -630,7 +630,7 @@ void c_typecheck_baset::typecheck_ifthenelse(code_ifthenelset &code)
630630
code_blockt code_block;
631631
code_block.add_source_location()=code.then_case().source_location();
632632

633-
code_block.move_to_operands(code.then_case());
633+
code_block.move(code.then_case());
634634
code.then_case().swap(code_block);
635635
}
636636

@@ -643,7 +643,7 @@ void c_typecheck_baset::typecheck_ifthenelse(code_ifthenelset &code)
643643
code_blockt code_block;
644644
code_block.add_source_location()=code.else_case().source_location();
645645

646-
code_block.move_to_operands(code.else_case());
646+
code_block.move(code.else_case());
647647
code.else_case().swap(code_block);
648648
}
649649

@@ -763,7 +763,7 @@ void c_typecheck_baset::typecheck_while(code_whilet &code)
763763
code_blockt code_block;
764764
code_block.add_source_location()=code.body().source_location();
765765

766-
code_block.move_to_operands(code.body());
766+
code_block.move(code.body());
767767
code.body().swap(code_block);
768768
}
769769
typecheck_code(code.body());
@@ -798,7 +798,7 @@ void c_typecheck_baset::typecheck_dowhile(code_dowhilet &code)
798798
code_blockt code_block;
799799
code_block.add_source_location()=code.body().source_location();
800800

801-
code_block.move_to_operands(code.body());
801+
code_block.move(code.body());
802802
code.body().swap(code_block);
803803
}
804804
typecheck_code(code.body());

src/util/std_code.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ code_blockt create_fatal_assertion(
123123
const exprt &condition, const source_locationt &loc)
124124
{
125125
code_blockt result;
126-
result.copy_to_operands(code_assertt(condition));
127-
result.copy_to_operands(code_assumet(condition));
126+
result.add(code_assertt(condition));
127+
result.add(code_assumet(condition));
128128
for(auto &op : result.operands())
129129
op.add_source_location() = loc;
130130
result.add_source_location() = loc;

0 commit comments

Comments
 (0)