Skip to content

Commit 9c4be0f

Browse files
Remove unused functions
1 parent d0acccb commit 9c4be0f

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
{
@@ -584,26 +572,6 @@ exprt java_string_library_preprocesst::allocate_fresh_string(
584572
return str;
585573
}
586574

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

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-
18181740
/// Generates code for the String.length method
18191741
/// \param type: type of the function
18201742
/// \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)