@@ -251,12 +251,11 @@ symbol_exprt java_string_library_preprocesst::fresh_array(
251
251
const source_locationt &location,
252
252
symbol_tablet &symbol_table)
253
253
{
254
- symbolt array_symbol= get_fresh_aux_symbol (
254
+ symbolt array_symbol = fresh_java_symbol (
255
255
type,
256
256
" cprover_string_array" ,
257
- " cprover_string_array" ,
258
257
location,
259
- ID_java ,
258
+ location. get_function () ,
260
259
symbol_table);
261
260
array_symbol.is_static_lifetime =true ;
262
261
return array_symbol.symbol_expr ();
@@ -464,8 +463,8 @@ refined_string_exprt java_string_library_preprocesst::replace_char_array(
464
463
checked_dereference (array_pointer, array_pointer.type ().subtype ());
465
464
// array_data is array_pointer-> data
466
465
const exprt array_data = get_data (array, symbol_table);
467
- const symbolt &sym_char_array = get_fresh_aux_symbol (
468
- array_data.type (), " char_array" , " char_array " , loc, ID_java , symbol_table);
466
+ const symbolt &sym_char_array = fresh_java_symbol (
467
+ array_data.type (), " char_array" , loc, loc. get_function () , symbol_table);
469
468
const symbol_exprt char_array = sym_char_array.symbol_expr ();
470
469
// char_array = array_pointer->data
471
470
code.add (code_assignt (char_array, array_data), loc);
@@ -496,8 +495,8 @@ symbol_exprt java_string_library_preprocesst::fresh_string(
496
495
const irep_idt &function_id,
497
496
symbol_table_baset &symbol_table)
498
497
{
499
- symbolt string_symbol= get_fresh_aux_symbol (
500
- type, " cprover_string" , " cprover_string " , loc, ID_java , symbol_table);
498
+ symbolt string_symbol =
499
+ fresh_java_symbol ( type, " cprover_string" , loc, function_id , symbol_table);
501
500
string_symbol.is_static_lifetime =true ;
502
501
return string_symbol.symbol_expr ();
503
502
}
@@ -515,22 +514,12 @@ refined_string_exprt java_string_library_preprocesst::decl_string_expr(
515
514
symbol_table_baset &symbol_table,
516
515
code_blockt &code)
517
516
{
518
- const symbolt &sym_length = get_fresh_aux_symbol (
519
- index_type,
520
- " cprover_string_length" ,
521
- " cprover_string_length" ,
522
- loc,
523
- ID_java,
524
- symbol_table);
517
+ const symbolt &sym_length = fresh_java_symbol (
518
+ index_type, " cprover_string_length" , loc, function_id, symbol_table);
525
519
const symbol_exprt length_field = sym_length.symbol_expr ();
526
520
const pointer_typet array_type = pointer_type (java_char_type ());
527
- const symbolt &sym_content = get_fresh_aux_symbol (
528
- array_type,
529
- " cprover_string_content" ,
530
- " cprover_string_content" ,
531
- loc,
532
- ID_java,
533
- symbol_table);
521
+ const symbolt &sym_content = fresh_java_symbol (
522
+ array_type, " cprover_string_content" , loc, function_id, symbol_table);
534
523
const symbol_exprt content_field = sym_content.symbol_expr ();
535
524
code.add (code_declt (content_field), loc);
536
525
const refined_string_exprt str{
@@ -656,12 +645,11 @@ exprt make_nondet_infinite_char_array(
656
645
{
657
646
const array_typet array_type (
658
647
java_char_type (), infinity_exprt (java_int_type ()));
659
- const symbolt data_sym = get_fresh_aux_symbol (
648
+ const symbolt data_sym = fresh_java_symbol (
660
649
pointer_type (array_type),
661
- id2string (function_id),
662
650
" nondet_infinite_array_pointer" ,
663
651
loc,
664
- ID_java ,
652
+ function_id ,
665
653
symbol_table);
666
654
667
655
const symbol_exprt data_pointer = data_sym.symbol_expr ();
@@ -691,13 +679,8 @@ void add_pointer_to_array_association(
691
679
{
692
680
PRECONDITION (array.type ().id () == ID_array);
693
681
PRECONDITION (pointer.type ().id () == ID_pointer);
694
- const symbolt &return_sym = get_fresh_aux_symbol (
695
- java_int_type (),
696
- " return_array" ,
697
- " return_array" ,
698
- loc,
699
- ID_java,
700
- symbol_table);
682
+ const symbolt &return_sym = fresh_java_symbol (
683
+ java_int_type (), " return_array" , loc, function_id, symbol_table);
701
684
const auto return_expr = return_sym.symbol_expr ();
702
685
code.add (code_declt (return_expr), loc);
703
686
code.add (
@@ -725,13 +708,8 @@ void add_array_to_length_association(
725
708
const irep_idt &function_id,
726
709
code_blockt &code)
727
710
{
728
- const symbolt &return_sym = get_fresh_aux_symbol (
729
- java_int_type (),
730
- " return_array" ,
731
- " return_array" ,
732
- loc,
733
- ID_java,
734
- symbol_table);
711
+ const symbolt &return_sym = fresh_java_symbol (
712
+ java_int_type (), " return_array" , loc, function_id, symbol_table);
735
713
const auto return_expr = return_sym.symbol_expr ();
736
714
code.add (code_declt (return_expr), loc);
737
715
code.add (
@@ -762,8 +740,8 @@ void add_character_set_constraint(
762
740
code_blockt &code)
763
741
{
764
742
PRECONDITION (pointer.type ().id () == ID_pointer);
765
- const symbolt &return_sym = get_fresh_aux_symbol (
766
- java_int_type (), " cnstr_added" , " cnstr_added " , loc, ID_java , symbol_table);
743
+ const symbolt &return_sym = fresh_java_symbol (
744
+ java_int_type (), " cnstr_added" , loc, loc. get_function () , symbol_table);
767
745
const auto return_expr = return_sym.symbol_expr ();
768
746
code.add (code_declt (return_expr), loc);
769
747
const constant_exprt char_set_expr (char_set, string_typet ());
@@ -800,12 +778,11 @@ refined_string_exprt java_string_library_preprocesst::string_expr_of_function(
800
778
code_blockt &code)
801
779
{
802
780
// int return_code;
803
- const symbolt & return_code_sym = get_fresh_aux_symbol (
781
+ const symbolt return_code_sym = fresh_java_symbol (
804
782
java_int_type (),
805
783
std::string (" return_code_" ) + function_id.c_str (),
806
- std::string (" return_code_" ) + function_id.c_str (),
807
784
loc,
808
- ID_java ,
785
+ function_id ,
809
786
symbol_table);
810
787
const auto return_code = return_code_sym.symbol_expr ();
811
788
code.add (code_declt (return_code), loc);
@@ -1265,8 +1242,8 @@ java_string_library_preprocesst::get_primitive_value_of_object(
1265
1242
1266
1243
// declare tmp_type_name to hold the value
1267
1244
const std::string aux_name = " tmp_" + id2string (type_name);
1268
- const symbolt &symbol = get_fresh_aux_symbol (
1269
- value_type, aux_name, aux_name, loc, ID_java , symbol_table);
1245
+ const symbolt &symbol = fresh_java_symbol (
1246
+ value_type, aux_name, loc, loc. get_function () , symbol_table);
1270
1247
const auto value = symbol.symbol_expr ();
1271
1248
1272
1249
// Check that the type of the object is in the symbol table,
@@ -1371,8 +1348,8 @@ struct_exprt java_string_library_preprocesst::make_argument_for_format(
1371
1348
if (name!=" string_expr" )
1372
1349
{
1373
1350
std::string tmp_name=" tmp_" +id2string (name);
1374
- const symbolt &field_symbol = get_fresh_aux_symbol (
1375
- type, id2string (function_id), tmp_name, loc, ID_java , symbol_table);
1351
+ const symbolt &field_symbol = fresh_java_symbol (
1352
+ type, tmp_name, loc, loc. get_function () , symbol_table);
1376
1353
auto field_symbol_expr = field_symbol.symbol_expr ();
1377
1354
field_expr = field_symbol_expr;
1378
1355
code.add (code_declt (field_symbol_expr), loc);
@@ -1387,13 +1364,8 @@ struct_exprt java_string_library_preprocesst::make_argument_for_format(
1387
1364
1388
1365
// arg_i = argv[index]
1389
1366
const exprt obj = get_object_at_index (argv, index );
1390
- const symbolt &object_symbol = get_fresh_aux_symbol (
1391
- obj.type (),
1392
- id2string (function_id),
1393
- " tmp_format_obj" ,
1394
- loc,
1395
- ID_java,
1396
- symbol_table);
1367
+ const symbolt &object_symbol = fresh_java_symbol (
1368
+ obj.type (), " tmp_format_obj" , loc, loc.get_function (), symbol_table);
1397
1369
const symbol_exprt arg_i = object_symbol.symbol_expr ();
1398
1370
1399
1371
allocate_objectst allocate_objects (ID_java, loc, function_id, symbol_table);
@@ -1538,8 +1510,8 @@ code_blockt java_string_library_preprocesst::make_object_get_class_code(
1538
1510
// > Class class1;
1539
1511
const pointer_typet class_type =
1540
1512
java_reference_type (symbol_table.lookup_ref (" java::java.lang.Class" ).type );
1541
- const symbolt &class1_sym = get_fresh_aux_symbol (
1542
- class_type, " class_symbol" , " class_symbol " , loc, ID_java , symbol_table);
1513
+ const symbolt &class1_sym = fresh_java_symbol (
1514
+ class_type, " class_symbol" , loc, loc. get_function () , symbol_table);
1543
1515
const symbol_exprt class1 = class1_sym.symbol_expr ();
1544
1516
code.add (code_declt (class1), loc);
1545
1517
0 commit comments