summaryrefslogtreecommitdiff
path: root/gcc/lto-streamer.h
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-05 10:21:42 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-05 10:21:42 +0000
commita238367fa353f7ee1af60ef845766d183dbfd337 (patch)
tree875c06ba015ae9aa913d0e3eeea54506464b244d /gcc/lto-streamer.h
parent9269f553b79686bf43ac51b8e77a6700c3b95740 (diff)
downloadgcc-a238367fa353f7ee1af60ef845766d183dbfd337.tar.gz
* lto-cgraph.c (output_varpool): Forward declare; work on encoder.
(lto_varpool_encoder_new, lto_varpool_encoder_delete, lto_varpool_encoder_encode lto_varpool_encoder_lookup, lto_varpool_encoder_deref, lto_varpool_encoder_size, lto_varpool_encoder_encode_initializer_p, lto_set_varpool_encoder_encode_initializer): New functions. (lto_output_cgraph): Take vset parameter too; compute varpool encoder; call output_varpool. (input_varpool_node): Do not always set analyzed. (input_cgraph_1): Return vector of cgraph nodes. (input_varpool_1): Return vector of varpools. (input_cgraph): Free the vectors. * lto-streamer-out.c (lto_output_ts_decl_common_tree_pointers): output only initializers needed. (lto_output): Only call output_cgraph. (produce_asm_for_decls): Call lto_varpool_encoder_delete. * lto-section-out.c (lto_new_out_decl_state): Initialize state->varpool_node_encoder. * lto-streamer.h (lto_varpool_encoder_d): New. (lto_out_decl_state, lto_file_decl_data): Add varpool_node_encoder. (lto_cgraph_encoder_delete, output_cgraph): Update prototype. (lto_varpool_encoder_deref, lto_varpool_encoder_lookup, lto_varpool_encoder_encode, lto_varpool_encoder_delete, lto_varpool_encoder_encode_initializer_p, lto_varpool_encoder_new): Declare. (output_varpool, input_varpool): Remove declarations. * lto.c (lto_1_to_1_map): Partition only needed nodes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159062 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer.h')
-rw-r--r--gcc/lto-streamer.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index cc1922a6a7f..3d8617bd96d 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -466,6 +466,20 @@ struct lto_cgraph_encoder_d
typedef struct lto_cgraph_encoder_d *lto_cgraph_encoder_t;
+/* 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
{
@@ -520,6 +534,9 @@ 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;
@@ -546,6 +563,9 @@ struct GTY(()) lto_file_decl_data
/* 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;
+
/* Hash table maps lto-related section names to location in file. */
htab_t GTY((param_is (struct lto_in_decl_state))) function_decl_states;
@@ -825,11 +845,16 @@ 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 encoder);
-void output_cgraph (cgraph_node_set);
+void lto_cgraph_encoder_delete (lto_cgraph_encoder_t);
+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 input_cgraph (void);
-void output_varpool (varpool_node_set);
-void input_varpool (void);
/* In lto-symtab.c. */