Skip to content

Commit 607df45

Browse files
authored
Merge pull request diffblue#4506 from antlechner/antonia/class-identifier-param
Remove unused class_identifier parameter from Java object factory
2 parents 6c46e2c + b97b80a commit 607df45

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

jbmc/src/java_bytecode/java_object_factory.cpp

Lines changed: 3 additions & 19 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,10 +826,10 @@ 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);
838829
set_class_identifier(
839-
to_struct_expr(*initial_object), ns, struct_tag_typet(qualified_clsid));
830+
to_struct_expr(*initial_object),
831+
ns,
832+
struct_tag_typet("java::" + id2string(struct_tag)));
840833

841834
// If the initialised type is a special-cased String type (one with length
842835
// and data fields introduced by string-library preprocessing), initialise
@@ -903,7 +896,6 @@ void java_object_factoryt::gen_nondet_struct_init(
903896
assignments,
904897
me,
905898
_is_sub,
906-
class_identifier,
907899
false, // skip_classid
908900
lifetime,
909901
{}, // no override_type
@@ -938,9 +930,6 @@ void java_object_factoryt::gen_nondet_struct_init(
938930
/// \param is_sub:
939931
/// If true, `expr` is a substructure of a larger object, which in Java
940932
/// necessarily means a base class.
941-
/// \param class_identifier:
942-
/// Name of the parent class. Used to initialize the `@class_identifier` among
943-
/// others.
944933
/// \param skip_classid:
945934
/// If true, skip initializing `@class_identifier`.
946935
/// \param lifetime:
@@ -965,7 +954,6 @@ void java_object_factoryt::gen_nondet_init(
965954
code_blockt &assignments,
966955
const exprt &expr,
967956
bool is_sub,
968-
irep_idt class_identifier,
969957
bool skip_classid,
970958
lifetimet lifetime,
971959
const optionalt<typet> &override_type,
@@ -1022,7 +1010,6 @@ void java_object_factoryt::gen_nondet_init(
10221010
assignments,
10231011
expr,
10241012
is_sub,
1025-
class_identifier,
10261013
skip_classid,
10271014
lifetime,
10281015
struct_type,
@@ -1245,7 +1232,6 @@ void java_object_factoryt::array_loop_init_code(
12451232
assignments,
12461233
arraycellref,
12471234
false, // is_sub
1248-
irep_idt(), // class_identifier
12491235
false, // skip_classid
12501236
// These are variable in number, so use dynamic allocator:
12511237
lifetimet::DYNAMIC,
@@ -1464,7 +1450,6 @@ exprt object_factory(
14641450
assignments,
14651451
object,
14661452
false, // is_sub
1467-
"", // class_identifier
14681453
false, // skip_classid
14691454
lifetime,
14701455
{}, // no override_type
@@ -1535,7 +1520,6 @@ void gen_nondet_init(
15351520
assignments,
15361521
expr,
15371522
false, // is_sub
1538-
"", // class_identifier
15391523
skip_classid,
15401524
lifetime,
15411525
{}, // no override_type

0 commit comments

Comments
 (0)