Skip to content

Commit 40faaa7

Browse files
Remove unused functions
1 parent ac4175c commit 40faaa7

File tree

2 files changed

+0
-98
lines changed

2 files changed

+0
-98
lines changed

jbmc/src/java_bytecode/java_string_library_preprocess.cpp

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,6 @@ bool java_string_library_preprocesst::is_java_char_array_pointer_type(
168168
return false;
169169
}
170170

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-
183171
/// \return the type of the length field in java Strings.
184172
typet string_length_type()
185173
{
@@ -585,26 +573,6 @@ exprt java_string_library_preprocesst::allocate_fresh_string(
585573
return str;
586574
}
587575

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-
608576
/// assign the result of a function call
609577
/// \param lhs: an expression
610578
/// \param function_name: the name of the function
@@ -1770,52 +1738,6 @@ codet java_string_library_preprocesst::make_copy_constructor_code(
17701738
return code;
17711739
}
17721740

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-
18191741
/// Generates code for the String.length method
18201742
/// \param type: type of the function
18211743
/// \param loc: location in the source

jbmc/src/java_bytecode/java_string_library_preprocess.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class java_string_library_preprocesst:public messaget
4343

4444
void initialize_known_type_table();
4545
void initialize_conversion_table();
46-
void initialize_refined_string_type();
4746

4847
bool implements_function(const irep_idt &function_id) const;
4948
void get_all_function_names(std::unordered_set<irep_idt> &methods) const;
@@ -157,12 +156,6 @@ class java_string_library_preprocesst:public messaget
157156
const irep_idt &function_id,
158157
symbol_table_baset &symbol_table);
159158

160-
codet make_string_to_char_array_code(
161-
const code_typet &type,
162-
const source_locationt &loc,
163-
const irep_idt &function_id,
164-
symbol_tablet &symbol_table);
165-
166159
codet make_string_format_code(
167160
const code_typet &type,
168161
const source_locationt &loc,
@@ -260,13 +253,6 @@ class java_string_library_preprocesst:public messaget
260253
symbol_table_baset &symbol_table,
261254
code_blockt &code);
262255

263-
exprt allocate_fresh_array(
264-
const typet &type,
265-
const source_locationt &loc,
266-
const irep_idt &function_id,
267-
symbol_tablet &symbol_table,
268-
code_blockt &code);
269-
270256
codet code_return_function_application(
271257
const irep_idt &function_name,
272258
const exprt::operandst &arguments,
@@ -352,12 +338,6 @@ class java_string_library_preprocesst:public messaget
352338
code_blockt &code);
353339

354340
exprt get_object_at_index(const exprt &argv, std::size_t index);
355-
356-
codet make_init_from_array_code(
357-
const code_typet &type,
358-
const source_locationt &loc,
359-
const irep_idt &function_id,
360-
symbol_table_baset &symbol_table);
361341
};
362342

363343
exprt make_nondet_infinite_char_array(

0 commit comments

Comments
 (0)