Skip to content

Commit 945f885

Browse files
author
Owen Jones
committed
Rename two variables and make one more local
1 parent b7d70e7 commit 945f885

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

src/java_bytecode/ci_lazy_methods.cpp

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ bool ci_lazy_methodst::operator()(
7272
method_bytecodet &method_bytecode,
7373
const method_convertert &method_converter)
7474
{
75-
std::vector<irep_idt> method_worklist1;
76-
std::vector<irep_idt> method_worklist2;
75+
std::vector<irep_idt> methods_to_convert_later;
7776

7877
main_function_resultt main_function =
7978
get_main_symbol(symbol_table, main_class, get_message_handler());
@@ -95,19 +94,19 @@ bool ci_lazy_methodst::operator()(
9594
const irep_idt methodid =
9695
"java::" + id2string(class_name) + "." + id2string(method.name)
9796
+ ":" + id2string(method.descriptor);
98-
method_worklist2.push_back(methodid);
97+
methods_to_convert_later.push_back(methodid);
9998
}
10099
}
101100
}
102101
else
103-
method_worklist2.push_back(main_function.main_function.name);
102+
methods_to_convert_later.push_back(main_function.main_function.name);
104103

105104
// Add any extra entry points specified; we should elaborate these in the
106105
// same way as the main function.
107106
std::vector<irep_idt> extra_entry_points=lazy_methods_extra_entry_points;
108107
resolve_method_names(extra_entry_points, symbol_table);
109-
method_worklist2.insert(
110-
method_worklist2.begin(),
108+
methods_to_convert_later.insert(
109+
methods_to_convert_later.begin(),
111110
extra_entry_points.begin(),
112111
extra_entry_points.end());
113112

@@ -120,11 +119,9 @@ bool ci_lazy_methodst::operator()(
120119
instantiated_classes,
121120
symbol_table);
122121
initialize_instantiated_classes(
123-
method_worklist2,
124-
namespacet(symbol_table),
125-
initial_lazy_methods);
126-
method_worklist2.insert(
127-
method_worklist2.end(),
122+
methods_to_convert_later, namespacet(symbol_table), initial_lazy_methods);
123+
methods_to_convert_later.insert(
124+
methods_to_convert_later.end(),
128125
initial_callable_methods.begin(),
129126
initial_callable_methods.end());
130127
}
@@ -136,21 +133,22 @@ bool ci_lazy_methodst::operator()(
136133
while(any_new_methods)
137134
{
138135
any_new_methods=false;
139-
while(!method_worklist2.empty())
136+
while(!methods_to_convert_later.empty())
140137
{
141-
std::swap(method_worklist1, method_worklist2);
142-
for(const auto &mname : method_worklist1)
138+
std::vector<irep_idt> methods_to_convert;
139+
std::swap(methods_to_convert, methods_to_convert_later);
140+
for(const auto &mname : methods_to_convert)
143141
{
144142
if(!methods_already_populated.insert(mname).second)
145143
continue;
146144
debug() << "CI lazy methods: elaborate " << mname << eom;
147145
if(
148146
method_converter(
149147
mname,
150-
// Note this wraps *references* to method_worklist2 &
148+
// Note this wraps *references* to methods_to_convert_later &
151149
// instantiated_classes
152150
ci_lazy_methods_neededt(
153-
method_worklist2, instantiated_classes, symbol_table)))
151+
methods_to_convert_later, instantiated_classes, symbol_table)))
154152
{
155153
// Couldn't convert this function
156154
continue;
@@ -160,7 +158,6 @@ bool ci_lazy_methodst::operator()(
160158
virtual_callsites);
161159
any_new_methods=true;
162160
}
163-
method_worklist1.clear();
164161
}
165162

166163
// Given the object types we now know may be created, populate more
@@ -179,7 +176,7 @@ bool ci_lazy_methodst::operator()(
179176
{
180177
// This will also create a stub if a virtual callsite has no targets.
181178
get_virtual_method_targets(
182-
function, instantiated_classes, method_worklist2, symbol_table);
179+
function, instantiated_classes, methods_to_convert_later, symbol_table);
183180
}
184181
}
185182

0 commit comments

Comments
 (0)