Any work on code coverage "add-on" like gcov?

I am wondering if any work is taking place or is possibly planned to
bring code coverage instrumentation to clang (emit code with
instrumentation, ideally robustly dealing with macro expansion). I
believe all of it would/could be done in the front end?

If no work is taking place or planned any opinions on this topic?


As far as I know no work is being done on this.

Adding support for emitting the same kind of instrumentation used by gcov
would probably not be very difficult and seems fairly reasonable. One issue
that may come up here is that gcov is tied fairly tightly, I believe, with the
gcc and libgcc versions. I know this impacts the file format, I’m not sure how
much this impacts the actual instrumentation. I suspect the in memory
instrumentation data structures are tightly coupled to the gcov version, which
complicates configuration and maintenance if you want it to interoperate
seamlessly with the system gcc & gcov.

Of course, designing a separate coverage instrumentation system would also
be a viable approach, but significantly more work…

  • Daniel