Re: [04/32] cpp lexer

2020-11-09 Thread Nathan Sidwell
Jeff, here is an updated patch with changelog. I've added checking_asserts and comments for the state changes you were concerned about. While the __builtin_expects do make a change to generated code, you are probably right that they are not significant and I have removed them -- cpplib tends

Re: [04/32] cpp lexer

2020-11-08 Thread Boris Kolpackov
Nathan Sidwell writes: > > This doesn't seem to match the code to go into directives mode all that > > well.? You don't reset pragma_allow_expansion or directive_line. > > Hm, yeah. I think neither of those fields have any bearing in > non-directives mode, and always get set when entering it?

Re: [04/32] cpp lexer

2020-11-06 Thread Nathan Sidwell
On 11/6/20 3:23 PM, Jeff Law wrote: 04-cpp-lexer.diff diff --git c/libcpp/include/cpplib.h w/libcpp/include/cpplib.h index 8e398863cf6..81be6457951 100644 --- c/libcpp/include/cpplib.h +++ w/libcpp/include/cpplib.h @@ -888,9 +915,9 @@ struct GTY(()) cpp_hashnode { unsigned int directive_i

Re: [04/32] cpp lexer

2020-11-06 Thread Jeff Law via Gcc-patches
On 11/3/20 2:13 PM, Nathan Sidwell wrote: > c++ modules creates 2 new kinds of preprocessor lines > [export] module ... > [export] import ... > > To all intents and purposes these are cppdirectives spelt without a > leading '#'.  module and import are context-sensitive keywords.  Thus > preproces

Re: [04/32] cpp lexer

2020-11-03 Thread Nathan Sidwell
On 11/3/20 6:08 PM, Joseph Myers wrote: On Tue, 3 Nov 2020, Nathan Sidwell wrote: @@ -888,9 +915,9 @@ struct GTY(()) cpp_hashnode { unsigned int directive_index : 7; /* If is_directive, then index into directive table.

Re: [04/32] cpp lexer

2020-11-03 Thread Joseph Myers
On Tue, 3 Nov 2020, Nathan Sidwell wrote: > @@ -888,9 +915,9 @@ struct GTY(()) cpp_hashnode { >unsigned int directive_index : 7; /* If is_directive, > then index into directive table. > Otherwise, a NODE_OPERATO

[04/32] cpp lexer

2020-11-03 Thread Nathan Sidwell
c++ modules creates 2 new kinds of preprocessor lines [export] module ... [export] import ... To all intents and purposes these are cppdirectives spelt without a leading '#'. module and import are context-sensitive keywords. Thus preprocessor tokenizing needs a bit of token peeking. This is