File tree 3 files changed +24
-7
lines changed
3 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ void java_bytecode_languaget::get_language_options(const cmdlinet &cmd)
123
123
extra_entry_points.end (),
124
124
std::back_inserter (extra_methods),
125
125
build_load_method_by_regex);
126
+ const auto &new_points = build_extra_entry_points (cmd);
127
+ extra_methods.insert (
128
+ extra_methods.end (), new_points.begin (), new_points.end ());
126
129
127
130
if (cmd.isset (" java-cp-include-files" ))
128
131
{
@@ -1207,3 +1210,13 @@ bool java_bytecode_languaget::to_expr(
1207
1210
java_bytecode_languaget::~java_bytecode_languaget ()
1208
1211
{
1209
1212
}
1213
+
1214
+ // / This method should be overloaded to provide alternative approaches for
1215
+ // / specifying extra entry points. To provide a regex entry point, the command
1216
+ // / line option `--lazy-methods-extra-entry-point` can be used directly.
1217
+ std::vector<load_extra_methodst>
1218
+ java_bytecode_languaget::build_extra_entry_points (
1219
+ const cmdlinet &command_line) const
1220
+ {
1221
+ return {};
1222
+ }
Original file line number Diff line number Diff line change @@ -199,6 +199,8 @@ class java_bytecode_languaget:public languaget
199
199
std::vector<irep_idt> java_load_classes;
200
200
201
201
private:
202
+ virtual std::vector<load_extra_methodst>
203
+ build_extra_entry_points (const cmdlinet &command_line) const ;
202
204
const std::unique_ptr<const select_pointer_typet> pointer_type_selector;
203
205
204
206
// / Maps synthetic method names on to the particular type of synthetic method
Original file line number Diff line number Diff line change @@ -453,31 +453,33 @@ class java_generic_typet:public reference_typet
453
453
}
454
454
};
455
455
456
+ template <>
457
+ inline bool can_cast_type<java_generic_typet>(const typet &type)
458
+ {
459
+ return is_reference (type) && type.get_bool (ID_C_java_generic_type);
460
+ }
461
+
456
462
// / \param type: the type to check
457
463
// / \return true if type is java type containing with generics, e.g., List<T>
458
464
inline bool is_java_generic_type (const typet &type)
459
465
{
460
- return type. get_bool (ID_C_java_generic_type );
466
+ return can_cast_type<java_generic_typet>(type );
461
467
}
462
468
463
469
// / \param type: source type
464
470
// / \return cast of type into java type with generics
465
471
inline const java_generic_typet &to_java_generic_type (
466
472
const typet &type)
467
473
{
468
- PRECONDITION (
469
- type.id ()==ID_pointer &&
470
- is_java_generic_type (type));
474
+ PRECONDITION (can_cast_type<java_generic_typet>(type));
471
475
return static_cast <const java_generic_typet &>(type);
472
476
}
473
477
474
478
// / \param type: source type
475
479
// / \return cast of type into java type with generics
476
480
inline java_generic_typet &to_java_generic_type (typet &type)
477
481
{
478
- PRECONDITION (
479
- type.id ()==ID_pointer &&
480
- is_java_generic_type (type));
482
+ PRECONDITION (can_cast_type<java_generic_typet>(type));
481
483
return static_cast <java_generic_typet &>(type);
482
484
}
483
485
You can’t perform that action at this time.
0 commit comments