X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Flto-streamer.h;h=c33feb62b01400c0538c921166641a145a63448a;hp=d86811a7fbcf73744d614548fa4f4790f9ab5c02;hb=9956d53e0b9f48b15c8470ad3173e161e4bc5d11;hpb=02b2818cfeffc3709b01ae5a2475d6f94eacb056 diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index d86811a7fbc..c33feb62b01 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -30,7 +30,6 @@ along with GCC; see the file COPYING3. If not see #include "cgraph.h" #include "vec.h" #include "vecprim.h" -#include "alloc-pool.h" /* Define when debugging the LTO streamer. This causes the writer to output the numeric value for the memory address of the tree node @@ -258,7 +257,6 @@ enum lto_section_type LTO_section_static_initializer, LTO_section_cgraph, LTO_section_varpool, - LTO_section_refs, LTO_section_jump_functions, LTO_section_ipa_pure_const, LTO_section_ipa_reference, @@ -347,14 +345,11 @@ struct lto_streamer_cache_d /* The mapping between tree nodes and slots into the nodes array. */ htab_t node_map; - /* Node map to store entries into. */ - alloc_pool node_map_entries; - /* Next available slot in the nodes and offsets arrays. */ unsigned next_slot; /* The nodes pickled so far. */ - VEC(tree,heap) *nodes; + VEC(tree,gc) *nodes; /* Offset into the stream where the nodes have been written. */ VEC(unsigned,heap) *offsets; @@ -467,41 +462,15 @@ struct lto_cgraph_encoder_d /* Map reference number to node. */ VEC(cgraph_node_ptr,heap) *nodes; - - /* Map of nodes where we want to output body. */ - struct pointer_set_t *body; }; typedef struct lto_cgraph_encoder_d *lto_cgraph_encoder_t; -/* Return number of encoded nodes in ENCODER. */ - -static inline int -lto_cgraph_encoder_size (lto_cgraph_encoder_t encoder) -{ - return VEC_length (cgraph_node_ptr, encoder->nodes); -} - - -/* Encoder data structure used to stream callgraph nodes. */ -struct lto_varpool_encoder_d -{ - /* Map nodes to reference number. */ - struct pointer_map_t *map; - - /* Map reference number to node. */ - VEC(varpool_node_ptr,heap) *nodes; - - /* Map of nodes where we want to output initializer. */ - struct pointer_set_t *initializer; -}; -typedef struct lto_varpool_encoder_d *lto_varpool_encoder_t; - /* Mapping from indices to trees. */ -struct GTY(()) lto_tree_ref_table +struct lto_tree_ref_table { /* Array of referenced trees . */ - tree * GTY((length ("%h.size"))) trees; + tree *trees; /* Size of array. */ unsigned int size; @@ -527,7 +496,7 @@ struct lto_tree_ref_encoder /* Structure to hold states of input scope. */ -struct GTY(()) lto_in_decl_state +struct lto_in_decl_state { /* Array of lto_in_decl_buffers to store type and decls streams. */ struct lto_tree_ref_table streams[LTO_N_DECL_STREAMS]; @@ -551,9 +520,6 @@ struct lto_out_decl_state /* Encoder for cgraph nodes. */ lto_cgraph_encoder_t cgraph_node_encoder; - /* Encoder for varpool nodes. */ - lto_varpool_encoder_t varpool_node_encoder; - /* If this out-decl state belongs to a function, fn_decl points to that function. Otherwise, it is NULL. */ tree fn_decl; @@ -568,7 +534,7 @@ DEF_VEC_ALLOC_P(lto_out_decl_state_ptr, heap); by lto. This structure contains the tables that are needed by the serialized functions and ipa passes to connect themselves to the global types and decls as they are reconstituted. */ -struct GTY(()) lto_file_decl_data +struct lto_file_decl_data { /* Decl state currently used. */ struct lto_in_decl_state *current_decl_state; @@ -578,22 +544,22 @@ struct GTY(()) lto_file_decl_data struct lto_in_decl_state *global_decl_state; /* Table of cgraph nodes present in this file. */ - lto_cgraph_encoder_t GTY((skip)) cgraph_node_encoder; - - /* Table of varpool nodes present in this file. */ - lto_varpool_encoder_t GTY((skip)) varpool_node_encoder; + lto_cgraph_encoder_t cgraph_node_encoder; /* Hash table maps lto-related section names to location in file. */ - htab_t GTY((param_is (struct lto_in_decl_state))) function_decl_states; + htab_t function_decl_states; /* The .o file that these offsets relate to. */ - const char *GTY((skip)) file_name; + const char *file_name; + + /* Nonzero if this file should be recompiled with LTRANS. */ + unsigned needs_ltrans_p : 1; /* Hash table maps lto-related section names to location in file. */ - htab_t GTY((skip)) section_hash_table; + htab_t section_hash_table; /* Hash new name of renamed global declaration to its original name. */ - htab_t GTY((skip)) renaming_hash_table; + htab_t renaming_hash_table; }; struct lto_char_ptr_base @@ -862,33 +828,11 @@ struct cgraph_node *lto_cgraph_encoder_deref (lto_cgraph_encoder_t, int); int lto_cgraph_encoder_lookup (lto_cgraph_encoder_t, struct cgraph_node *); lto_cgraph_encoder_t lto_cgraph_encoder_new (void); int lto_cgraph_encoder_encode (lto_cgraph_encoder_t, struct cgraph_node *); -void lto_cgraph_encoder_delete (lto_cgraph_encoder_t); -bool lto_cgraph_encoder_encode_body_p (lto_cgraph_encoder_t, - struct cgraph_node *); - -bool lto_varpool_encoder_encode_body_p (lto_varpool_encoder_t, - struct varpool_node *); -struct varpool_node *lto_varpool_encoder_deref (lto_varpool_encoder_t, int); -int lto_varpool_encoder_lookup (lto_varpool_encoder_t, struct varpool_node *); -lto_varpool_encoder_t lto_varpool_encoder_new (void); -int lto_varpool_encoder_encode (lto_varpool_encoder_t, struct varpool_node *); -void lto_varpool_encoder_delete (lto_varpool_encoder_t); -bool lto_varpool_encoder_encode_initializer_p (lto_varpool_encoder_t, - struct varpool_node *); -void output_cgraph (cgraph_node_set, varpool_node_set); +void lto_cgraph_encoder_delete (lto_cgraph_encoder_t encoder); +void output_cgraph (cgraph_node_set); void input_cgraph (void); -bool referenced_from_other_partition_p (struct ipa_ref_list *, - cgraph_node_set, - varpool_node_set vset); -bool reachable_from_other_partition_p (struct cgraph_node *, - cgraph_node_set); -bool referenced_from_this_partition_p (struct ipa_ref_list *, - cgraph_node_set, - varpool_node_set vset); -bool reachable_from_this_partition_p (struct cgraph_node *, - cgraph_node_set); -void compute_ltrans_boundary (struct lto_out_decl_state *state, - cgraph_node_set, varpool_node_set); +void output_varpool (varpool_node_set); +void input_varpool (void); /* In lto-symtab.c. */ @@ -898,7 +842,6 @@ extern void lto_symtab_merge_decls (void); extern void lto_symtab_merge_cgraph_nodes (void); extern tree lto_symtab_prevailing_decl (tree decl); extern enum ld_plugin_symbol_resolution lto_symtab_get_resolution (tree decl); -extern void lto_symtab_free (void); /* In lto-opts.c. */ @@ -979,6 +922,38 @@ lto_tag_to_tree_code (enum LTO_tags tag) return (enum tree_code) ((unsigned) tag - 1); } + +/* Return true if FILE needs to be compiled with LTRANS. */ +static inline bool +lto_file_needs_ltrans_p (struct lto_file_decl_data *file) +{ + return file->needs_ltrans_p != 0; +} + + +/* Mark FILE to be compiled with LTRANS. */ +static inline void +lto_mark_file_for_ltrans (struct lto_file_decl_data *file) +{ + file->needs_ltrans_p = 1; +} + + +/* Return true if any files in node set SET need to be compiled + with LTRANS. */ +static inline bool +cgraph_node_set_needs_ltrans_p (cgraph_node_set set) +{ + cgraph_node_set_iterator csi; + + for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi)) + if (lto_file_needs_ltrans_p (csi_node (csi)->local.lto_file_data)) + return true; + + return false; +} + + /* Initialize an lto_out_decl_buffer ENCODER. */ static inline void lto_init_tree_ref_encoder (struct lto_tree_ref_encoder *encoder,