@@ -249,12 +249,11 @@ symbol_exprt java_string_library_preprocesst::fresh_array(
249
249
const source_locationt &location,
250
250
symbol_tablet &symbol_table)
251
251
{
252
- symbolt array_symbol= get_fresh_aux_symbol (
252
+ symbolt array_symbol = fresh_java_symbol (
253
253
type,
254
254
" cprover_string_array" ,
255
- " cprover_string_array" ,
256
255
location,
257
- ID_java ,
256
+ location. get_function () ,
258
257
symbol_table);
259
258
array_symbol.is_static_lifetime =true ;
260
259
return array_symbol.symbol_expr ();
@@ -457,8 +456,8 @@ refined_string_exprt java_string_library_preprocesst::replace_char_array(
457
456
checked_dereference (array_pointer, array_pointer.type ().subtype ());
458
457
// array_data is array_pointer-> data
459
458
const exprt array_data = get_data (array, symbol_table);
460
- const symbolt sym_char_array = get_fresh_aux_symbol (
461
- array_data.type (), " char_array" , " char_array " , loc, ID_java , symbol_table);
459
+ const symbolt sym_char_array = fresh_java_symbol (
460
+ array_data.type (), " char_array" , loc, loc. get_function () , symbol_table);
462
461
const symbol_exprt char_array = sym_char_array.symbol_expr ();
463
462
// char_array = array_pointer->data
464
463
code.add (code_assignt (char_array, array_data), loc);
@@ -487,8 +486,8 @@ symbol_exprt java_string_library_preprocesst::fresh_string(
487
486
const source_locationt &loc,
488
487
symbol_table_baset &symbol_table)
489
488
{
490
- symbolt string_symbol= get_fresh_aux_symbol (
491
- type, " cprover_string" , " cprover_string " , loc, ID_java , symbol_table);
489
+ symbolt string_symbol = fresh_java_symbol (
490
+ type, " cprover_string" , loc, loc. get_function () , symbol_table);
492
491
string_symbol.is_static_lifetime =true ;
493
492
return string_symbol.symbol_expr ();
494
493
}
@@ -505,22 +504,12 @@ refined_string_exprt java_string_library_preprocesst::decl_string_expr(
505
504
symbol_table_baset &symbol_table,
506
505
code_blockt &code)
507
506
{
508
- const symbolt sym_length = get_fresh_aux_symbol (
509
- index_type,
510
- " cprover_string_length" ,
511
- " cprover_string_length" ,
512
- loc,
513
- ID_java,
514
- symbol_table);
507
+ const symbolt sym_length = fresh_java_symbol (
508
+ index_type, " cprover_string_length" , loc, function_name, symbol_table);
515
509
const symbol_exprt length_field = sym_length.symbol_expr ();
516
510
const pointer_typet array_type = pointer_type (java_char_type ());
517
- const symbolt sym_content = get_fresh_aux_symbol (
518
- array_type,
519
- " cprover_string_content" ,
520
- " cprover_string_content" ,
521
- loc,
522
- ID_java,
523
- symbol_table);
511
+ const symbolt sym_content = fresh_java_symbol (
512
+ array_type, " cprover_string_content" , loc, function_name, symbol_table);
524
513
const symbol_exprt content_field = sym_content.symbol_expr ();
525
514
code.add (code_declt (content_field), loc);
526
515
const refined_string_exprt str (
@@ -653,12 +642,11 @@ exprt make_nondet_infinite_char_array(
653
642
{
654
643
const array_typet array_type (
655
644
java_char_type (), infinity_exprt (java_int_type ()));
656
- const symbolt data_sym = get_fresh_aux_symbol (
645
+ const symbolt data_sym = fresh_java_symbol (
657
646
pointer_type (array_type),
658
- id2string (function_id),
659
647
" nondet_infinite_array_pointer" ,
660
648
loc,
661
- ID_java ,
649
+ loc. get_function () ,
662
650
symbol_table);
663
651
664
652
const symbol_exprt data_pointer = data_sym.symbol_expr ();
@@ -686,13 +674,8 @@ void add_pointer_to_array_association(
686
674
{
687
675
PRECONDITION (array.type ().id () == ID_array);
688
676
PRECONDITION (pointer.type ().id () == ID_pointer);
689
- const symbolt &return_sym = get_fresh_aux_symbol (
690
- java_int_type (),
691
- " return_array" ,
692
- " return_array" ,
693
- loc,
694
- ID_java,
695
- symbol_table);
677
+ const symbolt &return_sym = fresh_java_symbol (
678
+ java_int_type (), " return_array" , loc, loc.get_function (), symbol_table);
696
679
const auto return_expr = return_sym.symbol_expr ();
697
680
code.add (code_declt (return_expr), loc);
698
681
code.add (
@@ -718,13 +701,8 @@ void add_array_to_length_association(
718
701
const source_locationt &loc,
719
702
code_blockt &code)
720
703
{
721
- const symbolt &return_sym = get_fresh_aux_symbol (
722
- java_int_type (),
723
- " return_array" ,
724
- " return_array" ,
725
- loc,
726
- ID_java,
727
- symbol_table);
704
+ const symbolt &return_sym = fresh_java_symbol (
705
+ java_int_type (), " return_array" , loc, loc.get_function (), symbol_table);
728
706
const auto return_expr = return_sym.symbol_expr ();
729
707
code.add (code_declt (return_expr), loc);
730
708
code.add (
@@ -755,8 +733,8 @@ void add_character_set_constraint(
755
733
code_blockt &code)
756
734
{
757
735
PRECONDITION (pointer.type ().id () == ID_pointer);
758
- const symbolt &return_sym = get_fresh_aux_symbol (
759
- java_int_type (), " cnstr_added" , " cnstr_added " , loc, ID_java , symbol_table);
736
+ const symbolt &return_sym = fresh_java_symbol (
737
+ java_int_type (), " cnstr_added" , loc, loc. get_function () , symbol_table);
760
738
const auto return_expr = return_sym.symbol_expr ();
761
739
code.add (code_declt (return_expr), loc);
762
740
const constant_exprt char_set_expr (char_set, string_typet ());
@@ -793,12 +771,11 @@ refined_string_exprt java_string_library_preprocesst::string_expr_of_function(
793
771
code_blockt &code)
794
772
{
795
773
// int return_code;
796
- const symbolt return_code_sym = get_fresh_aux_symbol (
774
+ const symbolt return_code_sym = fresh_java_symbol (
797
775
java_int_type (),
798
776
std::string (" return_code_" ) + function_name.c_str (),
799
- std::string (" return_code_" ) + function_name.c_str (),
800
777
loc,
801
- ID_java ,
778
+ loc. get_function () ,
802
779
symbol_table);
803
780
const auto return_code = return_code_sym.symbol_expr ();
804
781
code.add (code_declt (return_code), loc);
@@ -1241,8 +1218,8 @@ java_string_library_preprocesst::get_primitive_value_of_object(
1241
1218
1242
1219
// declare tmp_type_name to hold the value
1243
1220
const std::string aux_name = " tmp_" + id2string (type_name);
1244
- const symbolt symbol = get_fresh_aux_symbol (
1245
- value_type, aux_name, aux_name, loc, ID_java , symbol_table);
1221
+ const symbolt symbol = fresh_java_symbol (
1222
+ value_type, aux_name, loc, loc. get_function () , symbol_table);
1246
1223
const auto value = symbol.symbol_expr ();
1247
1224
1248
1225
// Check that the type of the object is in the symbol table,
@@ -1350,8 +1327,8 @@ exprt java_string_library_preprocesst::make_argument_for_format(
1350
1327
if (name!=" string_expr" )
1351
1328
{
1352
1329
std::string tmp_name=" tmp_" +id2string (name);
1353
- symbolt field_symbol = get_fresh_aux_symbol (
1354
- type, id2string (function_id), tmp_name, loc, ID_java , symbol_table);
1330
+ symbolt field_symbol = fresh_java_symbol (
1331
+ type, tmp_name, loc, loc. get_function () , symbol_table);
1355
1332
auto field_symbol_expr = field_symbol.symbol_expr ();
1356
1333
field_expr = field_symbol_expr;
1357
1334
code.add (code_declt (field_symbol_expr), loc);
@@ -1366,13 +1343,8 @@ exprt java_string_library_preprocesst::make_argument_for_format(
1366
1343
1367
1344
// arg_i = argv[index]
1368
1345
const exprt obj = get_object_at_index (argv, index );
1369
- const symbolt object_symbol = get_fresh_aux_symbol (
1370
- obj.type (),
1371
- id2string (function_id),
1372
- " tmp_format_obj" ,
1373
- loc,
1374
- ID_java,
1375
- symbol_table);
1346
+ const symbolt object_symbol = fresh_java_symbol (
1347
+ obj.type (), " tmp_format_obj" , loc, loc.get_function (), symbol_table);
1376
1348
const symbol_exprt arg_i = object_symbol.symbol_expr ();
1377
1349
allocate_dynamic_object_with_decl (
1378
1350
arg_i, symbol_table, loc, function_id, code);
@@ -1512,8 +1484,8 @@ codet java_string_library_preprocesst::make_object_get_class_code(
1512
1484
// > Class class1;
1513
1485
const pointer_typet class_type =
1514
1486
java_reference_type (symbol_table.lookup_ref (" java::java.lang.Class" ).type );
1515
- const symbolt class1_sym = get_fresh_aux_symbol (
1516
- class_type, " class_symbol" , " class_symbol " , loc, ID_java , symbol_table);
1487
+ const symbolt class1_sym = fresh_java_symbol (
1488
+ class_type, " class_symbol" , loc, loc. get_function () , symbol_table);
1517
1489
const symbol_exprt class1 = class1_sym.symbol_expr ();
1518
1490
code.add (code_declt (class1), loc);
1519
1491
0 commit comments