-
-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ classes need TypeInfo #4779
Comments
Class TypeInfos are emitted into their owning module/object file only, not on-demand in every referencing object file as other TypeInfos (and later uniqued during linking). So if the owning module is compiled with We could change this behavior, although the You'd need duplicates in every referencing object file. |
I was thinking that for C++ classes/interfaces they'll just nullify out since they may not be needed or appropriate to have. |
Oh, druntime does need those D TypeInfos for |
AA's, down casting and destructor calling by GC. All things I don't need. If it is a binding which never gets compiled in it wouldn't need that either. |
I've finally got around to using C++ classes in -betterC cross the shared library boundary.
As of ldc 1.38.0, what I've found is that the TypeInfo/Interface do not get emitted (expected) from within the shared library.
However, on the executable side that is full D, it'll error given that it doesn't exist.
I have not had this as an issue for any other TypeInfo.
I was not able to use my usual tricks via inline assembly to emit the data due to LLVM's type checking (I really wish I had a way to disable that for a symbol).
In the end, the workaround I came up with was to template the entire class hierarchy (not good).
On that note, wouldn't the external path switch have helped here? Since if it was external, it may not have been compiled by the D compiler.
The text was updated successfully, but these errors were encountered: