Skip to content

Commit e8cbf90

Browse files
author
thk123
committed
Adding wrappers around whether a code_type is a constructor
1 parent e5ff31f commit e8cbf90

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/java_bytecode/java_bytecode_convert_method.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ void java_bytecode_convert_method_lazy(
346346
method_symbol.pretty_name=
347347
id2string(class_symbol.pretty_name)+"."+
348348
id2string(class_symbol.base_name)+"()";
349-
member_type.set(ID_constructor, true);
349+
member_type.set_is_constructor();
350350
}
351351
else
352352
method_symbol.pretty_name=
@@ -538,7 +538,7 @@ void java_bytecode_convert_methodt::convert(
538538
method_symbol.pretty_name = id2string(class_symbol.pretty_name) + "." +
539539
id2string(class_symbol.base_name) + "()";
540540
INVARIANT(
541-
member_type.get_bool(ID_constructor),
541+
code_type.get_is_constructor(),
542542
"Member type should have already been marked as a constructor");
543543
}
544544
else
@@ -1271,7 +1271,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
12711271
{
12721272
if(needed_lazy_methods)
12731273
needed_lazy_methods->add_needed_class(classname);
1274-
code_type.set(ID_constructor, true);
1274+
code_type.set_is_constructor();
12751275
}
12761276
else
12771277
code_type.set(ID_java_super_method_call, true);

src/util/std_types.h

+10
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,16 @@ class code_typet:public typet
889889
return set(ID_access, access);
890890
}
891891

892+
bool get_is_constructor() const
893+
{
894+
return get_bool(ID_constructor);
895+
}
896+
897+
void set_is_constructor()
898+
{
899+
set(ID_constructor, true);
900+
}
901+
892902
// this produces the list of parameter identifiers
893903
std::vector<irep_idt> parameter_identifiers() const
894904
{

0 commit comments

Comments
 (0)