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]

Re: [lto] add serialization of NAMESPACE_DECL's


Diego Novillo wrote:
On 4/29/08 2:27 AM, Ollie Wild wrote:

2008-04-28 Ollie Wild <aaw@google.com>

* lto-tags.h (enum LTO_tags): Add LTO_namespace_decl.
* lto-tree-tags.def (LTO_namespace_decl): New tag.
* lto-section-out.c (lto_get_out_decl_state): Initialize
out_state->namespace_decl_hash_table.
(produce_asm_for_decls): Write assembly for namespace declarations.
* lto-section-out.h (struct lto_out_decl_state): Add
namespace_decl_hash_table, next_namespace_decl_index, and
namespace_decls.
* lto-section.h (struct lto_decl_header): Add num_namespace_decls.
* lto-function-out.c (output_expr_operand): Add NAMESPACE_DECL case.
(lto_static_init): Clear lto_flags_needed_for and lto_types_needed_for
entries for NAMESPACE_DECL.
(output_constructors_and_inits): Output initializer if
DECL_CONTEXT (var) is not a FUNCTION_DECL.
* dwarf2out.c (lto_namespacedecl_ref): New function.
* dwarf2out.h (lto_namespacedecl_ref): New function.


2008-04-28 Ollie Wild <aaw@google.com>

* lto.c (lto_read_namespace_DIE): New function.
(lto_read_DIE): Add lto_read_namespace_DIE callback. Cache
NAMESPACE_DECL DIE's.
(lto_resolve_namespacedecl_ref): New function.
* lto.h (lto_resolve_namespacedecl_ref): New function.
* lto-section-in.c (lto_read_decls): Read namespace declarations.
* lto-section-in.h (struct lto_file_decl_data): Add namespace_decls
and num_namespace_decls.
* lto-function-in.c (input_expr_operand): Add NAMESPACE_DECL case.
* lto-lang.c (lto_init_ts): New function.
(LANG_HOOKS_INIT_TS): Set as lto_init_ts.


Looks OK. Only a few formatting notes:

+void
+lto_namespacedecl_ref (tree decl, lto_out_ref *ref)

Needs comment.


+static void lto_init_ts (void)
+{

Needs comment.


@@ -312,6 +317,11 @@ lto_read_decls (lto_info_fd *fd,
= lto_resolve_typedecl_ref (fd, context, &in_type_decls[i]);
data_in->num_type_decls = header->num_type_decls;
+ for (i=0; i<header->num_namespace_decls; i++)

Space before/after '=' and '<'.



 static tree
+lto_read_namespace_DIE (lto_info_fd *fd,
+            lto_die_ptr die ATTRIBUTE_UNUSED,
+            const DWARF2_abbrev *abbrev,
+            lto_context *context)

Needs comment.



The rest looks fine. I guess it's OK to have this while we redo the DWARF encoding. The code is not too invasive.


right, some of it will live and some will die, but it is in the same form as everything else so it the right way to go.


Diego.


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