This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto][patch] remove more unused code


Namespaces don't survive the reset_land_decl_specifics. This patch
removes support for them in the streamer.

2009-01-21  Rafael Avila de Espindola  <espindola@google.com>

	* lto-function-in.c (input_namespace_decl): Remove.
	(input_tree_operand): Don't call input_namespace_decl.
	* lto-function-out.c (output_namespace_decl): Remove.
	(output_tree): Don't call output_namespace_decl.

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
diff --git a/gcc/lto-function-in.c b/gcc/lto-function-in.c
index 2f3a630..028dbe3 100644
--- a/gcc/lto-function-in.c
+++ b/gcc/lto-function-in.c
@@ -2932,50 +2932,6 @@ input_label_decl (struct lto_input_block *ib, struct data_in *data_in)
   return decl;
 }
 
-static tree
-input_namespace_decl (struct lto_input_block *ib, struct data_in *data_in)
-{
-  tree decl = make_node (NAMESPACE_DECL);
-
-  lto_flags_type flags = input_tree_flags (ib, NAMESPACE_DECL, true);
-  if (input_line_info (ib, data_in, flags))
-    set_line_info (data_in, decl);
-  process_tree_flags (decl, flags);
-
-  global_vector_enter (data_in, decl);
-
-  /* omit locus, uid */
-  decl->decl_minimal.name = input_tree (ib, data_in);
-  decl->decl_minimal.context = input_tree (ib, data_in);
-
-  decl->decl_with_vis.assembler_name = input_tree (ib, data_in);
-  decl->decl_with_vis.section_name = input_tree (ib, data_in);
-
-  /* omit type */
-
-  decl->decl_common.attributes = input_tree (ib, data_in);
-  decl->decl_common.abstract_origin = input_tree (ib, data_in);
-
-  /* omit mode */
-
-  /* FIXME lto: Is this meaningful for NAMESPACE_DECL?  */
-  decl->decl_common.align = lto_input_uleb128 (ib);
-
-  /* omit size, size_unit */
-
-  /* lang_specific */
-  /* omit rtl */
-
-  decl->decl_non_common.saved_tree = input_tree (ib, data_in);
-  /* omit arguments, result */
-  decl->decl_non_common.vindex = input_tree (ib, data_in);
-
-  LTO_DEBUG_TOKEN ("end_namespace_decl");
-
-  return decl;
-}
-
-
 /* Read an IMPORTED_DECL node from IB using descriptors in DATA_IN.  */
 
 static tree
@@ -3421,10 +3377,6 @@ input_tree_operand (struct lto_input_block *ib, struct data_in *data_in,
       result = input_type_decl (ib, data_in);
       break;
 
-    case NAMESPACE_DECL:
-      result = input_namespace_decl (ib, data_in);
-      break;
-
     case TRANSLATION_UNIT_DECL:
       result = input_translation_unit_decl (ib, data_in);
       break;
diff --git a/gcc/lto-function-out.c b/gcc/lto-function-out.c
index 096ed70..01b990e 100644
--- a/gcc/lto-function-out.c
+++ b/gcc/lto-function-out.c
@@ -2813,50 +2813,6 @@ output_label_decl (struct output_block *ob, tree decl)
   LTO_DEBUG_TOKEN ("end_label_decl");
 }
 
-static void
-output_namespace_decl (struct output_block *ob, tree decl)
-{
-  /* tag and flags */
-  output_global_record_start (ob, NULL, NULL, LTO_namespace_decl);
-  output_tree_flags (ob, 0, decl, true);
-
-  global_vector_debug (ob);
-
-  /* uid and locus are handled specially */
-  output_tree (ob, decl->decl_minimal.name);
-  output_tree (ob, decl->decl_minimal.context);
-
-  output_tree (ob, decl->decl_with_vis.assembler_name);
-  output_tree (ob, decl->decl_with_vis.section_name);
-
-  gcc_assert (decl->common.type == void_type_node
-	      || decl->common.type == NULL_TREE);
-
-  output_tree (ob, decl->decl_common.attributes);
-  output_tree (ob, decl->decl_common.abstract_origin);
-
-  gcc_assert (decl->decl_common.mode == 0);
-  /* FIXME lto:  I'm seeing both 0 and 1 here, but I don't
-     think alignment should be meaningful for NAMESPACE_DECL.  */
-  output_uleb128 (ob, decl->decl_common.align);
-
-  gcc_assert (decl->decl_common.size == NULL_TREE);
-  gcc_assert (decl->decl_common.size_unit == NULL_TREE);
-
-  /* lang_specific */
-
-  gcc_assert (decl->decl_with_rtl.rtl == NULL);
-
-  output_tree (ob, decl->decl_non_common.saved_tree);  		/* ??? */
-  gcc_assert (decl->decl_non_common.arguments == NULL_TREE);
-  gcc_assert (decl->decl_non_common.result == NULL_TREE);
-  output_tree (ob, decl->decl_non_common.vindex);
-
-  /* omit chain */
-  LTO_DEBUG_TOKEN ("end_namespace_decl");
-}
-
-
 /* Emit IMPORTED_DECL DECL to output block OB.  */
 
 static void
@@ -3334,10 +3290,6 @@ output_tree (struct output_block *ob, tree expr)
       output_type_decl (ob, expr);
       break;
 
-    case NAMESPACE_DECL:
-      output_namespace_decl (ob, expr);
-      break;
-
     case TRANSLATION_UNIT_DECL:
       output_translation_unit_decl (ob, expr);
       break;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]