Skip to content

Commit be3c4c6

Browse files
authored
Merge pull request #2430 from tautschnig/vs-function-id
Java string preprocessing: Remove or document unused parameter function_id
2 parents c31edca + fb0c552 commit be3c4c6

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

jbmc/src/java_bytecode/java_string_library_preprocess.cpp

+19-2
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ refined_string_exprt java_string_library_preprocesst::decl_string_expr(
535535
/// add symbols with prefix cprover_string_length and cprover_string_data and
536536
/// construct a string_expr from them.
537537
/// \param loc: a location in the program
538+
/// \param function_id: name of the function containing the string
538539
/// \param symbol_table: symbol table
539540
/// \param code: code block to which allocation instruction will be added
540541
/// \return a new string_expr
@@ -648,6 +649,7 @@ codet java_string_library_preprocesst::code_return_function_application(
648649
/// Declare a fresh symbol of type array of character with infinite size.
649650
/// \param symbol_table: the symbol table
650651
/// \param loc: source location
652+
/// \param function_id: name of the function containing the array
651653
/// \param code [out] : code block where the declaration gets added
652654
/// \return created symbol expression
653655
exprt make_nondet_infinite_char_array(
@@ -660,7 +662,7 @@ exprt make_nondet_infinite_char_array(
660662
java_char_type(), infinity_exprt(java_int_type()));
661663
const symbolt data_sym = get_fresh_aux_symbol(
662664
array_type,
663-
"nondet_infinite_array",
665+
id2string(function_id),
664666
"nondet_infinite_array",
665667
loc,
666668
ID_java,
@@ -941,6 +943,7 @@ java_string_library_preprocesst::string_literal_to_string_expr(
941943
/// \param type: type of the function call
942944
/// \param loc: location in the program_invocation_name
943945
/// \param symbol_table: symbol table
946+
/// \param function_id: unused
944947
/// \return Code corresponding to:
945948
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
946949
/// IF arg->@class_identifier == "java.lang.String"
@@ -981,7 +984,12 @@ codet java_string_library_preprocesst::make_equals_function_code(
981984
code_blockt instance_case;
982985
// Check content equality
983986
const symbolt string_equals_sym = get_fresh_aux_symbol(
984-
return_type, "string_equals", "str_eq", loc, ID_java, symbol_table);
987+
return_type,
988+
id2string(function_id),
989+
"str_eq",
990+
loc,
991+
ID_java,
992+
symbol_table);
985993
const symbol_exprt string_equals = string_equals_sym.symbol_expr();
986994
instance_case.add(code_declt(string_equals), loc);
987995
const exprt::operandst args =
@@ -1736,6 +1744,7 @@ codet java_string_library_preprocesst::make_copy_string_code(
17361744
/// object.
17371745
/// \param type: type of the function
17381746
/// \param loc: location in the source
1747+
/// \param function_id: unused
17391748
/// \param symbol_table: symbol table
17401749
/// \return Code corresponding to:
17411750
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1749,6 +1758,8 @@ codet java_string_library_preprocesst::make_copy_constructor_code(
17491758
const irep_idt &function_id,
17501759
symbol_table_baset &symbol_table)
17511760
{
1761+
(void)function_id;
1762+
17521763
// Code for the output
17531764
code_blockt code;
17541765

@@ -1775,6 +1786,7 @@ codet java_string_library_preprocesst::make_copy_constructor_code(
17751786
/// count instead of end index
17761787
/// \param type: type of the function call
17771788
/// \param loc: location in the program_invocation_name
1789+
/// \param function_id: unused
17781790
/// \param symbol_table: symbol table
17791791
/// \return code implementing String intitialization from a char array and
17801792
/// arguments offset and end.
@@ -1784,6 +1796,8 @@ codet java_string_library_preprocesst::make_init_from_array_code(
17841796
const irep_idt &function_id,
17851797
symbol_table_baset &symbol_table)
17861798
{
1799+
(void)function_id;
1800+
17871801
// Code for the output
17881802
code_blockt code;
17891803

@@ -1819,6 +1833,7 @@ codet java_string_library_preprocesst::make_init_from_array_code(
18191833
/// Generates code for the String.length method
18201834
/// \param type: type of the function
18211835
/// \param loc: location in the source
1836+
/// \param function_id: unused
18221837
/// \param symbol_table: symbol table
18231838
/// \return Code corresponding to:
18241839
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1832,6 +1847,8 @@ codet java_string_library_preprocesst::make_string_length_code(
18321847
const irep_idt &function_id,
18331848
symbol_table_baset &symbol_table)
18341849
{
1850+
(void)function_id;
1851+
18351852
code_typet::parameterst params=type.parameters();
18361853
symbol_exprt arg_this(params[0].get_identifier(), params[0].type());
18371854
dereference_exprt deref=

0 commit comments

Comments
 (0)