Skip to content

Commit c1bc380

Browse files
author
thk123
committed
Expose a way for derived languages to specify additional entry points
Lazy methods can be extened to load additional methods as entry points. This allows this to be meaningfully used by subclasses of java_bytecode_language
1 parent 141503e commit c1bc380

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

jbmc/src/java_bytecode/java_bytecode_language.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ void java_bytecode_languaget::get_language_options(const cmdlinet &cmd)
123123
extra_entry_points.end(),
124124
std::back_inserter(extra_methods),
125125
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());
126129

127130
if(cmd.isset("java-cp-include-files"))
128131
{
@@ -1207,3 +1210,13 @@ bool java_bytecode_languaget::to_expr(
12071210
java_bytecode_languaget::~java_bytecode_languaget()
12081211
{
12091212
}
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+
}

jbmc/src/java_bytecode/java_bytecode_language.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ class java_bytecode_languaget:public languaget
199199
std::vector<irep_idt> java_load_classes;
200200

201201
private:
202+
virtual std::vector<load_extra_methodst>
203+
build_extra_entry_points(const cmdlinet &command_line) const;
202204
const std::unique_ptr<const select_pointer_typet> pointer_type_selector;
203205

204206
/// Maps synthetic method names on to the particular type of synthetic method

0 commit comments

Comments
 (0)