[PATCH] Refactor coverage.c, outline the construction of gcov constructor

Carrot Wei carrot@google.com
Sat May 4 04:27:00 GMT 2013


commited as 198591.

On Fri, May 3, 2013 at 11:51 AM, Xinliang David Li <davidxl@google.com> wrote:
> Please do what Richard suggested. gcov_info_type can be obtained from
> gcov_info_var decl.
>
> David
>
>
> On Fri, May 3, 2013 at 11:31 AM, Carrot Wei <carrot@google.com> wrote:
>> On Fri, May 3, 2013 at 1:03 AM, Richard Biener
>> <richard.guenther@gmail.com> wrote:
>>> On Thu, May 2, 2013 at 10:41 PM, Carrot Wei <carrot@google.com> wrote:
>>>> This patch outline the construction of gcov constructor from coverage_obj_init
>>>> as a separate function build_init_ctor.
>>>>
>>>> It passed bootstrap and regression test on x86-64.
>>>>
>>>> OK for trunk and google 4.7 branch?
>>>
>>> Please pass gcov_info_type as parameter to build_init_ctor to avoid
>>> the new GC root.
>>
>> Pass gcov_info_type as parameter to build_init_ctor may look more cleaner,
>> but it may limit build_init_ctor can only be called from coverage_obj_init.
>> In some situations build_init_ctor may need to be called by other functions,
>> such as my patch for lipo
>> http://gcc.gnu.org/ml/gcc-patches/2013-05/msg00078.html.
>>
>> On the other hand, gcov_info_type is the only non-global variable in the
>> family of variables that have similar purpose. So it is not very bad to make
>> it also global.
>>
>> thanks
>> Carrot
>>
>>>
>>> Ok with that change.
>>>
>>> Thanks,
>>> Richard.
>>>



More information about the Gcc-patches mailing list