@@ -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 (
@@ -706,8 +685,8 @@ void add_character_set_constraint(
706
685
code_blockt &code)
707
686
{
708
687
PRECONDITION (pointer.type ().id () == ID_pointer);
709
- const symbolt &return_sym = get_fresh_aux_symbol (
710
- java_int_type (), " cnstr_added" , " cnstr_added " , loc, ID_java , symbol_table);
688
+ const symbolt &return_sym = fresh_java_symbol (
689
+ java_int_type (), " cnstr_added" , loc, function_id , symbol_table);
711
690
const auto return_expr = return_sym.symbol_expr ();
712
691
code.add (code_declt (return_expr), loc);
713
692
const constant_exprt char_set_expr (char_set, string_typet ());
@@ -744,12 +723,11 @@ refined_string_exprt java_string_library_preprocesst::string_expr_of_function(
744
723
code_blockt &code)
745
724
{
746
725
// int return_code;
747
- const symbolt & return_code_sym = get_fresh_aux_symbol (
726
+ const symbolt return_code_sym = fresh_java_symbol (
748
727
java_int_type (),
749
728
std::string (" return_code_" ) + function_id.c_str (),
750
- std::string (" return_code_" ) + function_id.c_str (),
751
729
loc,
752
- ID_java ,
730
+ function_id ,
753
731
symbol_table);
754
732
const auto return_code = return_code_sym.symbol_expr ();
755
733
code.add (code_declt (return_code), loc);
@@ -1210,8 +1188,8 @@ java_string_library_preprocesst::get_primitive_value_of_object(
1210
1188
1211
1189
// declare tmp_type_name to hold the value
1212
1190
const std::string aux_name = " tmp_" + id2string (type_name);
1213
- const symbolt &symbol = get_fresh_aux_symbol (
1214
- value_type, aux_name, aux_name, loc, ID_java , symbol_table);
1191
+ const symbolt &symbol =
1192
+ fresh_java_symbol ( value_type, aux_name, loc, function_id , symbol_table);
1215
1193
const auto value = symbol.symbol_expr ();
1216
1194
1217
1195
// Check that the type of the object is in the symbol table,
@@ -1316,8 +1294,8 @@ struct_exprt java_string_library_preprocesst::make_argument_for_format(
1316
1294
if (name!=" string_expr" )
1317
1295
{
1318
1296
std::string tmp_name=" tmp_" +id2string (name);
1319
- const symbolt &field_symbol = get_fresh_aux_symbol (
1320
- type, id2string (function_id), tmp_name, loc, ID_java , symbol_table);
1297
+ const symbolt &field_symbol =
1298
+ fresh_java_symbol ( type, tmp_name, loc, function_id , symbol_table);
1321
1299
auto field_symbol_expr = field_symbol.symbol_expr ();
1322
1300
field_expr = field_symbol_expr;
1323
1301
code.add (code_declt (field_symbol_expr), loc);
@@ -1332,13 +1310,8 @@ struct_exprt java_string_library_preprocesst::make_argument_for_format(
1332
1310
1333
1311
// arg_i = argv[index]
1334
1312
const exprt obj = get_object_at_index (argv, index );
1335
- const symbolt &object_symbol = get_fresh_aux_symbol (
1336
- obj.type (),
1337
- id2string (function_id),
1338
- " tmp_format_obj" ,
1339
- loc,
1340
- ID_java,
1341
- symbol_table);
1313
+ const symbolt &object_symbol = fresh_java_symbol (
1314
+ obj.type (), " tmp_format_obj" , loc, function_id, symbol_table);
1342
1315
const symbol_exprt arg_i = object_symbol.symbol_expr ();
1343
1316
1344
1317
allocate_objectst allocate_objects (ID_java, loc, function_id, symbol_table);
@@ -1483,8 +1456,8 @@ code_blockt java_string_library_preprocesst::make_object_get_class_code(
1483
1456
// > Class class1;
1484
1457
const pointer_typet class_type =
1485
1458
java_reference_type (symbol_table.lookup_ref (" java::java.lang.Class" ).type );
1486
- const symbolt &class1_sym = get_fresh_aux_symbol (
1487
- class_type, " class_symbol" , " class_symbol " , loc, ID_java , symbol_table);
1459
+ const symbolt &class1_sym = fresh_java_symbol (
1460
+ class_type, " class_symbol" , loc, function_id , symbol_table);
1488
1461
const symbol_exprt class1 = class1_sym.symbol_expr ();
1489
1462
code.add (code_declt (class1), loc);
1490
1463
0 commit comments