Re: [PATCH] teach gengtype about 'mutable'

2019-10-15 Thread Richard Biener
Yes, it is. :)

On Mon, Oct 14, 2019 at 10:09 PM Nathan Sidwell  wrote:
>
> On 10/14/19 3:46 PM, Jeff Law wrote:
> > On 10/14/19 6:09 AM, Nathan Sidwell wrote:
> >> On 10/14/19 7:16 AM, Richard Biener wrote:
> >>> On Sun, Oct 13, 2019 at 4:45 PM Nathan Sidwell  wrote:
> 
>  In constifying some more of line-map I discovered gengtype didn't
>  know mutable.
>  Added thusly.
> >>>
> >>> mutable is bad.  Why do you want to use it?
> >>
> >> the line map info has a caching field.
> > Isn't that in fact a classic use case for mutable?
>
> Indeed it is.  I'm curious as to the 'mutable is bad' origin.  Is it
> similar to 'goto is bad'?
>
> nathan
>
>
> --
> Nathan Sidwell


Re: [PATCH] teach gengtype about 'mutable'

2019-10-14 Thread Nathan Sidwell

On 10/14/19 3:46 PM, Jeff Law wrote:

On 10/14/19 6:09 AM, Nathan Sidwell wrote:

On 10/14/19 7:16 AM, Richard Biener wrote:

On Sun, Oct 13, 2019 at 4:45 PM Nathan Sidwell  wrote:


In constifying some more of line-map I discovered gengtype didn't
know mutable.
Added thusly.


mutable is bad.  Why do you want to use it?


the line map info has a caching field.

Isn't that in fact a classic use case for mutable?


Indeed it is.  I'm curious as to the 'mutable is bad' origin.  Is it 
similar to 'goto is bad'?


nathan


--
Nathan Sidwell


Re: [PATCH] teach gengtype about 'mutable'

2019-10-14 Thread Jeff Law
On 10/14/19 6:09 AM, Nathan Sidwell wrote:
> On 10/14/19 7:16 AM, Richard Biener wrote:
>> On Sun, Oct 13, 2019 at 4:45 PM Nathan Sidwell  wrote:
>>>
>>> In constifying some more of line-map I discovered gengtype didn't
>>> know mutable.
>>> Added thusly.
>>
>> mutable is bad.  Why do you want to use it?
> 
> the line map info has a caching field.
Isn't that in fact a classic use case for mutable?


Seems like it's the right thing to do to me...

jeff


Re: [PATCH] teach gengtype about 'mutable'

2019-10-14 Thread Nathan Sidwell

On 10/14/19 7:16 AM, Richard Biener wrote:

On Sun, Oct 13, 2019 at 4:45 PM Nathan Sidwell  wrote:


In constifying some more of line-map I discovered gengtype didn't know mutable.
Added thusly.


mutable is bad.  Why do you want to use it?


the line map info has a caching field.

mutable is part of c++ 98

nathan

--
Nathan Sidwell


Re: [PATCH] teach gengtype about 'mutable'

2019-10-14 Thread Richard Biener
On Sun, Oct 13, 2019 at 4:45 PM Nathan Sidwell  wrote:
>
> In constifying some more of line-map I discovered gengtype didn't know 
> mutable.
> Added thusly.

mutable is bad.  Why do you want to use it?

> nathan
>
> --
> Nathan Sidwell


[PATCH] teach gengtype about 'mutable'

2019-10-13 Thread Nathan Sidwell
In constifying some more of line-map I discovered gengtype didn't know mutable. 
Added thusly.


nathan

--
Nathan Sidwell
2019-10-13  Nathan Sidwell  

	* gengtype-lex.l (CXX_KEYWORD): Add 'mutable'.

Index: gcc/gengtype-lex.l
===
--- gcc/gengtype-lex.l	(revision 275726)
+++ gcc/gengtype-lex.l	(working copy)
@@ -58,7 +58,7 @@ ITYPE	{IWORD}({WS}{IWORD})*
 /* Include '::' in identifiers to capture C++ scope qualifiers.  */
 ID	{CID}({HWS}::{HWS}{CID})*
 EOID	[^[:alnum:]_]
-CXX_KEYWORD inline|public:|private:|protected:|template|operator|friend|static
+CXX_KEYWORD inline|public:|private:|protected:|template|operator|friend|static|mutable
 
 %x in_struct in_struct_comment in_comment
 %option warn noyywrap nounput nodefault perf-report