@@ -311,7 +311,7 @@ std::pair<code_blockt, std::vector<exprt>> java_build_arguments(
311
311
312
312
// we iterate through all the parameters of the function under test, allocate
313
313
// an object for that parameter (recursively allocating other objects
314
- // necessary to initialize it), and declare such object as an ID_input
314
+ // necessary to initialize it), and mark such object using `code_inputt`.
315
315
for (std::size_t param_number=0 ;
316
316
param_number<parameters.size ();
317
317
param_number++)
@@ -420,17 +420,8 @@ std::pair<code_blockt, std::vector<exprt>> java_build_arguments(
420
420
}
421
421
422
422
// record as an input
423
- codet input (ID_input);
424
- input.operands ().resize (2 );
425
- input.op0 ()=
426
- address_of_exprt (
427
- index_exprt (
428
- string_constantt (base_name),
429
- from_integer (0 , index_type ())));
430
- input.op1 ()=main_arguments[param_number];
431
- input.add_source_location ()=function.location ;
432
-
433
- init_code.add (std::move (input));
423
+ init_code.add (
424
+ code_inputt{base_name, main_arguments[param_number], function.location });
434
425
}
435
426
436
427
return make_pair (init_code, main_arguments);
@@ -467,13 +458,8 @@ static optionalt<codet> record_return_value(
467
458
const symbolt &return_symbol =
468
459
symbol_table.lookup_ref (JAVA_ENTRY_POINT_RETURN_SYMBOL);
469
460
470
- codet output (ID_output);
471
- output.operands ().resize (2 );
472
- output.op0 () = address_of_exprt (index_exprt (
473
- string_constantt (return_symbol.base_name ), from_integer (0 , index_type ())));
474
- output.op1 () = return_symbol.symbol_expr ();
475
- output.add_source_location () = function.location ;
476
- return output;
461
+ return code_outputt{
462
+ return_symbol.base_name , return_symbol.symbol_expr (), function.location };
477
463
}
478
464
479
465
static code_blockt record_pointer_parameters (
@@ -495,14 +481,8 @@ static code_blockt record_pointer_parameters(
495
481
if (!can_cast_type<pointer_typet>(p_symbol.type ))
496
482
continue ;
497
483
498
- codet output (ID_output);
499
- output.operands ().resize (2 );
500
- output.op0 () = address_of_exprt (index_exprt (
501
- string_constantt (p_symbol.base_name ), from_integer (0 , index_type ())));
502
- output.op1 () = arguments[param_number];
503
- output.add_source_location () = function.location ;
504
-
505
- init_code.add (std::move (output));
484
+ init_code.add (code_outputt{
485
+ p_symbol.base_name , arguments[param_number], function.location });
506
486
}
507
487
return init_code;
508
488
}
@@ -511,20 +491,13 @@ static codet record_exception(
511
491
const symbolt &function,
512
492
const symbol_table_baset &symbol_table)
513
493
{
514
- // record exceptional return variable as output
515
- codet output (ID_output);
516
- output.operands ().resize (2 );
517
-
518
494
// retrieve the exception variable
519
495
const symbolt &exc_symbol =
520
496
symbol_table.lookup_ref (JAVA_ENTRY_POINT_EXCEPTION_SYMBOL);
521
497
522
- output.op0 ()=address_of_exprt (
523
- index_exprt (string_constantt (exc_symbol.base_name ),
524
- from_integer (0 , index_type ())));
525
- output.op1 ()=exc_symbol.symbol_expr ();
526
- output.add_source_location ()=function.location ;
527
- return output;
498
+ // record exceptional return variable as output
499
+ return code_outputt{
500
+ exc_symbol.base_name , exc_symbol.symbol_expr (), function.location };
528
501
}
529
502
530
503
main_function_resultt get_main_symbol (
0 commit comments