Skip to content

Commit 34d20fa

Browse files
Antonia LechnerAntonia Lechner
Antonia Lechner
authored and
Antonia Lechner
committed
Remove unused class_identifier parameter
This parameter was only "used" in gen_nondet_struct_init, where it was assigned a new value before it was actually used.
1 parent a139e2a commit 34d20fa

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

jbmc/src/java_bytecode/java_object_factory.cpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ class java_object_factoryt
106106
code_blockt &assignments,
107107
const exprt &expr,
108108
bool is_sub,
109-
irep_idt class_identifier,
110109
bool skip_classid,
111110
lifetimet lifetime,
112111
const optionalt<typet> &override_type,
@@ -132,7 +131,6 @@ class java_object_factoryt
132131
code_blockt &assignments,
133132
const exprt &expr,
134133
bool is_sub,
135-
irep_idt class_identifier,
136134
bool skip_classid,
137135
lifetimet lifetime,
138136
const struct_typet &struct_type,
@@ -262,7 +260,6 @@ void java_object_factoryt::gen_pointer_target_init(
262260
assignments,
263261
init_expr,
264262
false, // is_sub
265-
"", // class_identifier
266263
false, // skip_classid
267264
lifetime,
268265
{}, // no override type
@@ -706,7 +703,6 @@ symbol_exprt java_object_factoryt::gen_nondet_subtype_pointer_init(
706703
assignments,
707704
new_symbol_expr,
708705
false, // is_sub
709-
"", // class_identifier
710706
false, // skip_classid
711707
lifetime,
712708
{}, // no override_type
@@ -754,8 +750,6 @@ alternate_casest get_string_input_values_code(
754750
/// \param expr: Struct-typed lvalue expression to initialize
755751
/// \param is_sub: If true, `expr` is a substructure of a larger object, which
756752
/// in Java necessarily means a base class
757-
/// \param class_identifier: Name of the parent class. Used to initialize the
758-
/// `@class_identifier` among others
759753
/// \param skip_classid: If true, skip initializing `@class_identifier`
760754
/// \param lifetime: Lifetime of the allocated objects (AUTOMATIC_LOCAL,
761755
/// STATIC_GLOBAL, or DYNAMIC)
@@ -771,7 +765,6 @@ void java_object_factoryt::gen_nondet_struct_init(
771765
code_blockt &assignments,
772766
const exprt &expr,
773767
bool is_sub,
774-
irep_idt class_identifier,
775768
bool skip_classid,
776769
lifetimet lifetime,
777770
const struct_typet &struct_type,
@@ -833,8 +826,7 @@ void java_object_factoryt::gen_nondet_struct_init(
833826
// This code mirrors the `remove_java_new` pass:
834827
auto initial_object = zero_initializer(expr.type(), source_locationt(), ns);
835828
CHECK_RETURN(initial_object.has_value());
836-
class_identifier = struct_tag;
837-
const irep_idt qualified_clsid = "java::" + id2string(class_identifier);
829+
const irep_idt qualified_clsid = "java::" + id2string(struct_tag);
838830
set_class_identifier(
839831
to_struct_expr(*initial_object), ns, struct_tag_typet(qualified_clsid));
840832

@@ -903,7 +895,6 @@ void java_object_factoryt::gen_nondet_struct_init(
903895
assignments,
904896
me,
905897
_is_sub,
906-
class_identifier,
907898
false, // skip_classid
908899
lifetime,
909900
{}, // no override_type
@@ -938,9 +929,6 @@ void java_object_factoryt::gen_nondet_struct_init(
938929
/// \param is_sub:
939930
/// If true, `expr` is a substructure of a larger object, which in Java
940931
/// necessarily means a base class.
941-
/// \param class_identifier:
942-
/// Name of the parent class. Used to initialize the `@class_identifier` among
943-
/// others.
944932
/// \param skip_classid:
945933
/// If true, skip initializing `@class_identifier`.
946934
/// \param lifetime:
@@ -965,7 +953,6 @@ void java_object_factoryt::gen_nondet_init(
965953
code_blockt &assignments,
966954
const exprt &expr,
967955
bool is_sub,
968-
irep_idt class_identifier,
969956
bool skip_classid,
970957
lifetimet lifetime,
971958
const optionalt<typet> &override_type,
@@ -1022,7 +1009,6 @@ void java_object_factoryt::gen_nondet_init(
10221009
assignments,
10231010
expr,
10241011
is_sub,
1025-
class_identifier,
10261012
skip_classid,
10271013
lifetime,
10281014
struct_type,
@@ -1245,7 +1231,6 @@ void java_object_factoryt::array_loop_init_code(
12451231
assignments,
12461232
arraycellref,
12471233
false, // is_sub
1248-
irep_idt(), // class_identifier
12491234
false, // skip_classid
12501235
// These are variable in number, so use dynamic allocator:
12511236
lifetimet::DYNAMIC,
@@ -1464,7 +1449,6 @@ exprt object_factory(
14641449
assignments,
14651450
object,
14661451
false, // is_sub
1467-
"", // class_identifier
14681452
false, // skip_classid
14691453
lifetime,
14701454
{}, // no override_type
@@ -1535,7 +1519,6 @@ void gen_nondet_init(
15351519
assignments,
15361520
expr,
15371521
false, // is_sub
1538-
"", // class_identifier
15391522
skip_classid,
15401523
lifetime,
15411524
{}, // no override_type

0 commit comments

Comments
 (0)