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