[patch][mudflap] Mudflap cleanup

Olatunji Ruwase tjruwase@google.com
Fri Jul 17 21:49:00 GMT 2009


> Hm, what's this?
>
> +  /* Enable pragma redefines. */
> +  targetm.handle_pragma_redefine_extname = true;
> +
>

mudflap requires that pragma redefines be enabled. Asides enabling
it for all targets in target-def.h, I could not think of a way to do this
only for mudflap. I would appreciate any suggestions.

> +/* An SSA expression is eligible for instrumentation if
> +   composed of at least one non-artificial subexpression/var.
> +*/
>
> Closing comment on the previous line.
>

Will fix.

> +    if (ops[i] == NULL_TREE) {
> +      continue;
> +    }
>
> no braces around single-stmt groups (also elsewhere).
>

Will fix everywhere.

> +    else if ((TREE_CODE (ops[i]) == VAR_DECL) && !DECL_ARTIFICIAL (ops[i])) {
> +      return true;
>
> what about PARM_DECLs?
>

mf_ssa_eligible_p helps to avoid instrumenting va_arg INDIRECT_REF. Mudflap
used to mark such refs in build_va_arg_indirect_ref() to avoid instrumentation.
mf_ssa_eligible_p was a way of achieving the same thing in a cleaner way and
it seemed to work well enough for the testsuite, so I didnt push further to
the more general cases that you pointed out.
However, I 'll study this issue further, in particular I find your pre-walk idea
quite attractive.

Thanks for the comments,

tunji



More information about the Gcc-patches mailing list