From 5d58db82b01c8c93ebe81257f7eca71098fad03b Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Wed, 3 Jun 2015 00:50:13 +0700 Subject: [PATCH] cp-tree.h (init_error): Remove declaration. * cp-tree.h (init_error): Remove declaration. * error.c (scratch_pretty_printer): Rename to ... (actual_pretty_printer): ... this. (cxx_pp): Constify and update accordingly. (init_error): Remove definition. * lex.c (cxx_init): Do not call init_error. From-SVN: r224037 --- gcc/cp/ChangeLog | 9 +++++++++ gcc/cp/cp-tree.h | 1 - gcc/cp/error.c | 14 ++------------ gcc/cp/lex.c | 1 - 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c6f1a6d2282..b6a8ab54661 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2015-06-02 Patrick Palka + + * cp-tree.h (init_error): Remove declaration. + * error.c (scratch_pretty_printer): Rename to ... + (actual_pretty_printer): ... this. + (cxx_pp): Constify and update accordingly. + (init_error): Remove definition. + * lex.c (cxx_init): Do not call init_error. + 2015-06-02 Paolo Carlini PR c++/61683 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 91619e2cb3c..9107fa68b64 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -5505,7 +5505,6 @@ extern tree vtv_finish_verification_constructor_init_function (tree); extern bool cp_omp_mappable_type (tree); /* in error.c */ -extern void init_error (void); extern const char *type_as_string (tree, int); extern const char *type_as_string_translate (tree, int); extern const char *decl_as_string (tree, int); diff --git a/gcc/cp/error.c b/gcc/cp/error.c index ea03f7dc3a9..690cb0c50d3 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -54,8 +54,8 @@ along with GCC; see the file COPYING3. If not see tree -> string functions that are occasionally called from the debugger or by the front-end for things like __PRETTY_FUNCTION__. */ -static cxx_pretty_printer scratch_pretty_printer; -static cxx_pretty_printer * cxx_pp = &scratch_pretty_printer; +static cxx_pretty_printer actual_pretty_printer; +static cxx_pretty_printer * const cxx_pp = &actual_pretty_printer; /* Translate if being used for diagnostics, but not for dump files or __PRETTY_FUNCTION. */ @@ -140,16 +140,6 @@ cxx_initialize_diagnostics (diagnostic_context *context) diagnostic_format_decoder (context) = cp_printer; } -/* Initialize the global cxx_pp that is used as the memory store for - the string representation of C++ AST. See the description of - cxx_pp above. */ - -void -init_error (void) -{ - new (cxx_pp) cxx_pretty_printer (); -} - /* Dump a scope, if deemed necessary. */ static void diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 0fced4f9fd6..bde15bcb2d6 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -259,7 +259,6 @@ cxx_init (void) init_cp_semantics (); init_operators (); init_method (); - init_error (); current_function_decl = NULL; -- 2.30.2