Seven-Streams opened a new pull request, #721:
URL: https://github.com/apache/tvm-ffi/pull/721

   The reflected field table can't express two facts a binding generator needs: 
whether a class can ever gain a subtype, and whether it carries a vptr. Every 
ObjectDef<Class> now registers them as type attributes:
   
   - __ffi_type_final__ — Class::_type_final; a final class admits no subtype, 
so a generator may store it by value.
   - __ffi_type_polymorphic__ — std::is_polymorphic_v<Class>; a polymorphic 
class has a vptr that no reflected field describes, so its layout is not 
reproducible from the fields alone.
   
   ObjectInfo surfaces them as is_final / is_polymorphic, which are None for 
types registered without an ObjectDef (e.g. ffi.Object) — a registered False 
stays distinguishable from "never published".
   
   Testing — tests/cpp/test_reflection.cc and tests/python/test_stubgen.py 
cover the four cases: non-final/non-polymorphic, final-only, final + 
polymorphic (ffi.Module), and unregistered (ffi.Object).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to