Skip to content

Commit

Permalink
Rename functions to get_recursively_instantiated_type
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Güdemann committed Jun 6, 2018
1 parent b0fde14 commit f6586ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions jbmc/src/java_bytecode/select_pointer_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pointer_typet select_pointer_typet::specialize_generics(
// avoid infinite recursion
if(visited_nodes.find(parameter_name) != visited_nodes.end())
{
optionalt<pointer_typet> result = get_instantiated_type(
optionalt<pointer_typet> result = get_recursively_instantiated_type(
parameter_name, generic_parameter_specialization_map);
if(result.has_value())
{
Expand Down Expand Up @@ -144,7 +144,8 @@ pointer_typet select_pointer_typet::specialize_generics(
/// \param generic_specialization_map Map of type names to specialization stack
/// \return The first instantiated type for the generic type or nothing if no
/// such instantiation exists.
optionalt<pointer_typet> select_pointer_typet::get_instantiated_type(
optionalt<pointer_typet>
select_pointer_typet::get_recursively_instantiated_type(
const irep_idt &parameter_name,
const generic_parameter_specialization_mapt
&generic_parameter_specialization_map) const
Expand All @@ -157,7 +158,7 @@ optionalt<pointer_typet> select_pointer_typet::get_instantiated_type(
irep_idt current_parameter = parameter_name;
while(depth < max)
{
const auto retval = get_instantiated_type(
const auto retval = get_recursively_instantiated_type(
current_parameter, generic_parameter_specialization_map, visited, depth);
if(retval.has_value())
{
Expand All @@ -177,12 +178,13 @@ optionalt<pointer_typet> select_pointer_typet::get_instantiated_type(
return {};
}

/// See get_instantiated_type, the additional parameters just track the
/// recursion to prevent, visiting the same depth again and specify which stack
/// depth is analyzed.
/// See get_recursively instantiated_type, the additional parameters just track
/// the recursion to prevent, visiting the same depth again and specify which
/// stack depth is analyzed.
/// \param visited Tracks the visited parameter names
/// \param depth Stack depth to analyze
optionalt<pointer_typet> select_pointer_typet::get_instantiated_type(
optionalt<pointer_typet>
select_pointer_typet::get_recursively_instantiated_type(
const irep_idt &parameter_name,
const generic_parameter_specialization_mapt
&generic_parameter_specialization_map,
Expand Down Expand Up @@ -220,7 +222,7 @@ optionalt<pointer_typet> select_pointer_typet::get_instantiated_type(

visited.insert(parameter_name);
const auto &gen_type = to_java_generic_parameter(type).type_variable();
const auto inst_val = get_instantiated_type(
const auto inst_val = get_recursively_instantiated_type(
gen_type.get_identifier(),
generic_parameter_specialization_map,
visited,
Expand Down
4 changes: 2 additions & 2 deletions jbmc/src/java_bytecode/select_pointer_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class namespacet;

class select_pointer_typet
{
optionalt<pointer_typet> get_instantiated_type(
optionalt<pointer_typet> get_recursively_instantiated_type(
const irep_idt &,
const generic_parameter_specialization_mapt &,
generic_parameter_recursion_trackingt &,
const size_t) const;
optionalt<pointer_typet> get_instantiated_type(
optionalt<pointer_typet> get_recursively_instantiated_type(
const irep_idt &parameter_name,
const generic_parameter_specialization_mapt &) const;

Expand Down

0 comments on commit f6586ed

Please sign in to comment.