[cfe-dev] clang and code coverage?

Douglas Gregor dgregor at apple.com
Mon Aug 30 13:16:48 PDT 2010


On Aug 30, 2010, at 12:27 PM, Sean McBride wrote:

> On Mon, 16 Aug 2010 10:19:04 -0700, Douglas Gregor said:
> 
>>> Is there any way to measure code coverage when using clang?
>>> 
>>> The gcov docs say: "gcov works only on code compiled with GCC."  Is this
>>> true of code built by clang?  Or does clang's "GCC compatibility" design
>>> goal extend to this situation?  If not, does/will the llvm project
>>> include a replacement for gcov?
>> 
>> Neither Clang nor LLVM have the ability to generate coverage code for
>> gcov. I do not know of any replacements in the works.
> 
> Thanks Doug for your reply.
> 
> Is there a bug for this?  I searched but could not find one.  I filed
> <rdar://problem/8107317> after WWDC10 but I'd like to have a bug in the
> public llvm.org database too.

I don't see a bug in Bugzilla for it. 

> As more and more Objective-C features _require_ clang[1], Mac developers
> will be forced to choose between these nice new features and being able
> to measure code coverage.  I'm not looking forward to that choice. :(


The Radar is a way to prod Apple toward implementing this feature, but anyone can do it: implementing gcov-style coverage should be relatively easy in Clang.

	- Doug



More information about the cfe-dev mailing list