This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 03/10] Move target-dcache out of target.c
- From: Pedro Alves <palves at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Yao Qi <yao at codesourcery dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Mon, 18 Nov 2013 15:51:25 +0000
- Subject: Re: [PATCH 03/10] Move target-dcache out of target.c
- Authentication-results: sourceware.org; auth=none
- References: <1383458049-20893-1-git-send-email-yao at codesourcery dot com> <1383458049-20893-4-git-send-email-yao at codesourcery dot com> <CADPb22TvCyO2coLto6xHHT2eUYrhBeb1tg9k27XTNRKjuNcJjw at mail dot gmail dot com>
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