This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: switch c-format.c to use pool instead of GC


> Laurynas> +static alloc_pool fwt_pool;
>
> This at least needs a comment.
>
> The code is kind of twisty here, but I was wondering if this could be
> allocated locally in check_format_arg and passed as an argument to
> check_format_info_main.

Yes, it could. In fact it was so in a earlier version of this patch.
The reason I changed it to a global was that I have similar patch to
lambda-code.c, where the pool/obstack reference has to be passed maybe
three levels deep before being actually used, and that looked kinda
ugly to me.

> Any front-end global that can be deleted is helpful to my incremental
> compiler project :-), and IMNSHO also to clarity.

I absolutely agree. I will submit an updated patch, and will change my
future patches the same way. The lambda-code changes will not look
very nice this way, but it will sort out in the future, when the
obstack/pool reference becomes part of some state structure.

And of course getting rid of globals would help not only to the
incremental compiler project, but to the C++ conversion, and, who
knows, maybe even unit testing.

Thanks for the comment,
-- 
Laurynas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]