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
Right now the (last?) major blocker for many complex C++ libraries lies in incorrect forward and circular referencing errors, caused by how DMD's semantic phases are currently designed. Those phases are too "catchall" and for example calling dsym.semantic() when all the caller wants to know is if the dsym symbol has a member named "foo" creates dependencies between symbols that may result in wrong forward/circular referencing errors.
I will fix a few more Calypso-specific issues, and then will start working on this again. I had a first shot at this last year: dlang/dmd#7018 but will soon restart from scratch from current DMD master.
It will consist in splitting importAll/semanticN functions into smaller blocks, and making DMD semantic analysis lazier especially for non-root modules (the ones not being codegen'd). The latter will also help against another Calypso issue which is the recursive instantiation of templates due to C++ being completely lazy whereas D isn't. For example the libstdc++/valarray.d test case fails because of recursive instantiation. Others would if there wasn't a RecursiveInstChecker semi-hack that detects simple cases of recursive recursions and discard the declarations, but discarding is pretty bad.
The text was updated successfully, but these errors were encountered:
I suppose those fwd reference errors are what leads to messages such as:
../xdr/Stellar-SCP.h(611): Error: size of type .ℂcpp.xdr.xvector.xvector!(SCPQuorumSet, 4294967292u) is not known
../xdr/Stellar-SCP.h(611): Error: size of type .ℂcpp.xdr.xvector.xvector!(SCPQuorumSet, 4294967292u) is not known
../xdr/Stellar-SCP.h(611): Error: size of type .ℂcpp.xdr.xvector.xvector!(SCPQuorumSet, 4294967292u) is not known
../xdr/Stellar-SCP.h(611): Error: size of type .ℂcpp.xdr.xvector.xvector!(SCPQuorumSet, 4294967292u) is not known
…n .search()ed from D code.
In addition:
- Skip all semantic analysis, mapped decls are "semantic3done" straightaway.
- Referenced C++ declarations (by DeclReferencer) that need to get emitted aren't mapped to DMD declarations, the Clang declarations are simply attached to the instantiating module or function, until they're searched from D code in which case they get detached and mapped to DMD decls.
This is the most promising approach to fix Calypso's "archnemesis issue" #105, as it relieves DMD from a lot of stress.
As later commits prove, it worked(!) and drastically reduces build times.
Right now the (last?) major blocker for many complex C++ libraries lies in incorrect forward and circular referencing errors, caused by how DMD's semantic phases are currently designed. Those phases are too "catchall" and for example calling
dsym.semantic()
when all the caller wants to know is if thedsym
symbol has a member named "foo" creates dependencies between symbols that may result in wrong forward/circular referencing errors.The qt5demo example just got updated to not rely on module map files (which will be replaced by a
pragma(cppmap)
parameter like proposed in https://github.com/Syniurge/Calypso/blob/documentation/calypso_proposal_pragma.md), but doesn't compile anymore because it triggers a circular referencing error within a Qt module.I will fix a few more Calypso-specific issues, and then will start working on this again. I had a first shot at this last year: dlang/dmd#7018 but will soon restart from scratch from current DMD master.
It will consist in splitting
importAll/semanticN
functions into smaller blocks, and making DMD semantic analysis lazier especially for non-root modules (the ones not being codegen'd). The latter will also help against another Calypso issue which is the recursive instantiation of templates due to C++ being completely lazy whereas D isn't. For example the libstdc++/valarray.d test case fails because of recursive instantiation. Others would if there wasn't aRecursiveInstChecker
semi-hack that detects simple cases of recursive recursions and discard the declarations, but discarding is pretty bad.The text was updated successfully, but these errors were encountered: