Add fuzzing coverage support

Bernd Schmidt bschmidt@redhat.com
Wed Dec 2 17:11:00 GMT 2015


On 12/02/2015 05:55 PM, Dmitry Vyukov wrote:
> Can you point to some concrete coding style violations (besides
> function comments)?
>
>   	      (flag_sanitize & (SANITIZE_ADDRESS | SANITIZE_THREAD \
> -				| SANITIZE_UNDEFINED | SANITIZE_NONDEFAULT)))
> +				| SANITIZE_UNDEFINED | SANITIZE_NONDEFAULT) \
> +			|| flag_sanitize_coverage))

The || should line up with the other condition (i.e. the part starting 
with flag_sanitize).

> +unsigned sancov_pass (function *fun)

Split the line after the return type.

> +
> +template<bool O0>
> +class pass_sancov : public gimple_opt_pass
> +{

This seems to be a new idiom but I find it OK. One thing to consider 
would be whether you really need this split between O0/optimize 
versions, or whether you can find a place in the queue where to insert 
it unconditionally. Have you considered this at all or did you just 
follow asan/tsan?

> +public:
> +  static pass_data pd ()
> +  {
> +    static const pass_data data =

I think a static data member would be better than the unnecessary pd () 
function. This is also unlike existing practice, and I wonder how others 
think about it. IMO a fairly strong case could be made that if we're 
using C++, then this sort of thing ought to be part of the class definition.


Bernd



More information about the Gcc-patches mailing list