@@ -168,18 +168,6 @@ bool java_string_library_preprocesst::is_java_char_array_pointer_type(
168
168
return false ;
169
169
}
170
170
171
- // / \param symbol_table: a symbol_table containing an entry for java Strings
172
- // / \return the type of data fields in java Strings.
173
- typet string_data_type (const symbol_tablet &symbol_table)
174
- {
175
- symbolt sym=*symbol_table.lookup (" java::java.lang.String" );
176
- typet concrete_type=sym.type ;
177
- struct_typet struct_type=to_struct_type (concrete_type);
178
- std::size_t index =struct_type.component_number (" data" );
179
- typet data_type=struct_type.components ()[index ].type ();
180
- return data_type;
181
- }
182
-
183
171
// / \return the type of the length field in java Strings.
184
172
typet string_length_type ()
185
173
{
@@ -589,26 +577,6 @@ exprt java_string_library_preprocesst::allocate_fresh_string(
589
577
return str;
590
578
}
591
579
592
- // / declare a new character array and allocate it
593
- // / \param type: a type for string
594
- // / \param loc: a location in the program
595
- // / \param symbol_table: symbol table
596
- // / \param code: code block to which allocation instruction will be added
597
- // / \return a new array
598
- exprt java_string_library_preprocesst::allocate_fresh_array (
599
- const typet &type,
600
- const source_locationt &loc,
601
- const irep_idt &function_id,
602
- symbol_tablet &symbol_table,
603
- code_blockt &code)
604
- {
605
- exprt array=fresh_array (type, loc, symbol_table);
606
- code.add (code_declt (array), loc);
607
- allocate_dynamic_object_with_decl (
608
- array, symbol_table, loc, function_id, code);
609
- return array;
610
- }
611
-
612
580
// / assign the result of a function call
613
581
// / \param lhs: an expression
614
582
// / \param function_name: the name of the function
@@ -1719,55 +1687,6 @@ codet java_string_library_preprocesst::make_copy_constructor_code(
1719
1687
return code;
1720
1688
}
1721
1689
1722
- // / Used to provide code for constructor from a char array.
1723
- // / The implementation is similar to substring except the 3rd argument is a
1724
- // / count instead of end index
1725
- // / \param type: type of the function call
1726
- // / \param loc: location in the program_invocation_name
1727
- // / \param function_id: unused
1728
- // / \param symbol_table: symbol table
1729
- // / \return code implementing String intitialization from a char array and
1730
- // / arguments offset and end.
1731
- codet java_string_library_preprocesst::make_init_from_array_code (
1732
- const java_method_typet &type,
1733
- const source_locationt &loc,
1734
- const irep_idt &function_id,
1735
- symbol_table_baset &symbol_table)
1736
- {
1737
- (void )function_id;
1738
-
1739
- // Code for the output
1740
- code_blockt code;
1741
-
1742
- java_method_typet::parameterst params = type.parameters ();
1743
- PRECONDITION (params.size () == 4 );
1744
- exprt::operandst args =
1745
- process_parameters (type.parameters (), loc, symbol_table, code);
1746
- INVARIANT (
1747
- args.size () == 4 , " process_parameters preserves number of arguments" );
1748
-
1749
- // / \todo this assumes the array to be constant between all calls to
1750
- // / string primitives, which may not be true in general.
1751
- refined_string_exprt string_arg = to_string_expr (args[1 ]);
1752
-
1753
- // The third argument is `count`, whereas the third argument of substring
1754
- // is `end` which corresponds to `offset+count`
1755
- refined_string_exprt string_expr = string_expr_of_function (
1756
- ID_cprover_string_substring_func,
1757
- {args[1 ], args[2 ], plus_exprt (args[2 ], args[3 ])},
1758
- loc,
1759
- symbol_table,
1760
- code);
1761
-
1762
- // Assign string_expr to `this` object
1763
- symbol_exprt arg_this (params[0 ].get_identifier (), params[0 ].type ());
1764
- code.add (
1765
- code_assign_string_expr_to_java_string (arg_this, string_expr, symbol_table),
1766
- loc);
1767
-
1768
- return code;
1769
- }
1770
-
1771
1690
// / Generates code for the String.length method
1772
1691
// / \param type: type of the function
1773
1692
// / \param loc: location in the source
@@ -1922,13 +1841,6 @@ void java_string_library_preprocesst::initialize_conversion_table()
1922
1841
std::placeholders::_2,
1923
1842
std::placeholders::_3,
1924
1843
std::placeholders::_4);
1925
- conversion_table[" java::java.lang.String.<init>:([CII)V" ] = std::bind (
1926
- &java_string_library_preprocesst::make_init_from_array_code,
1927
- this ,
1928
- std::placeholders::_1,
1929
- std::placeholders::_2,
1930
- std::placeholders::_3,
1931
- std::placeholders::_4);
1932
1844
cprover_equivalent_to_java_constructor
1933
1845
[" java::java.lang.String.<init>:()V" ]=
1934
1846
ID_cprover_string_empty_string_func;
@@ -1956,12 +1868,6 @@ void java_string_library_preprocesst::initialize_conversion_table()
1956
1868
cprover_equivalent_to_java_function
1957
1869
[" java::java.lang.String.contains:(Ljava/lang/CharSequence;)Z" ]=
1958
1870
ID_cprover_string_contains_func;
1959
- cprover_equivalent_to_java_string_returning_function
1960
- [" java::java.lang.String.copyValueOf:([CII)Ljava/lang/String;" ]=
1961
- ID_cprover_string_copy_func;
1962
- cprover_equivalent_to_java_string_returning_function
1963
- [" java::java.lang.String.copyValueOf:([C)Ljava/lang/String;" ]=
1964
- ID_cprover_string_copy_func;
1965
1871
cprover_equivalent_to_java_function
1966
1872
[" java::java.lang.String.endsWith:(Ljava/lang/String;)Z" ]=
1967
1873
ID_cprover_string_endswith_func;
@@ -2108,9 +2014,6 @@ void java_string_library_preprocesst::initialize_conversion_table()
2108
2014
cprover_equivalent_to_java_assign_and_return_function
2109
2015
[" java::java.lang.StringBuilder.append:(C)Ljava/lang/StringBuilder;" ]=
2110
2016
ID_cprover_string_concat_char_func;
2111
- cprover_equivalent_to_java_assign_and_return_function
2112
- [" java::java.lang.StringBuilder.append:([C)Ljava/lang/StringBuilder;" ] =
2113
- ID_cprover_string_concat_func;
2114
2017
cprover_equivalent_to_java_assign_and_return_function
2115
2018
[" java::java.lang.StringBuilder.append:(D)Ljava/lang/StringBuilder;" ] =
2116
2019
ID_cprover_string_concat_double_func;
0 commit comments