@@ -407,8 +407,8 @@ refined_string_exprt java_string_library_preprocesst::replace_char_array(
407
407
checked_dereference (array_pointer, array_pointer.type ().subtype ());
408
408
// array_data is array_pointer-> data
409
409
const exprt array_data = get_data (array, symbol_table);
410
- const symbolt &sym_char_array = get_fresh_aux_symbol (
411
- array_data.type (), " char_array" , " char_array " , loc, ID_java , symbol_table);
410
+ const symbolt &sym_char_array = fresh_java_symbol (
411
+ array_data.type (), " char_array" , loc, function_id , symbol_table);
412
412
const symbol_exprt char_array = sym_char_array.symbol_expr ();
413
413
// char_array = array_pointer->data
414
414
code.add (code_assignt (char_array, array_data), loc);
@@ -439,8 +439,8 @@ symbol_exprt java_string_library_preprocesst::fresh_string(
439
439
const irep_idt &function_id,
440
440
symbol_table_baset &symbol_table)
441
441
{
442
- symbolt string_symbol= get_fresh_aux_symbol (
443
- type, " cprover_string" , " cprover_string " , loc, ID_java , symbol_table);
442
+ symbolt string_symbol =
443
+ fresh_java_symbol ( type, " cprover_string" , loc, function_id , symbol_table);
444
444
string_symbol.is_static_lifetime =true ;
445
445
return string_symbol.symbol_expr ();
446
446
}
@@ -458,22 +458,12 @@ refined_string_exprt java_string_library_preprocesst::decl_string_expr(
458
458
symbol_table_baset &symbol_table,
459
459
code_blockt &code)
460
460
{
461
- const symbolt &sym_length = get_fresh_aux_symbol (
462
- index_type,
463
- " cprover_string_length" ,
464
- " cprover_string_length" ,
465
- loc,
466
- ID_java,
467
- symbol_table);
461
+ const symbolt &sym_length = fresh_java_symbol (
462
+ index_type, " cprover_string_length" , loc, function_id, symbol_table);
468
463
const symbol_exprt length_field = sym_length.symbol_expr ();
469
464
const pointer_typet array_type = pointer_type (java_char_type ());
470
- const symbolt &sym_content = get_fresh_aux_symbol (
471
- array_type,
472
- " cprover_string_content" ,
473
- " cprover_string_content" ,
474
- loc,
475
- ID_java,
476
- symbol_table);
465
+ const symbolt &sym_content = fresh_java_symbol (
466
+ array_type, " cprover_string_content" , loc, function_id, symbol_table);
477
467
const symbol_exprt content_field = sym_content.symbol_expr ();
478
468
code.add (code_declt (content_field), loc);
479
469
const refined_string_exprt str{
@@ -599,12 +589,11 @@ exprt make_nondet_infinite_char_array(
599
589
{
600
590
const array_typet array_type (
601
591
java_char_type (), infinity_exprt (java_int_type ()));
602
- const symbolt data_sym = get_fresh_aux_symbol (
592
+ const symbolt data_sym = fresh_java_symbol (
603
593
pointer_type (array_type),
604
- id2string (function_id),
605
594
" nondet_infinite_array_pointer" ,
606
595
loc,
607
- ID_java ,
596
+ function_id ,
608
597
symbol_table);
609
598
610
599
const symbol_exprt data_pointer = data_sym.symbol_expr ();
@@ -634,13 +623,8 @@ void add_pointer_to_array_association(
634
623
{
635
624
PRECONDITION (array.type ().id () == ID_array);
636
625
PRECONDITION (pointer.type ().id () == ID_pointer);
637
- const symbolt &return_sym = get_fresh_aux_symbol (
638
- java_int_type (),
639
- " return_array" ,
640
- " return_array" ,
641
- loc,
642
- ID_java,
643
- symbol_table);
626
+ const symbolt &return_sym = fresh_java_symbol (
627
+ java_int_type (), " return_array" , loc, function_id, symbol_table);
644
628
const auto return_expr = return_sym.symbol_expr ();
645
629
code.add (code_declt (return_expr), loc);
646
630
code.add (
@@ -668,13 +652,8 @@ void add_array_to_length_association(
668
652
const irep_idt &function_id,
669
653
code_blockt &code)
670
654
{
671
- const symbolt &return_sym = get_fresh_aux_symbol (
672
- java_int_type (),
673
- " return_array" ,
674
- " return_array" ,
675
- loc,
676
- ID_java,
677
- symbol_table);
655
+ const symbolt &return_sym = fresh_java_symbol (
656
+ java_int_type (), " return_array" , loc, function_id, symbol_table);
678
657
const auto return_expr = return_sym.symbol_expr ();
679
658
code.add (code_declt (return_expr), loc);
680
659
code.add (
@@ -707,8 +686,8 @@ void add_character_set_constraint(
707
686
code_blockt &code)
708
687
{
709
688
PRECONDITION (pointer.type ().id () == ID_pointer);
710
- const symbolt &return_sym = get_fresh_aux_symbol (
711
- java_int_type (), " cnstr_added" , " cnstr_added " , loc, ID_java , symbol_table);
689
+ const symbolt &return_sym = fresh_java_symbol (
690
+ java_int_type (), " cnstr_added" , loc, function_id , symbol_table);
712
691
const auto return_expr = return_sym.symbol_expr ();
713
692
code.add (code_declt (return_expr), loc);
714
693
const constant_exprt char_set_expr (char_set, string_typet ());
@@ -745,12 +724,11 @@ refined_string_exprt java_string_library_preprocesst::string_expr_of_function(
745
724
code_blockt &code)
746
725
{
747
726
// int return_code;
748
- const symbolt & return_code_sym = get_fresh_aux_symbol (
727
+ const symbolt return_code_sym = fresh_java_symbol (
749
728
java_int_type (),
750
729
std::string (" return_code_" ) + function_id.c_str (),
751
- std::string (" return_code_" ) + function_id.c_str (),
752
730
loc,
753
- ID_java ,
731
+ function_id ,
754
732
symbol_table);
755
733
const auto return_code = return_code_sym.symbol_expr ();
756
734
code.add (code_declt (return_code), loc);
@@ -1212,8 +1190,8 @@ java_string_library_preprocesst::get_primitive_value_of_object(
1212
1190
1213
1191
// declare tmp_type_name to hold the value
1214
1192
const std::string aux_name = " tmp_" + id2string (type_name);
1215
- const symbolt &symbol = get_fresh_aux_symbol (
1216
- value_type, aux_name, aux_name, loc, ID_java , symbol_table);
1193
+ const symbolt &symbol =
1194
+ fresh_java_symbol ( value_type, aux_name, loc, function_id , symbol_table);
1217
1195
const auto value = symbol.symbol_expr ();
1218
1196
1219
1197
// Check that the type of the object is in the symbol table,
@@ -1318,8 +1296,8 @@ struct_exprt java_string_library_preprocesst::make_argument_for_format(
1318
1296
if (name!=" string_expr" )
1319
1297
{
1320
1298
std::string tmp_name=" tmp_" +id2string (name);
1321
- const symbolt &field_symbol = get_fresh_aux_symbol (
1322
- type, id2string (function_id), tmp_name, loc, ID_java , symbol_table);
1299
+ const symbolt &field_symbol =
1300
+ fresh_java_symbol ( type, tmp_name, loc, function_id , symbol_table);
1323
1301
auto field_symbol_expr = field_symbol.symbol_expr ();
1324
1302
field_expr = field_symbol_expr;
1325
1303
code.add (code_declt (field_symbol_expr), loc);
@@ -1334,13 +1312,8 @@ struct_exprt java_string_library_preprocesst::make_argument_for_format(
1334
1312
1335
1313
// arg_i = argv[index]
1336
1314
const exprt obj = get_object_at_index (argv, index );
1337
- const symbolt &object_symbol = get_fresh_aux_symbol (
1338
- obj.type (),
1339
- id2string (function_id),
1340
- " tmp_format_obj" ,
1341
- loc,
1342
- ID_java,
1343
- symbol_table);
1315
+ const symbolt &object_symbol = fresh_java_symbol (
1316
+ obj.type (), " tmp_format_obj" , loc, function_id, symbol_table);
1344
1317
const symbol_exprt arg_i = object_symbol.symbol_expr ();
1345
1318
1346
1319
allocate_objectst allocate_objects (ID_java, loc, function_id, symbol_table);
@@ -1485,8 +1458,8 @@ code_blockt java_string_library_preprocesst::make_object_get_class_code(
1485
1458
// > Class class1;
1486
1459
const pointer_typet class_type =
1487
1460
java_reference_type (symbol_table.lookup_ref (" java::java.lang.Class" ).type );
1488
- const symbolt &class1_sym = get_fresh_aux_symbol (
1489
- class_type, " class_symbol" , " class_symbol " , loc, ID_java , symbol_table);
1461
+ const symbolt &class1_sym = fresh_java_symbol (
1462
+ class_type, " class_symbol" , loc, function_id , symbol_table);
1490
1463
const symbol_exprt class1 = class1_sym.symbol_expr ();
1491
1464
code.add (code_declt (class1), loc);
1492
1465
0 commit comments