Skip to content

Commit

Permalink
Adding wrappers around whether a code_type is a constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
thk123 committed Mar 9, 2018
1 parent e5ff31f commit e8cbf90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/java_bytecode/java_bytecode_convert_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void java_bytecode_convert_method_lazy(
method_symbol.pretty_name=
id2string(class_symbol.pretty_name)+"."+
id2string(class_symbol.base_name)+"()";
member_type.set(ID_constructor, true);
member_type.set_is_constructor();
}
else
method_symbol.pretty_name=
Expand Down Expand Up @@ -538,7 +538,7 @@ void java_bytecode_convert_methodt::convert(
method_symbol.pretty_name = id2string(class_symbol.pretty_name) + "." +
id2string(class_symbol.base_name) + "()";
INVARIANT(
member_type.get_bool(ID_constructor),
code_type.get_is_constructor(),
"Member type should have already been marked as a constructor");
}
else
Expand Down Expand Up @@ -1271,7 +1271,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
{
if(needed_lazy_methods)
needed_lazy_methods->add_needed_class(classname);
code_type.set(ID_constructor, true);
code_type.set_is_constructor();
}
else
code_type.set(ID_java_super_method_call, true);
Expand Down
10 changes: 10 additions & 0 deletions src/util/std_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,16 @@ class code_typet:public typet
return set(ID_access, access);
}

bool get_is_constructor() const
{
return get_bool(ID_constructor);
}

void set_is_constructor()
{
set(ID_constructor, true);
}

// this produces the list of parameter identifiers
std::vector<irep_idt> parameter_identifiers() const
{
Expand Down

0 comments on commit e8cbf90

Please sign in to comment.