@@ -60,7 +60,7 @@ void goto_convertt::remove_assignment(
60
60
statement==ID_assign_bitxor ||
61
61
statement==ID_assign_bitor)
62
62
{
63
- INVARIANT (
63
+ DATA_INVARIANT (
64
64
expr.operands ().size () == 2 ,
65
65
expr.find_source_location ().as_string () + " : " + id2string (statement) +
66
66
" takes two arguments" );
@@ -147,7 +147,7 @@ void goto_convertt::remove_pre(
147
147
148
148
DATA_INVARIANT (
149
149
statement == ID_preincrement || statement == ID_predecrement,
150
- " expected preincrement or predecrement" );
150
+ " expected preincrement or predecrement" );
151
151
152
152
exprt rhs;
153
153
rhs.add_source_location ()=expr.source_location ();
@@ -236,7 +236,7 @@ void goto_convertt::remove_post(
236
236
237
237
DATA_INVARIANT (
238
238
statement == ID_postincrement || statement == ID_postdecrement,
239
- " expected postincrement or postdecrement" );
239
+ " expected postincrement or postdecrement" );
240
240
241
241
exprt rhs;
242
242
rhs.add_source_location ()=expr.source_location ();
@@ -326,12 +326,13 @@ void goto_convertt::remove_function_call(
326
326
const irep_idt &mode,
327
327
bool result_is_used)
328
328
{
329
+ DATA_INVARIANT (
330
+ expr.operands ().size () == 2 ,
331
+ expr.find_source_location ().as_string () +
332
+ " : function_call expects two operands" );
333
+
329
334
if (!result_is_used)
330
335
{
331
- DATA_INVARIANT (
332
- expr.operands ().size () == 2 ,
333
- expr.find_source_location ().as_string () +
334
- " : function_call expects two operands" );
335
336
code_function_callt call (nil_exprt (), expr.op0 (), expr.op1 ().operands ());
336
337
call.add_source_location ()=expr.source_location ();
337
338
convert_function_call (call, dest, mode);
@@ -345,11 +346,6 @@ void goto_convertt::remove_function_call(
345
346
expr.id () == ID_side_effect && expr.get (ID_statement) == ID_function_call,
346
347
expr.find_source_location ().as_string () + " : expected function call" );
347
348
348
- DATA_INVARIANT (
349
- !expr.operands ().empty (),
350
- expr.find_source_location ().as_string () +
351
- " : function_call expects at least one operand" );
352
-
353
349
std::string new_base_name = " return_value" ;
354
350
irep_idt new_symbol_mode = mode;
355
351
@@ -430,7 +426,8 @@ void goto_convertt::remove_cpp_delete(
430
426
side_effect_exprt &expr,
431
427
goto_programt &dest)
432
428
{
433
- DATA_INVARIANT (expr.operands ().size () == 1 , " cpp_delete expected 1 operand" );
429
+ DATA_INVARIANT (expr.operands ().size () == 1 ,
430
+ " cpp_delete expected one operand" );
434
431
435
432
codet tmp (expr.get_statement ());
436
433
tmp.add_source_location ()=expr.source_location ();
@@ -486,7 +483,7 @@ void goto_convertt::remove_temporary_object(
486
483
DATA_INVARIANT (
487
484
expr.operands ().size () <= 1 ,
488
485
expr.find_source_location ().as_string () +
489
- " : temporary_object takes 0 or 1 operands" );
486
+ " : temporary_object takes zero or one operands" );
490
487
491
488
symbolt &new_symbol = new_tmp_symbol (
492
489
expr.type (), " obj" , dest, expr.find_source_location (), mode);
@@ -503,7 +500,7 @@ void goto_convertt::remove_temporary_object(
503
500
INVARIANT (
504
501
expr.operands ().empty (),
505
502
expr.find_source_location ().as_string () +
506
- " : temporary_object takes 0 operands" );
503
+ " : temporary_object takes zero operands" );
507
504
exprt initializer=static_cast <const exprt &>(expr.find (ID_initializer));
508
505
replace_new_object (new_symbol.symbol_expr (), initializer);
509
506
@@ -527,7 +524,7 @@ void goto_convertt::remove_statement_expression(
527
524
DATA_INVARIANT (
528
525
expr.operands ().size () == 1 ,
529
526
expr.find_source_location ().as_string () +
530
- " : statement_expression takes 1 operand" );
527
+ " : statement_expression takes one operand" );
531
528
532
529
DATA_INVARIANT (
533
530
expr.op0 ().id () == ID_code,
@@ -564,7 +561,7 @@ void goto_convertt::remove_statement_expression(
564
561
symbol_exprt tmp_symbol_expr (new_symbol.name , new_symbol.type );
565
562
tmp_symbol_expr.add_source_location ()=source_location;
566
563
567
- if (last.get (ID_statement )==ID_expression)
564
+ if (last.get (ID_statement_expressionement )==ID_expression)
568
565
{
569
566
// we turn this into an assignment
570
567
exprt e=to_code_expression (last).expression ();
0 commit comments