[00/13] Remove parser-related globals

Message ID 20190403013805.11978-1-tom@tromey.com
Headers show
Series
  • Remove parser-related globals
Related show

Message

Tom Tromey April 3, 2019, 1:37 a.m.
This series removes the remaining globals from the generic parser code
(individual parsers may still have globals -- in fact, aside from
Rust, all do).  One upside of the series is that it makes it more
clear which objects are used to communicate between the parser API and
the individual parsers.

Regression tested by the buildbot.

Tom

Comments

Pedro Alves April 3, 2019, 6:14 p.m. | #1
On 04/03/2019 02:37 AM, Tom Tromey wrote:
> This series removes the remaining globals from the generic parser code

> (individual parsers may still have globals -- in fact, aside from

> Rust, all do).  One upside of the series is that it makes it more

> clear which objects are used to communicate between the parser API and

> the individual parsers.

> 

> Regression tested by the buildbot.

> 


Wow.  Very nice.  I skimmed it and it LGTM.

In the type_stack patch:

> +/* The type stack is an instance of this structure.  */

> +

> +struct type_stack

> +{

> +public:

> +

> +  type_stack ()

> +  {

> +  }


You can write:

  type_stack () = default;

As is makes it read like you intended to initialize
something but forgot.

Thanks,
Pedro Alves
Sergio Durigan Junior April 4, 2019, 3:58 p.m. | #2
On Tuesday, April 02 2019, Tom Tromey wrote:

> This series removes the remaining globals from the generic parser code

> (individual parsers may still have globals -- in fact, aside from

> Rust, all do).  One upside of the series is that it makes it more

> clear which objects are used to communicate between the parser API and

> the individual parsers.

>

> Regression tested by the buildbot.


Thanks for doing this, Tom.  I'm glad to see this work finally finished.

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
Tom Tromey April 5, 2019, 1:45 a.m. | #3
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:


Pedro> Wow.  Very nice.  I skimmed it and it LGTM.

Thanks.  I'm going to check it in.

Pedro> In the type_stack patch:
[...]

I made the suggested change.  I seem to have trouble remembering to
write " = default".

Tom