@@ -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
}
@@ -500,21 +499,15 @@ refined_string_exprt java_string_library_preprocesst::decl_string_expr(
500
499
symbol_table_baset &symbol_table,
501
500
code_blockt &code)
502
501
{
503
- const symbolt sym_length = get_fresh_aux_symbol (
504
- index_type,
505
- " cprover_string_length" ,
506
- " cprover_string_length" ,
507
- loc,
508
- ID_java,
509
- symbol_table);
502
+ const symbolt sym_length = fresh_java_symbol (
503
+ index_type, " cprover_string_length" , loc, loc.get_function (), symbol_table);
510
504
const symbol_exprt length_field = sym_length.symbol_expr ();
511
505
const pointer_typet array_type = pointer_type (java_char_type ());
512
- const symbolt sym_content = get_fresh_aux_symbol (
506
+ const symbolt sym_content = fresh_java_symbol (
513
507
array_type,
514
508
" cprover_string_content" ,
515
- " cprover_string_content" ,
516
509
loc,
517
- ID_java ,
510
+ loc. get_function () ,
518
511
symbol_table);
519
512
const symbol_exprt content_field = sym_content.symbol_expr ();
520
513
code.add (code_declt (content_field), loc);
@@ -644,12 +637,11 @@ exprt make_nondet_infinite_char_array(
644
637
{
645
638
const array_typet array_type (
646
639
java_char_type (), infinity_exprt (java_int_type ()));
647
- const symbolt data_sym = get_fresh_aux_symbol (
640
+ const symbolt data_sym = fresh_java_symbol (
648
641
pointer_type (array_type),
649
- id2string (function_id),
650
642
" nondet_infinite_array_pointer" ,
651
643
loc,
652
- ID_java ,
644
+ loc. get_function () ,
653
645
symbol_table);
654
646
655
647
const symbol_exprt data_pointer = data_sym.symbol_expr ();
@@ -677,13 +669,8 @@ void add_pointer_to_array_association(
677
669
{
678
670
PRECONDITION (array.type ().id () == ID_array);
679
671
PRECONDITION (pointer.type ().id () == ID_pointer);
680
- const symbolt &return_sym = get_fresh_aux_symbol (
681
- java_int_type (),
682
- " return_array" ,
683
- " return_array" ,
684
- loc,
685
- ID_java,
686
- symbol_table);
672
+ const symbolt &return_sym = fresh_java_symbol (
673
+ java_int_type (), " return_array" , loc, loc.get_function (), symbol_table);
687
674
const auto return_expr = return_sym.symbol_expr ();
688
675
code.add (code_declt (return_expr), loc);
689
676
code.add (
@@ -709,13 +696,8 @@ void add_array_to_length_association(
709
696
const source_locationt &loc,
710
697
code_blockt &code)
711
698
{
712
- const symbolt &return_sym = get_fresh_aux_symbol (
713
- java_int_type (),
714
- " return_array" ,
715
- " return_array" ,
716
- loc,
717
- ID_java,
718
- symbol_table);
699
+ const symbolt &return_sym = fresh_java_symbol (
700
+ java_int_type (), " return_array" , loc, loc.get_function (), symbol_table);
719
701
const auto return_expr = return_sym.symbol_expr ();
720
702
code.add (code_declt (return_expr), loc);
721
703
code.add (
@@ -746,8 +728,8 @@ void add_character_set_constraint(
746
728
code_blockt &code)
747
729
{
748
730
PRECONDITION (pointer.type ().id () == ID_pointer);
749
- const symbolt &return_sym = get_fresh_aux_symbol (
750
- 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);
751
733
const auto return_expr = return_sym.symbol_expr ();
752
734
code.add (code_declt (return_expr), loc);
753
735
const constant_exprt char_set_expr (char_set, string_typet ());
@@ -784,12 +766,11 @@ refined_string_exprt java_string_library_preprocesst::string_expr_of_function(
784
766
code_blockt &code)
785
767
{
786
768
// int return_code;
787
- const symbolt return_code_sym = get_fresh_aux_symbol (
769
+ const symbolt return_code_sym = fresh_java_symbol (
788
770
java_int_type (),
789
771
std::string (" return_code_" ) + function_name.c_str (),
790
- std::string (" return_code_" ) + function_name.c_str (),
791
772
loc,
792
- ID_java ,
773
+ loc. get_function () ,
793
774
symbol_table);
794
775
const auto return_code = return_code_sym.symbol_expr ();
795
776
code.add (code_declt (return_code), loc);
@@ -1232,8 +1213,8 @@ java_string_library_preprocesst::get_primitive_value_of_object(
1232
1213
1233
1214
// declare tmp_type_name to hold the value
1234
1215
const std::string aux_name = " tmp_" + id2string (type_name);
1235
- const symbolt symbol = get_fresh_aux_symbol (
1236
- value_type, aux_name, aux_name, loc, ID_java , symbol_table);
1216
+ const symbolt symbol = fresh_java_symbol (
1217
+ value_type, aux_name, loc, loc. get_function () , symbol_table);
1237
1218
const auto value = symbol.symbol_expr ();
1238
1219
1239
1220
// Check that the type of the object is in the symbol table,
@@ -1341,8 +1322,8 @@ exprt java_string_library_preprocesst::make_argument_for_format(
1341
1322
if (name!=" string_expr" )
1342
1323
{
1343
1324
std::string tmp_name=" tmp_" +id2string (name);
1344
- symbolt field_symbol = get_fresh_aux_symbol (
1345
- type, id2string (function_id), tmp_name, loc, ID_java , symbol_table);
1325
+ symbolt field_symbol = fresh_java_symbol (
1326
+ type, tmp_name, loc, loc. get_function () , symbol_table);
1346
1327
auto field_symbol_expr = field_symbol.symbol_expr ();
1347
1328
field_expr = field_symbol_expr;
1348
1329
code.add (code_declt (field_symbol_expr), loc);
@@ -1357,13 +1338,8 @@ exprt java_string_library_preprocesst::make_argument_for_format(
1357
1338
1358
1339
// arg_i = argv[index]
1359
1340
const exprt obj = get_object_at_index (argv, index);
1360
- const symbolt object_symbol = get_fresh_aux_symbol (
1361
- obj.type (),
1362
- id2string (function_id),
1363
- " tmp_format_obj" ,
1364
- loc,
1365
- ID_java,
1366
- symbol_table);
1341
+ const symbolt object_symbol = fresh_java_symbol (
1342
+ obj.type (), " tmp_format_obj" , loc, loc.get_function (), symbol_table);
1367
1343
const symbol_exprt arg_i = object_symbol.symbol_expr ();
1368
1344
allocate_dynamic_object_with_decl (
1369
1345
arg_i, symbol_table, loc, function_id, code);
@@ -1503,8 +1479,8 @@ codet java_string_library_preprocesst::make_object_get_class_code(
1503
1479
// > Class class1;
1504
1480
const pointer_typet class_type =
1505
1481
java_reference_type (symbol_table.lookup_ref (" java::java.lang.Class" ).type );
1506
- const symbolt class1_sym = get_fresh_aux_symbol (
1507
- class_type, " class_symbol" , " class_symbol " , loc, ID_java , symbol_table);
1482
+ const symbolt class1_sym = fresh_java_symbol (
1483
+ class_type, " class_symbol" , loc, loc. get_function () , symbol_table);
1508
1484
const symbol_exprt class1 = class1_sym.symbol_expr ();
1509
1485
code.add (code_declt (class1), loc);
1510
1486
0 commit comments