@@ -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 ();
@@ -453,8 +452,8 @@ refined_string_exprt java_string_library_preprocesst::replace_char_array(
453
452
checked_dereference (array_pointer, array_pointer.type ().subtype ());
454
453
// array_data is array_pointer-> data
455
454
const exprt array_data = get_data (array, symbol_table);
456
- const symbolt sym_char_array = get_fresh_aux_symbol (
457
- array_data.type (), " char_array" , " char_array " , loc, ID_java , symbol_table);
455
+ const symbolt sym_char_array = fresh_java_symbol (
456
+ array_data.type (), " char_array" , loc, loc. get_function () , symbol_table);
458
457
const symbol_exprt char_array = sym_char_array.symbol_expr ();
459
458
// char_array = array_pointer->data
460
459
code.add (code_assignt (char_array, array_data), loc);
@@ -483,8 +482,8 @@ symbol_exprt java_string_library_preprocesst::fresh_string(
483
482
const source_locationt &loc,
484
483
symbol_table_baset &symbol_table)
485
484
{
486
- symbolt string_symbol= get_fresh_aux_symbol (
487
- type, " cprover_string" , " cprover_string " , loc, ID_java , symbol_table);
485
+ symbolt string_symbol = fresh_java_symbol (
486
+ type, " cprover_string" , loc, loc. get_function () , symbol_table);
488
487
string_symbol.is_static_lifetime =true ;
489
488
return string_symbol.symbol_expr ();
490
489
}
@@ -502,22 +501,12 @@ refined_string_exprt java_string_library_preprocesst::decl_string_expr(
502
501
symbol_table_baset &symbol_table,
503
502
code_blockt &code)
504
503
{
505
- const symbolt sym_length = get_fresh_aux_symbol (
506
- index_type,
507
- " cprover_string_length" ,
508
- " cprover_string_length" ,
509
- loc,
510
- ID_java,
511
- symbol_table);
504
+ const symbolt sym_length = fresh_java_symbol (
505
+ index_type, " cprover_string_length" , loc, function_name, symbol_table);
512
506
const symbol_exprt length_field = sym_length.symbol_expr ();
513
507
const pointer_typet array_type = pointer_type (java_char_type ());
514
- const symbolt sym_content = get_fresh_aux_symbol (
515
- array_type,
516
- " cprover_string_content" ,
517
- " cprover_string_content" ,
518
- loc,
519
- ID_java,
520
- symbol_table);
508
+ const symbolt sym_content = fresh_java_symbol (
509
+ array_type, " cprover_string_content" , loc, function_name, symbol_table);
521
510
const symbol_exprt content_field = sym_content.symbol_expr ();
522
511
code.add (code_declt (content_field), loc);
523
512
const refined_string_exprt str (
@@ -648,12 +637,11 @@ exprt make_nondet_infinite_char_array(
648
637
{
649
638
const array_typet array_type (
650
639
java_char_type (), infinity_exprt (java_int_type ()));
651
- const symbolt data_sym = get_fresh_aux_symbol (
640
+ const symbolt data_sym = fresh_java_symbol (
652
641
pointer_type (array_type),
653
- id2string (function_id),
654
642
" nondet_infinite_array_pointer" ,
655
643
loc,
656
- ID_java ,
644
+ loc. get_function () ,
657
645
symbol_table);
658
646
659
647
const symbol_exprt data_pointer = data_sym.symbol_expr ();
@@ -681,13 +669,8 @@ void add_pointer_to_array_association(
681
669
{
682
670
PRECONDITION (array.type ().id () == ID_array);
683
671
PRECONDITION (pointer.type ().id () == ID_pointer);
684
- const symbolt &return_sym = get_fresh_aux_symbol (
685
- java_int_type (),
686
- " return_array" ,
687
- " return_array" ,
688
- loc,
689
- ID_java,
690
- symbol_table);
672
+ const symbolt &return_sym = fresh_java_symbol (
673
+ java_int_type (), " return_array" , loc, loc.get_function (), symbol_table);
691
674
const auto return_expr = return_sym.symbol_expr ();
692
675
code.add (code_declt (return_expr), loc);
693
676
code.add (
@@ -713,13 +696,8 @@ void add_array_to_length_association(
713
696
const source_locationt &loc,
714
697
code_blockt &code)
715
698
{
716
- const symbolt &return_sym = get_fresh_aux_symbol (
717
- java_int_type (),
718
- " return_array" ,
719
- " return_array" ,
720
- loc,
721
- ID_java,
722
- symbol_table);
699
+ const symbolt &return_sym = fresh_java_symbol (
700
+ java_int_type (), " return_array" , loc, loc.get_function (), symbol_table);
723
701
const auto return_expr = return_sym.symbol_expr ();
724
702
code.add (code_declt (return_expr), loc);
725
703
code.add (
@@ -750,8 +728,8 @@ void add_character_set_constraint(
750
728
code_blockt &code)
751
729
{
752
730
PRECONDITION (pointer.type ().id () == ID_pointer);
753
- const symbolt &return_sym = get_fresh_aux_symbol (
754
- java_int_type (), " cnstr_added" , " cnstr_added " , loc, ID_java , symbol_table);
731
+ const symbolt &return_sym = fresh_java_symbol (
732
+ java_int_type (), " cnstr_added" , loc, loc. get_function () , symbol_table);
755
733
const auto return_expr = return_sym.symbol_expr ();
756
734
code.add (code_declt (return_expr), loc);
757
735
const constant_exprt char_set_expr (char_set, string_typet ());
@@ -788,12 +766,11 @@ refined_string_exprt java_string_library_preprocesst::string_expr_of_function(
788
766
code_blockt &code)
789
767
{
790
768
// int return_code;
791
- const symbolt return_code_sym = get_fresh_aux_symbol (
769
+ const symbolt return_code_sym = fresh_java_symbol (
792
770
java_int_type (),
793
771
std::string (" return_code_" ) + function_name.c_str (),
794
- std::string (" return_code_" ) + function_name.c_str (),
795
772
loc,
796
- ID_java ,
773
+ loc. get_function () ,
797
774
symbol_table);
798
775
const auto return_code = return_code_sym.symbol_expr ();
799
776
code.add (code_declt (return_code), loc);
@@ -1237,8 +1214,8 @@ java_string_library_preprocesst::get_primitive_value_of_object(
1237
1214
1238
1215
// declare tmp_type_name to hold the value
1239
1216
const std::string aux_name = " tmp_" + id2string (type_name);
1240
- const symbolt symbol = get_fresh_aux_symbol (
1241
- value_type, aux_name, aux_name, loc, ID_java , symbol_table);
1217
+ const symbolt symbol = fresh_java_symbol (
1218
+ value_type, aux_name, loc, loc. get_function () , symbol_table);
1242
1219
const auto value = symbol.symbol_expr ();
1243
1220
1244
1221
// Check that the type of the object is in the symbol table,
@@ -1347,8 +1324,8 @@ exprt java_string_library_preprocesst::make_argument_for_format(
1347
1324
if (name!=" string_expr" )
1348
1325
{
1349
1326
std::string tmp_name=" tmp_" +id2string (name);
1350
- symbolt field_symbol = get_fresh_aux_symbol (
1351
- type, id2string (function_id), tmp_name, loc, ID_java , symbol_table);
1327
+ symbolt field_symbol = fresh_java_symbol (
1328
+ type, tmp_name, loc, loc. get_function () , symbol_table);
1352
1329
auto field_symbol_expr = field_symbol.symbol_expr ();
1353
1330
field_expr = field_symbol_expr;
1354
1331
code.add (code_declt (field_symbol_expr), loc);
@@ -1363,13 +1340,8 @@ exprt java_string_library_preprocesst::make_argument_for_format(
1363
1340
1364
1341
// arg_i = argv[index]
1365
1342
const exprt obj = get_object_at_index (argv, index );
1366
- const symbolt object_symbol = get_fresh_aux_symbol (
1367
- obj.type (),
1368
- id2string (function_id),
1369
- " tmp_format_obj" ,
1370
- loc,
1371
- ID_java,
1372
- symbol_table);
1343
+ const symbolt object_symbol = fresh_java_symbol (
1344
+ obj.type (), " tmp_format_obj" , loc, loc.get_function (), symbol_table);
1373
1345
const symbol_exprt arg_i = object_symbol.symbol_expr ();
1374
1346
allocate_dynamic_object_with_decl (
1375
1347
arg_i, symbol_table, loc, function_id, code);
@@ -1511,8 +1483,8 @@ codet java_string_library_preprocesst::make_object_get_class_code(
1511
1483
// > Class class1;
1512
1484
const pointer_typet class_type =
1513
1485
java_reference_type (symbol_table.lookup_ref (" java::java.lang.Class" ).type );
1514
- const symbolt class1_sym = get_fresh_aux_symbol (
1515
- class_type, " class_symbol" , " class_symbol " , loc, ID_java , symbol_table);
1486
+ const symbolt class1_sym = fresh_java_symbol (
1487
+ class_type, " class_symbol" , loc, loc. get_function () , symbol_table);
1516
1488
const symbol_exprt class1 = class1_sym.symbol_expr ();
1517
1489
code.add (code_declt (class1), loc);
1518
1490
0 commit comments