mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-24 13:31:22 +08:00
Low-hanging C++-lexer speedup (PR c++/24208)
gcc/cp/ChangeLog: PR c++/24208 * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro. (cp_lexer_debugging_p): Use it. (cp_lexer_start_debugging): Likewise. (cp_lexer_stop_debugging): Likewise. From-SVN: r232912
This commit is contained in:
parent
069ec73a9b
commit
2b4f7b944d
@ -1,3 +1,11 @@
|
||||
2016-01-28 Patrick Palka <ppalka@gcc.gnu.org>
|
||||
|
||||
PR c++/24208
|
||||
* parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
|
||||
(cp_lexer_debugging_p): Use it.
|
||||
(cp_lexer_start_debugging): Likewise.
|
||||
(cp_lexer_stop_debugging): Likewise.
|
||||
|
||||
2016-01-27 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c/68062
|
||||
|
@ -706,11 +706,21 @@ cp_lexer_destroy (cp_lexer *lexer)
|
||||
ggc_free (lexer);
|
||||
}
|
||||
|
||||
/* This needs to be set to TRUE before the lexer-debugging infrastructure can
|
||||
be used. The point of this flag is to help the compiler to fold away calls
|
||||
to cp_lexer_debugging_p within this source file at compile time, when the
|
||||
lexer is not being debugged. */
|
||||
|
||||
#define LEXER_DEBUGGING_ENABLED_P false
|
||||
|
||||
/* Returns nonzero if debugging information should be output. */
|
||||
|
||||
static inline bool
|
||||
cp_lexer_debugging_p (cp_lexer *lexer)
|
||||
{
|
||||
if (!LEXER_DEBUGGING_ENABLED_P)
|
||||
return false;
|
||||
|
||||
return lexer->debugging_p;
|
||||
}
|
||||
|
||||
@ -1296,6 +1306,10 @@ debug (cp_token *ptr)
|
||||
static void
|
||||
cp_lexer_start_debugging (cp_lexer* lexer)
|
||||
{
|
||||
if (!LEXER_DEBUGGING_ENABLED_P)
|
||||
fatal_error (input_location,
|
||||
"LEXER_DEBUGGING_ENABLED_P is not set to true");
|
||||
|
||||
lexer->debugging_p = true;
|
||||
cp_lexer_debug_stream = stderr;
|
||||
}
|
||||
@ -1305,6 +1319,10 @@ cp_lexer_start_debugging (cp_lexer* lexer)
|
||||
static void
|
||||
cp_lexer_stop_debugging (cp_lexer* lexer)
|
||||
{
|
||||
if (!LEXER_DEBUGGING_ENABLED_P)
|
||||
fatal_error (input_location,
|
||||
"LEXER_DEBUGGING_ENABLED_P is not set to true");
|
||||
|
||||
lexer->debugging_p = false;
|
||||
cp_lexer_debug_stream = NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user