You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[mypyc] Make separate=True compilation work for real-world projects (sqlglot)
Backport of the sqlglot-essential separate=True fixes from
release-1.20's separate_flag branch. See SEPARATE_FLAG_NOTES.md for
full details.
1. Non-extension classes never have vtables -- short-circuit
is_method_final to True for them.
2. emit_method_call uses method_decl(name) instead of get_method(name).decl
so cross-group methods (decl-only in caller's group) work.
3. Route cross-group native/wrapper calls through the exports table via
new Emitter.native_function_call / wrapper_function_call helpers;
mark CPyPy_* wrapper declarations needs_export=True.
4. Defer cross-group imports to shim-load time: split exec_<group> into
a self-only capsule setup and a deferred ensure_deps_<group>(). Shim
uses PyImport_ImportModuleLevel with fromlist (no dotted getattr walk)
and PyObject_GetAttrString for capsule fetch (no PyCapsule_Import
walk).
5. Fix broken CPyImport_ImportFrom submodule fallback (was calling
PyObject_GetItem on a module); Py_XDECREF potentially-NULL pointers.
6. Incremental-mode plumbing: compile_modules_to_ir syncs freshly built
ClassIR/FuncIR into deser_ctx; load_type_map tolerates mypy-synthetic
TypeInfos with no mypyc ClassIR.
0 commit comments