+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
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;
}
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;
}
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;
}