@@ -34,7 +34,7 @@ ci_lazy_methodst::ci_lazy_methodst(
34
34
const symbol_tablet &symbol_table,
35
35
const irep_idt &main_class,
36
36
const std::vector<irep_idt> &main_jar_classes,
37
- const std::vector<irep_idt > &lazy_methods_extra_entry_points,
37
+ const std::vector<load_extra_methodst > &lazy_methods_extra_entry_points,
38
38
java_class_loadert &java_class_loader,
39
39
const std::vector<irep_idt> &extra_instantiated_classes,
40
40
const select_pointer_typet &pointer_type_selector,
@@ -103,8 +103,13 @@ bool ci_lazy_methodst::operator()(
103
103
104
104
// Add any extra entry points specified; we should elaborate these in the
105
105
// same way as the main function.
106
- std::vector<irep_idt> extra_entry_points=lazy_methods_extra_entry_points;
107
- resolve_method_names (extra_entry_points, symbol_table);
106
+ std::vector<irep_idt> extra_entry_points;
107
+ for (const auto &extra_function_generator : lazy_methods_extra_entry_points)
108
+ {
109
+ const auto &extra_methods = extra_function_generator (symbol_table);
110
+ extra_entry_points.insert (
111
+ extra_entry_points.end (), extra_methods.begin (), extra_methods.end ());
112
+ }
108
113
methods_to_convert_later.insert (
109
114
extra_entry_points.begin (), extra_entry_points.end ());
110
115
@@ -355,54 +360,6 @@ ci_lazy_methodst::entry_point_methods(const symbol_tablet &symbol_table)
355
360
return methods_to_convert_later;
356
361
}
357
362
358
- // / Translates the given list of method names from human-readable to
359
- // / internal syntax.
360
- // / Expands any wildcards (entries ending in '.*') in the given method
361
- // / list to include all non-static methods defined on the given class.
362
- // / \param [in, out] methods: List of methods to expand. Any wildcard entries
363
- // / will be deleted and the expanded entries appended to the end.
364
- // / \param symbol_table: global symbol table
365
- void ci_lazy_methodst::resolve_method_names (
366
- std::vector<irep_idt> &methods,
367
- const symbol_tablet &symbol_table)
368
- {
369
- std::vector<irep_idt> new_methods;
370
- for (const irep_idt &method : methods)
371
- {
372
- const std::string &method_str=id2string (method);
373
- if (!has_suffix (method_str, " .*" ))
374
- {
375
- std::string error_message;
376
- irep_idt internal_name=
377
- resolve_friendly_method_name (
378
- method_str,
379
- symbol_table,
380
- error_message);
381
- if (internal_name==irep_idt ())
382
- throw " entry point " +error_message;
383
- new_methods.push_back (internal_name);
384
- }
385
- else
386
- {
387
- irep_idt classname=" java::" +method_str.substr (0 , method_str.length ()-2 );
388
- if (!symbol_table.has_symbol (classname))
389
- throw " wildcard entry point '" +method_str+" ': unknown class" ;
390
-
391
- for (const auto &name_symbol : symbol_table.symbols )
392
- {
393
- if (name_symbol.second .type .id ()!=ID_code)
394
- continue ;
395
- if (!to_code_type (name_symbol.second .type ).has_this ())
396
- continue ;
397
- if (has_prefix (id2string (name_symbol.first ), id2string (classname)))
398
- new_methods.push_back (name_symbol.first );
399
- }
400
- }
401
- }
402
-
403
- methods=std::move (new_methods);
404
- }
405
-
406
363
// / Build up a list of methods whose type may be passed around reachable
407
364
// / from the entry point.
408
365
// / \param entry_points: list of fully-qualified function names that
0 commit comments