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