This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Plan for removing global state from GCC's internals
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Aaron Gray <aaronngray dot lists at gmail dot com>, David Malcolm <dmalcolm at redhat dot com>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 2 Jul 2013 18:54:09 -0500
- Subject: Re: Plan for removing global state from GCC's internals
- References: <1372272382 dot 1022 dot 26 dot camel at surprise> <Pine dot LNX dot 4 dot 64 dot 1306262002150 dot 30407 at digraph dot polyomino dot org dot uk> <1372295735 dot 1022 dot 72 dot camel at surprise> <Pine dot LNX dot 4 dot 64 dot 1306271425010 dot 4602 at digraph dot polyomino dot org dot uk> <1372360959 dot 1789 dot 32 dot camel at surprise> <Pine dot LNX dot 4 dot 64 dot 1306271933460 dot 10184 at digraph dot polyomino dot org dot uk> <1372699842 dot 1789 dot 144 dot camel at surprise> <Pine dot LNX dot 4 dot 64 dot 1307011932480 dot 13535 at digraph dot polyomino dot org dot uk> <CANkmNDeQH122YZMdBGGD_c+95bGqTQnD6DKmLj2tcmt_q-HqPA at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1307022012080 dot 28677 at digraph dot polyomino dot org dot uk>
On Tue, Jul 2, 2013 at 3:25 PM, Joseph S. Myers <joseph@codesourcery.com> wrote:
> On Mon, 1 Jul 2013, Aaron Gray wrote:
>
>> I started to do this starting with the C++ parser class'izing it but
>> no one was interested.
>
> The C++ parser types such as cp_parser and cp_lexer already do a good job
> of avoiding global state.
The assertion that nobody was interested is, of course, untrue.
I did give feedback; but I never heard back after that.
>
> I am not an expert on good C++ coding practices and don't know to what
> extent the objections given in
> <http://gcc.gnu.org/ml/gcc-patches/2012-08/msg02019.html> might apply to
> any parts of David's proposal. But in David's proposal, conversion to
> classes is a means to an end - eliminating global state through passing
> implicit "this" pointers - and not an end in itself if the global state
> does not exist, or if it can easily be moved inside an existing structure
> such as cp_parser or gcc_options rather than needing to go inside some new
> class.
Amen.
-- Gaby