@@ -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
{
@@ -585,26 +573,6 @@ exprt java_string_library_preprocesst::allocate_fresh_string(
585
573
return str;
586
574
}
587
575
588
- // / declare a new character array and allocate it
589
- // / \param type: a type for string
590
- // / \param loc: a location in the program
591
- // / \param symbol_table: symbol table
592
- // / \param code: code block to which allocation instruction will be added
593
- // / \return a new array
594
- exprt java_string_library_preprocesst::allocate_fresh_array (
595
- const typet &type,
596
- const source_locationt &loc,
597
- const irep_idt &function_id,
598
- symbol_tablet &symbol_table,
599
- code_blockt &code)
600
- {
601
- exprt array=fresh_array (type, loc, symbol_table);
602
- code.add (code_declt (array), loc);
603
- allocate_dynamic_object_with_decl (
604
- array, symbol_table, loc, function_id, code);
605
- return array;
606
- }
607
-
608
576
// / assign the result of a function call
609
577
// / \param lhs: an expression
610
578
// / \param function_name: the name of the function
@@ -1770,52 +1738,6 @@ codet java_string_library_preprocesst::make_copy_constructor_code(
1770
1738
return code;
1771
1739
}
1772
1740
1773
- // / Used to provide code for constructor from a char array.
1774
- // / The implementation is similar to substring except the 3rd argument is a
1775
- // / count instead of end index
1776
- // / \param type: type of the function call
1777
- // / \param loc: location in the program_invocation_name
1778
- // / \param symbol_table: symbol table
1779
- // / \return code implementing String intitialization from a char array and
1780
- // / arguments offset and end.
1781
- codet java_string_library_preprocesst::make_init_from_array_code (
1782
- const code_typet &type,
1783
- const source_locationt &loc,
1784
- const irep_idt &function_id,
1785
- symbol_table_baset &symbol_table)
1786
- {
1787
- // Code for the output
1788
- code_blockt code;
1789
-
1790
- code_typet::parameterst params = type.parameters ();
1791
- PRECONDITION (params.size () == 4 );
1792
- exprt::operandst args =
1793
- process_parameters (type.parameters (), loc, symbol_table, code);
1794
- INVARIANT (
1795
- args.size () == 4 , " process_parameters preserves number of arguments" );
1796
-
1797
- // / \todo this assumes the array to be constant between all calls to
1798
- // / string primitives, which may not be true in general.
1799
- refined_string_exprt string_arg = to_string_expr (args[1 ]);
1800
-
1801
- // The third argument is `count`, whereas the third argument of substring
1802
- // is `end` which corresponds to `offset+count`
1803
- refined_string_exprt string_expr = string_expr_of_function (
1804
- ID_cprover_string_substring_func,
1805
- {args[1 ], args[2 ], plus_exprt (args[2 ], args[3 ])},
1806
- loc,
1807
- symbol_table,
1808
- code);
1809
-
1810
- // Assign string_expr to `this` object
1811
- symbol_exprt arg_this (params[0 ].get_identifier (), params[0 ].type ());
1812
- code.add (
1813
- code_assign_string_expr_to_java_string (arg_this, string_expr, symbol_table),
1814
- loc);
1815
-
1816
- return code;
1817
- }
1818
-
1819
1741
// / Generates code for the String.length method
1820
1742
// / \param type: type of the function
1821
1743
// / \param loc: location in the source
0 commit comments