diff --git a/src/pyjit/pyjit.cpp b/src/pyjit/pyjit.cpp index 14bfc9f4..c69558a1 100644 --- a/src/pyjit/pyjit.cpp +++ b/src/pyjit/pyjit.cpp @@ -49,9 +49,19 @@ namespace xo { /* we're assuming llvm-generated code lives for as long as the Jit * instance that created it. * - * RC 14jun2024 - I think this is true modulo use of llvm resource trackers. + * RC 14jun2024 - I think this is true, modulo use of llvm resource trackers. */ py::return_value_policy::reference_internal) + .def("lookup_dbl_dbl_fn", + [](Jit & jit, const std::string & symbol) { + auto llvm_addr = jit.lookup_symbol(symbol); + + auto fn_addr = llvm_addr.toPtr(); + + return new XferFn(fn_addr); + }) + ; + py::class_>(m, "XferFn") .def("__call__", [](XferFn & self, double x) { return self(x); }