1
0
mirror of https://github.com/YosysHQ/nextpnr.git synced 2026-04-26 12:17:01 +00:00

Progress on new wrapper system

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah
2018-07-02 15:29:58 +02:00
parent 65195513eb
commit 4bc12f2ead
3 changed files with 44 additions and 31 deletions

View File

@@ -123,7 +123,6 @@ BOOST_PYTHON_MODULE(MODULE_NAME)
.def(self == self);
arch_wrap_python();
class_<Context, Context *, bases<Arch>, boost::noncopyable>("Context", no_init).def("checksum", &Context::checksum);
}
static wchar_t *program;

View File

@@ -122,7 +122,9 @@ template <typename Class, typename FuncT, FuncT fn, typename rv_conv, typename a
static conv_result_type wrapped_fn(class_type &cls, conv_arg1_type arg1)
{
return rv_conv()(get_base(cls).ctx, get_base(cls).*fn(arg1_conv()(get_ctx(cls), arg1)));
Context *ctx = get_ctx<Class>(cls);
Class &base = get_base<Class>(cls);
return rv_conv()(ctx, (base.*fn)(arg1_conv()(ctx, arg1)));
}
template <typename WrapCls> static void def_wrap(WrapCls cls_, const char *name) { cls_.def(name, wrapped_fn); }