@@ -1776,28 +1776,6 @@ codet java_string_library_preprocesst::make_init_from_array_code(
1776
1776
return code;
1777
1777
}
1778
1778
1779
- // / Generates code for the String.length method
1780
- // / \param type: type of the function
1781
- // / \param loc: location in the source
1782
- // / \param symbol_table: symbol table
1783
- // / \return Code corresponding to:
1784
- // / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1785
- // / str_expr = java_string_to_string_expr(this)
1786
- // / str_expr_sym = str_expr
1787
- // / return this->length
1788
- // / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1789
- codet java_string_library_preprocesst::make_string_length_code (
1790
- const code_typet &type,
1791
- const source_locationt &loc,
1792
- symbol_table_baset &symbol_table)
1793
- {
1794
- code_typet::parameterst params=type.parameters ();
1795
- symbol_exprt arg_this (params[0 ].get_identifier (), params[0 ].type ());
1796
- dereference_exprt deref=
1797
- checked_dereference (arg_this, arg_this.type ().subtype ());
1798
- return code_returnt (get_length (deref, symbol_table));
1799
- }
1800
-
1801
1779
bool java_string_library_preprocesst::implements_function (
1802
1780
const irep_idt &function_id) const
1803
1781
{
@@ -2018,14 +1996,9 @@ void java_string_library_preprocesst::initialize_conversion_table()
2018
1996
cprover_equivalent_to_java_function
2019
1997
[" java::java.lang.String.lastIndexOf:(Ljava/lang/String;I)I" ]=
2020
1998
ID_cprover_string_last_index_of_func;
2021
- conversion_table
1999
+ cprover_equivalent_to_java_function
2022
2000
[" java::java.lang.String.length:()I" ]=
2023
- std::bind (
2024
- &java_string_library_preprocesst::make_string_length_code,
2025
- this ,
2026
- std::placeholders::_1,
2027
- std::placeholders::_2,
2028
- std::placeholders::_3);
2001
+ ID_cprover_string_length_func;
2029
2002
cprover_equivalent_to_java_function
2030
2003
[" java::org.cprover.CProverString.offsetByCodePoints:(Ljava/lang/"
2031
2004
" String;II)I" ] = ID_cprover_string_offset_by_code_point_func;
@@ -2178,14 +2151,9 @@ void java_string_library_preprocesst::initialize_conversion_table()
2178
2151
cprover_equivalent_to_java_assign_and_return_function
2179
2152
[" java::org.cprover.CProverString.insert:(Ljava/lang/StringBuilder;ILjava/"
2180
2153
" lang/String;)Ljava/lang/StringBuilder;" ] = ID_cprover_string_insert_func;
2181
- conversion_table
2154
+ cprover_equivalent_to_java_function
2182
2155
[" java::java.lang.StringBuilder.length:()I" ]=
2183
- std::bind (
2184
- &java_string_library_preprocesst::make_string_length_code,
2185
- this ,
2186
- std::placeholders::_1,
2187
- std::placeholders::_2,
2188
- std::placeholders::_3);
2156
+ ID_cprover_string_length_func;
2189
2157
cprover_equivalent_to_java_assign_function
2190
2158
[" java::java.lang.StringBuilder.setCharAt:(IC)V" ]=
2191
2159
ID_cprover_string_char_set_func;
@@ -2283,9 +2251,9 @@ void java_string_library_preprocesst::initialize_conversion_table()
2283
2251
cprover_equivalent_to_java_assign_and_return_function
2284
2252
[" java::org.cprover.CProverString.insert:(Ljava/lang/StringBuffer;IZ)Ljava/"
2285
2253
" lang/StringBuffer;" ] = ID_cprover_string_insert_bool_func;
2286
- conversion_table
2254
+ cprover_equivalent_to_java_function
2287
2255
[" java::java.lang.StringBuffer.length:()I" ]=
2288
- conversion_table[ " java::java.lang.String.length:()I " ] ;
2256
+ ID_cprover_string_length_func ;
2289
2257
cprover_equivalent_to_java_assign_function
2290
2258
[" java::org.cprover.CProverString.setCharAt:(Ljava/lang/String;IC)V" ] =
2291
2259
ID_cprover_string_char_set_func;
0 commit comments