Why not have a -staticcov (or -ctcov) flag to dmd that produces
compile time code coverage?
This will work for most code (with the exception of virtual
methods called from a base class -- anything else?): it'll just
produce 1 or 0 depending for each line compiled in, depending on
whether it's reachable from main file.
Likewise, with the recent addition of minimal code coverage for
unittest we could have:
dmd -cov=83 -unittest -main -run std/file.d
dmd -staticcov=83 -unittest -main -run std/file.d
Further enhancements: compile time caller/callee graph.
Thanks for your feedback!