This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [pph] Prepare for mutation detection [2/3] (issue5142049)
On Wed, Sep 28, 2011 at 5:31 PM, Diego Novillo <dnovillo@google.com> wrote:
> On Wed, Sep 28, 2011 at 17:23, Gabriel Charette <gcharette1@gmail.com> wrote:
>> More comments to come on [3/3], for now just a single comment below on
>> this specific patch:
>>
>>> diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c
>>> index 0bd4d64..b267833 100644
>>> --- a/gcc/cp/pph-streamer-in.c
>>> +++ b/gcc/cp/pph-streamer-in.c
>>> @@ -439,7 +439,10 @@ pph_in_cxx_binding_1 (pph_stream *stream)
>>> Â if (marker == PPH_RECORD_END)
>>> Â Â return NULL;
>>> Â else if (pph_is_reference_marker (marker))
>>> - Â Âreturn (cxx_binding *) pph_cache_get (&stream->cache, image_ix, ix, marker);
>>> + Â Â{
>>> + Â Â Âpph_cache *cache = pph_cache_select (stream, marker, image_ix);
>>> + Â Â Âreturn (cxx_binding *) pph_cache_get (cache, ix);
>>> + Â Â}
>>
>> Seems like you replaced the pph_cache_get one liners with these
>> two-liners. Wouldn't a simple inline function be nicer for this?
>
> I call them separately. ÂOr do you mean a single call that combines
> them for the common case?
>
Yes that's what I mean, a single call that combines both, since that's
the common usage and I feel there should be as little cache code at
the top of every pph_* function (in particular, every time a new pph
streaming function is added all that code needs to be "duplicated", so
the less code the better imo).