[pph] Remove some additional cruft we no longer use (issue4547091)

Diego Novillo dnovillo@google.com
Thu Jun 9 02:12:00 GMT 2011


No functional changes in this patch.  Additional cleanups after the
various trunk merges and old code removal patches.

Tested on x86_64.  Committed to branch.


Diego.

	Fix spurious differences with trunk.

	* c-parser.c (c_parser_declaration_or_fndef): Remove call to
	timevar_push.
	* ggc-page.c (ggc_collect): Change timevar_start to
	timevar_push and timevar_stop to timevar_pop.
	* ggc-zone.c (ggc_collect): Likewise.
	* langhooks-def.h (LANG_HOOKS_INITIALIZER): Remove ',' at the
	end.
	* lto-streamer-out.c (lto_output_tree_header): Remove
	assertion.
	* timevar.def (TV_GC): Revert to trunk version.
	* toplev.c (compile_file): Remove some timevar_start and
	timevar_stop calls.
	(do_compile): Likewise.

cp/ChangeLog.pph

	* call.c: Do not include pph.h.
	(implicit_conversion): Remove unnecessary braces.
	(build_new_op_1): Likewise.
	* cp-gimplify.c (cp_genericize): Remove FIXME comment.
	* cp-lang.c: Do not include pph.h.
	* decl.c (duplicate_decls): Rename from duplicate_decls_internal.
	(xref_tag_1): Remove FIXME comment.
	* Make-lang.in (cp/cp-lang.o): Remove $(CXX_PPH_H) dependency.
	(cp/decl.o): Remove $(CXX_PPH_H) and langhooks.h dependencies.
	(cp/pt.o): Remove $(CXX_PPH_H) dependency.
	* pt.c: Do not include pph.h.
	* rtti.c (create_pseudo_type_info): Remove setting of
	DECL_ARTIFICIAL.


diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index c8e7aa5..65966a9 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -1685,7 +1685,6 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
 	  return;
 	}
       /* Function definition (nested or otherwise).  */
-      timevar_push (TV_PARSE_FUNC);
       if (nested)
 	{
 	  pedwarn (here, OPT_pedantic, "ISO C forbids nested functions");
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index e6b6977..ff3dc06 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -39,7 +39,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "convert.h"
 #include "langhooks.h"
-#include "pph.h"
 #include "c-family/c-objc.h"
 #include "timevar.h"
 
@@ -1757,9 +1756,7 @@ implicit_conversion (tree to, tree from, tree expr, bool c_cast_p,
 
       cand = build_user_type_conversion_1 (to, expr, convflags);
       if (cand)
-        {
-	  conv = cand->second_conv;
-        }
+	conv = cand->second_conv;
 
       /* We used to try to bind a reference to a temporary here, but that
 	 is now handled after the recursive call to this function at the end
@@ -5014,9 +5011,7 @@ build_new_op_1 (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3,
 	  if (resolve_args (arglist, complain) == NULL)
 	    result = error_mark_node;
 	  else
-            {
-	      result = build_over_call (cand, LOOKUP_NORMAL, complain);
-            }
+	    result = build_over_call (cand, LOOKUP_NORMAL, complain);
 	}
       else
 	{
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 2aeb05d..d26c0e0 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -1177,8 +1177,6 @@ cp_genericize (tree fndecl)
   pointer_set_destroy (wtd.p_set);
   VEC_free (tree, heap, wtd.bind_expr_stack);
 
-  /* FIXME pph: save function to hunk.  */
-
   /* Do everything else.  */
   c_genericize (fndecl);
 
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index c47fafd..7b1f450 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -33,7 +33,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "hashtab.h"
 #include "target.h"
 #include "parser.h"
-#include "pph.h"
 
 enum c_language_kind c_language = clk_cxx;
 static void cp_init_ts (void);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index f73ade5..30f70d9 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -54,8 +54,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "pointer-set.h"
 #include "splay-tree.h"
 #include "plugin.h"
-#include "langhooks.h"
-#include "pph.h"
 
 /* Possible cases of bad specifiers type used by bad_specifiers. */
 enum bad_spec_place {
@@ -1180,8 +1178,8 @@ validate_constexpr_redeclaration (tree old_decl, tree new_decl)
 
    NEWDECL_IS_FRIEND is true if NEWDECL was declared as a friend.  */
 
-static tree
-duplicate_decls_internal (tree newdecl, tree olddecl, bool newdecl_is_friend)
+tree
+duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
 {
   unsigned olddecl_uid = DECL_UID (olddecl);
   int olddecl_friend = 0, types_match = 0, hidden_friend = 0;
@@ -2301,28 +2299,6 @@ duplicate_decls_internal (tree newdecl, tree olddecl, bool newdecl_is_friend)
 
   return olddecl;
 }
-
-
-/* Wrapper for duplicate_decls_internal used by PPH support to
-   decide whether NEWDECL or OLDDECL should be removed from the
-   AST catching data structures.  This is necessary when NEWDECL
-   is a re-declaration of OLDDECL.  */
-
-tree
-duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
-{
-  tree gooddecl;
-
-  gooddecl = duplicate_decls_internal (newdecl, olddecl, newdecl_is_friend);
-
-  /* If duplicate_decls_internal returns NULL, it means that NEWDECL
-     is not a re-declaration of OLDDECL, so nothing needs to be done
-     in that case.  */
-  if (gooddecl == NULL_TREE)
-    return NULL_TREE;
-
-  return gooddecl;
-}
 
 /* Return zero if the declaration NEWDECL is valid
    when the declaration OLDDECL (assumed to be for the same name)
@@ -11503,7 +11479,6 @@ xref_tag_1 (enum tag_types tag_code, tree name,
 	{
 	  t = make_class_type (code);
 	  TYPE_CONTEXT (t) = context;
-          /* FIXME pph: creating incomplete class.  */
 	  t = pushtag (name, t, scope);
 	}
     }
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index e199f7d..c955777 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -45,7 +45,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "timevar.h"
 #include "tree-iterator.h"
 #include "vecprim.h"
-#include "pph.h"
 
 /* The type of functions taking a tree, and some additional data, and
    returning an int.  */
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 1c7db4e..0feaf07 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1215,7 +1215,6 @@ create_pseudo_type_info (int tk, const char *real_name, ...)
   /* Create the pseudo type.  */
   pseudo_type = make_class_type (RECORD_TYPE);
   finish_builtin_struct (pseudo_type, pseudo_name, fields, NULL_TREE);
-  DECL_ARTIFICIAL (TYPE_NAME (pseudo_type)) = 1; /* FIXME pph: Right? */
   CLASSTYPE_AS_BASE (pseudo_type) = pseudo_type;
 
   ti = VEC_index (tinfo_s, tinfo_descs, tk);
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index d1bccf8..624f029 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -1911,7 +1911,7 @@ ggc_collect (void)
   if (G.allocated < allocated_last_gc + min_expand && !ggc_force_collect)
     return;
 
-  timevar_start (TV_GC);
+  timevar_push (TV_GC);
   if (!quiet_flag)
     fprintf (stderr, " {GC %luk -> ", (unsigned long) G.allocated / 1024);
   if (GGC_DEBUG_LEVEL >= 2)
@@ -1943,7 +1943,7 @@ ggc_collect (void)
 
   invoke_plugin_callbacks (PLUGIN_GGC_END, NULL);
 
-  timevar_stop (TV_GC);
+  timevar_pop (TV_GC);
 
   if (!quiet_flag)
     fprintf (stderr, "%luk}", (unsigned long) G.allocated / 1024);
diff --git a/gcc/ggc-zone.c b/gcc/ggc-zone.c
index bd26df6..d0c1d79 100644
--- a/gcc/ggc-zone.c
+++ b/gcc/ggc-zone.c
@@ -1984,7 +1984,7 @@ ggc_collect (void)
   struct alloc_zone *zone;
   bool marked = false;
 
-  timevar_start (TV_GC);
+  timevar_push (TV_GC);
 
   if (!ggc_force_collect)
     {
@@ -2003,7 +2003,7 @@ ggc_collect (void)
 
       if (allocated < allocated_last_gc + min_expand)
 	{
-	  timevar_stop (TV_GC);
+	  timevar_pop (TV_GC);
 	  return;
 	}
     }
@@ -2076,7 +2076,7 @@ ggc_collect (void)
 
   invoke_plugin_callbacks (PLUGIN_GGC_END, NULL);
 
-  timevar_stop (TV_GC);
+  timevar_pop (TV_GC);
 }
 
 /* Print allocation statistics.  */
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 39d817d..ed3230c 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -309,7 +309,7 @@ extern void lhd_end_section (void);
   LANG_HOOKS_EH_RUNTIME_TYPE, \
   LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS, \
   LANG_HOOKS_EH_USE_CXA_END_CLEANUP, \
