@@ -120,7 +120,7 @@ bool ci_lazy_methodst::operator()(
120
120
}
121
121
122
122
std::unordered_set<irep_idt> methods_already_populated;
123
- std::vector< const code_function_callt *> virtual_callsites ;
123
+ std::unordered_set<exprt, irep_hash> virtual_function_calls ;
124
124
125
125
bool any_new_methods = true ;
126
126
while (any_new_methods)
@@ -147,8 +147,7 @@ bool ci_lazy_methodst::operator()(
147
147
continue ;
148
148
}
149
149
gather_virtual_callsites (
150
- symbol_table.lookup_ref (mname).value ,
151
- virtual_callsites);
150
+ symbol_table.lookup_ref (mname).value , virtual_function_calls);
152
151
any_new_methods=true ;
153
152
}
154
153
}
@@ -157,15 +156,9 @@ bool ci_lazy_methodst::operator()(
157
156
// possible virtual function call targets:
158
157
159
158
debug () << " CI lazy methods: add virtual method targets ("
160
- << virtual_callsites.size ()
161
- << " callsites)"
162
- << eom;
159
+ << virtual_function_calls.size () << " callsites)" << eom;
163
160
164
- std::unordered_set<exprt, irep_hash> unique_functions;
165
- for (const code_function_callt *virtual_callsite : virtual_callsites)
166
- unique_functions.insert (virtual_callsite->function ());
167
-
168
- for (const exprt &function : unique_functions)
161
+ for (const exprt &function : virtual_function_calls)
169
162
{
170
163
// This will also create a stub if a virtual callsite has no targets.
171
164
get_virtual_method_targets (
@@ -375,15 +368,15 @@ void ci_lazy_methodst::initialize_instantiated_classes_from_pointer(
375
368
// / e that calls a virtual function.
376
369
void ci_lazy_methodst::gather_virtual_callsites (
377
370
const exprt &e,
378
- std::vector< const code_function_callt * > &result)
371
+ std::unordered_set<exprt, irep_hash > &result)
379
372
{
380
373
if (e.id ()!=ID_code)
381
374
return ;
382
375
const codet &c=to_code (e);
383
376
if (c.get_statement ()==ID_function_call &&
384
377
to_code_function_call (c).function ().id ()==ID_virtual_function)
385
378
{
386
- result.push_back (& to_code_function_call (c));
379
+ result.insert ( to_code_function_call (c). function ( ));
387
380
}
388
381
else
389
382
{
0 commit comments