@@ -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);
@@ -501,8 +500,8 @@ symbol_exprt java_string_library_preprocesst::fresh_string(
501
500
const irep_idt &function_name,
502
501
symbol_table_baset &symbol_table)
503
502
{
504
- symbolt string_symbol= get_fresh_aux_symbol (
505
- type, " cprover_string" , " cprover_string " , loc, ID_java , symbol_table);
503
+ symbolt string_symbol =
504
+ fresh_java_symbol ( type, " cprover_string" , loc, function_name , symbol_table);
506
505
string_symbol.is_static_lifetime =true ;
507
506
return string_symbol.symbol_expr ();
508
507
}
@@ -520,22 +519,12 @@ refined_string_exprt java_string_library_preprocesst::decl_string_expr(
520
519
symbol_table_baset &symbol_table,
521
520
code_blockt &code)
522
521
{
523
- const symbolt sym_length = get_fresh_aux_symbol (
524
- index_type,
525
- " cprover_string_length" ,
526
- " cprover_string_length" ,
527
- loc,
528
- ID_java,
529
- symbol_table);
522
+ const symbolt sym_length = fresh_java_symbol (
523
+ index_type, " cprover_string_length" , loc, function_name, symbol_table);
530
524
const symbol_exprt length_field = sym_length.symbol_expr ();
531
525
const pointer_typet array_type = pointer_type (java_char_type ());
532
- const symbolt sym_content = get_fresh_aux_symbol (
533
- array_type,
534
- " cprover_string_content" ,
535
- " cprover_string_content" ,
536
- loc,
537
- ID_java,
538
- symbol_table);
526
+ const symbolt sym_content = fresh_java_symbol (
527
+ array_type, " cprover_string_content" , loc, function_name, symbol_table);
539
528
const symbol_exprt content_field = sym_content.symbol_expr ();
540
529
code.add (code_declt (content_field), loc);
541
530
const refined_string_exprt str (
@@ -559,7 +548,7 @@ refined_string_exprt java_string_library_preprocesst::make_nondet_string_expr(
559
548
{
560
549
// / \todo refactor with initialize_nonddet_string_struct
561
550
const refined_string_exprt str =
562
- decl_string_expr (loc, loc. get_function () , symbol_table, code);
551
+ decl_string_expr (loc, function_id , symbol_table, code);
563
552
564
553
const side_effect_expr_nondett nondet_length (str.length ().type (), loc);
565
554
code.add (code_assignt (str.length (), nondet_length), loc);
@@ -661,12 +650,11 @@ exprt make_nondet_infinite_char_array(
661
650
{
662
651
const array_typet array_type (
663
652
java_char_type (), infinity_exprt (java_int_type ()));
664
- const symbolt data_sym = get_fresh_aux_symbol (
653
+ const symbolt data_sym = fresh_java_symbol (
665
654
pointer_type (array_type),
666
- id2string (function_id),
667
655
" nondet_infinite_array_pointer" ,
668
656
loc,
669
- ID_java ,
657
+ function_id ,
670
658
symbol_table);
671
659
672
660
const symbol_exprt data_pointer = data_sym.symbol_expr ();
@@ -696,13 +684,8 @@ void add_pointer_to_array_association(
696
684
{
697
685
PRECONDITION (array.type ().id () == ID_array);
698
686
PRECONDITION (pointer.type ().id () == ID_pointer);
699
- const symbolt &return_sym = get_fresh_aux_symbol (
700
- java_int_type (),
701
- " return_array" ,
702
- " return_array" ,
703
- loc,
704
- ID_java,
705
- symbol_table);
687
+ const symbolt &return_sym = fresh_java_symbol (
688
+ java_int_type (), " return_array" , loc, function_name, symbol_table);
706
689
const auto return_expr = return_sym.symbol_expr ();
707
690
code.add (code_declt (return_expr), loc);
708
691
code.add (
@@ -730,13 +713,8 @@ void add_array_to_length_association(
730
713
const irep_idt &function_name,
731
714
code_blockt &code)
732
715
{
733
- const symbolt &return_sym = get_fresh_aux_symbol (
734
- java_int_type (),
735
- " return_array" ,
736
- " return_array" ,
737
- loc,
738
- ID_java,
739
- symbol_table);
716
+ const symbolt &return_sym = fresh_java_symbol (
717
+ java_int_type (), " return_array" , loc, function_name, symbol_table);
740
718
const auto return_expr = return_sym.symbol_expr ();
741
719
code.add (code_declt (return_expr), loc);
742
720
code.add (
@@ -767,8 +745,8 @@ void add_character_set_constraint(
767
745
code_blockt &code)
768
746
{
769
747
PRECONDITION (pointer.type ().id () == ID_pointer);
770
- const symbolt &return_sym = get_fresh_aux_symbol (
771
- java_int_type (), " cnstr_added" , " cnstr_added " , loc, ID_java , symbol_table);
748
+ const symbolt &return_sym = fresh_java_symbol (
749
+ java_int_type (), " cnstr_added" , loc, loc. get_function () , symbol_table);
772
750
const auto return_expr = return_sym.symbol_expr ();
773
751
code.add (code_declt (return_expr), loc);
774
752
const constant_exprt char_set_expr (char_set, string_typet ());
@@ -805,12 +783,11 @@ refined_string_exprt java_string_library_preprocesst::string_expr_of_function(
805
783
code_blockt &code)
806
784
{
807
785
// int return_code;
808
- const symbolt return_code_sym = get_fresh_aux_symbol (
786
+ const symbolt return_code_sym = fresh_java_symbol (
809
787
java_int_type (),
810
788
std::string (" return_code_" ) + function_name.c_str (),
811
- std::string (" return_code_" ) + function_name.c_str (),
812
789
loc,
813
- ID_java ,
790
+ function_name ,
814
791
symbol_table);
815
792
const auto return_code = return_code_sym.symbol_expr ();
816
793
code.add (code_declt (return_code), loc);
@@ -1272,8 +1249,8 @@ java_string_library_preprocesst::get_primitive_value_of_object(
1272
1249
1273
1250
// declare tmp_type_name to hold the value
1274
1251
const std::string aux_name = " tmp_" + id2string (type_name);
1275
- const symbolt symbol = get_fresh_aux_symbol (
1276
- value_type, aux_name, aux_name, loc, ID_java , symbol_table);
1252
+ const symbolt symbol = fresh_java_symbol (
1253
+ value_type, aux_name, loc, loc. get_function () , symbol_table);
1277
1254
const auto value = symbol.symbol_expr ();
1278
1255
1279
1256
// Check that the type of the object is in the symbol table,
@@ -1378,8 +1355,8 @@ struct_exprt java_string_library_preprocesst::make_argument_for_format(
1378
1355
if (name!=" string_expr" )
1379
1356
{
1380
1357
std::string tmp_name=" tmp_" +id2string (name);
1381
- symbolt field_symbol = get_fresh_aux_symbol (
1382
- type, id2string (function_id), tmp_name, loc, ID_java , symbol_table);
1358
+ symbolt field_symbol = fresh_java_symbol (
1359
+ type, tmp_name, loc, loc. get_function () , symbol_table);
1383
1360
auto field_symbol_expr = field_symbol.symbol_expr ();
1384
1361
field_expr = field_symbol_expr;
1385
1362
code.add (code_declt (field_symbol_expr), loc);
@@ -1394,13 +1371,8 @@ struct_exprt java_string_library_preprocesst::make_argument_for_format(
1394
1371
1395
1372
// arg_i = argv[index]
1396
1373
const exprt obj = get_object_at_index (argv, index );
1397
- const symbolt object_symbol = get_fresh_aux_symbol (
1398
- obj.type (),
1399
- id2string (function_id),
1400
- " tmp_format_obj" ,
1401
- loc,
1402
- ID_java,
1403
- symbol_table);
1374
+ const symbolt object_symbol = fresh_java_symbol (
1375
+ obj.type (), " tmp_format_obj" , loc, loc.get_function (), symbol_table);
1404
1376
const symbol_exprt arg_i = object_symbol.symbol_expr ();
1405
1377
1406
1378
allocate_objectst allocate_objects (ID_java, loc, function_id, symbol_table);
@@ -1545,8 +1517,8 @@ code_blockt java_string_library_preprocesst::make_object_get_class_code(
1545
1517
// > Class class1;
1546
1518
const pointer_typet class_type =
1547
1519
java_reference_type (symbol_table.lookup_ref (" java::java.lang.Class" ).type );
1548
- const symbolt class1_sym = get_fresh_aux_symbol (
1549
- class_type, " class_symbol" , " class_symbol " , loc, ID_java , symbol_table);
1520
+ const symbolt class1_sym = fresh_java_symbol (
1521
+ class_type, " class_symbol" , loc, loc. get_function () , symbol_table);
1550
1522
const symbol_exprt class1 = class1_sym.symbol_expr ();
1551
1523
code.add (code_declt (class1), loc);
1552
1524
0 commit comments