Re: [PATCH 03/10] Move target-dcache out of target.c

Pedro Alves
2013-11-18T15:51:37Z

On 11/17/2013 08:09 PM, Doug Evans wrote:
> [For a later cleanup I would rename stack_cache_enabled() to
> stack_cache_enabled_p(), and rename the underlying variables of
> course. I wouldn't do that in this patch of course since it's good to
> keep the moving of code in a patch onto itself.]

FWIW, _p is necessary to disambiguate cases like:

if (enable_stack_cache ())

Because that's ambiguous --- it can be read as either
a predicate (is it enabled?), or an action (do enable now).

To fix that, you'd usually either rename to:

if (enable_stack_cache_p ())

or

if (stack_cache_enabled ())

"enabled" is already clearly a predicate.

--
Pedro Alves