-  LANG_HOOKS_DEEP_UNSHARING, \
+  LANG_HOOKS_DEEP_UNSHARING \
 }
 
 #endif /* GCC_LANG_HOOKS_DEF_H */
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 690fadf..41d4c22 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1275,7 +1275,6 @@ lto_output_tree_header (struct output_block *ob, tree expr)
      EXPR on the reading side (such as the number of slots in
      variable sized nodes).  */
   tag = lto_tree_code_to_tag (code);
-  gcc_assert ((unsigned) tag < (unsigned) LTO_NUM_TAGS);
   output_record_start (ob, tag);
 
   /* The following will cause bootstrap miscomparisons.  Enable with care.  */
diff --git a/gcc/timevar.def b/gcc/timevar.def
index 875f5ed..2921c90 100644
--- a/gcc/timevar.def
+++ b/gcc/timevar.def
@@ -47,7 +47,7 @@ DEFTIMEVAR (TV_NAME_LOOKUP           , "|name lookup")
 DEFTIMEVAR (TV_OVERLOAD              , "|overload resolution")
 
 /* Time spent garbage-collecting.  */
-DEFTIMEVAR (TV_GC                    , "|garbage collection")
+DEFTIMEVAR (TV_GC                    , "garbage collection")
 
 /* Time spent generating dump files.  */
 DEFTIMEVAR (TV_DUMP                  , "dump files")
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 37845ae..6c992cf 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -575,8 +575,6 @@ compile_file (void)
   /* Compilation is now finished except for writing
      what's left of the symbol table output.  */
 
-  timevar_stop (TV_PHASE_PARSING);
-
   if (flag_syntax_only || flag_wpa)
     return;
 
@@ -593,8 +591,6 @@ compile_file (void)
       return;
     }
 
-  timevar_start (TV_PHASE_GENERATE);
-
   varpool_assemble_pending_decls ();
   finish_aliases_2 ();
 
@@ -1909,8 +1905,6 @@ do_compile (void)
       if (!no_backend)
 	backend_init ();
 
-      timevar_stop (TV_PHASE_SETUP);
-
       /* Language-dependent initialization.  Returns true on success.  */
       if (lang_dependent_init (main_input_filename))
         {

--
This patch is available for review at http://codereview.appspot.com/4547091



More information about the Gcc-patches mailing list