Commit 3d8a8aad by Mike Stump Committed by Mike Stump

parser.c (cp_lexer_new_main): Get the first token, first, before doing anything.

        * parser.c (cp_lexer_new_main): Get the first token, first, before
        doing anything.
Radar 3929334

From-SVN: r94494
parent 9ea88834
2005-01-31 Mike Stump <mrs@apple.com>
* parser.c (cp_lexer_new_main): Get the first token, first, before
doing anything.
2005-01-31 Mark Mitchell <mark@codesourcery.com> 2005-01-31 Mark Mitchell <mark@codesourcery.com>
* decl.c (start_decl): Add missing parentheses. * decl.c (start_decl): Add missing parentheses.
......
...@@ -238,16 +238,19 @@ cp_lexer_new_main (void) ...@@ -238,16 +238,19 @@ cp_lexer_new_main (void)
size_t space; size_t space;
cp_token *buffer; cp_token *buffer;
/* It's possible that lexing the first token will load a PCH file,
which is a GC collection point. So we have to grab the first
token before allocating any memory. Pragmas must not be deferred
as -fpch-preprocess can generate a pragma to load the PCH file in
the preprocessed output used by -save-temps. */
cp_lexer_get_preprocessor_token (NULL, &first_token);
/* Tell cpplib we want CPP_PRAGMA tokens. */ /* Tell cpplib we want CPP_PRAGMA tokens. */
cpp_get_options (parse_in)->defer_pragmas = true; cpp_get_options (parse_in)->defer_pragmas = true;
/* Tell c_lex not to merge string constants. */ /* Tell c_lex not to merge string constants. */
c_lex_return_raw_strings = true; c_lex_return_raw_strings = true;
/* It's possible that lexing the first token will load a PCH file,
which is a GC collection point. So we have to grab the first
token before allocating any memory. */
cp_lexer_get_preprocessor_token (NULL, &first_token);
c_common_no_more_pch (); c_common_no_more_pch ();
/* Allocate the memory. */ /* Allocate the memory. */
......
// { dg-options "-save-temps -fpch-preprocess -I." }
#include "pch.H"
int main()
{
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment