/* Data structures and declarations used for reading and writing
GIMPLE to a file stream.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010 Free Software Foundation, Inc.
Contributed by Doug Kwan <dougkwan@google.com>
This file is part of GCC.
entry, there is word with the offset within the section to the
entry.
- 7) THE LABEL NAMES.
+ 7) THE LABEL NAMES.
Since most labels do not have names, this section my be of zero
length. It consists of an array of string table references, one
the negative ones do not. The positive index can be used to
find the name in this array.
- 9) THE CFG.
+ 9) THE CFG.
10) Index into the local decls. Since local decls can have local
decls inside them, they must be read in randomly in order to
- properly restore them.
+ properly restore them.
11-12) GIMPLE FOR THE LOCAL DECLS AND THE FUNCTION BODY.
The gimple consists of a set of records.
THE FUNCTION
-
+
At the top level of (8) is the function. It consists of five
pieces:
(GIMPLE statements, basic blocks, EH regions, tree nodes, etc).
NOTE, when adding new LTO tags, also update lto_tag_name. */
-enum LTO_tags
+enum LTO_tags
{
LTO_null = 0,
LTO_section_function_body,
LTO_section_static_initializer,
LTO_section_cgraph,
+ LTO_section_varpool,
+ LTO_section_jump_functions,
LTO_section_ipa_pure_const,
LTO_section_ipa_reference,
LTO_section_symtab,
- LTO_section_wpa_fixup,
LTO_section_opts,
LTO_N_SECTION_TYPES /* Must be last. */
};
/* Macro to define convenience functions for type and decl streams
- in lto_file_decl_data. */
+ in lto_file_decl_data. */
#define DEFINE_DECL_STREAM_FUNCS(UPPER_NAME, name) \
static inline tree \
lto_file_decl_data_get_ ## name (struct lto_file_decl_data *data, \
or function. The first parameter is the file data that contains
the information. The second parameter is the type of information
to be obtained. The third parameter is the name of the function
- and is only used when finding a function body; otherwise it is
+ and is only used when finding a function body; otherwise it is
NULL. The fourth parameter is the length of the data returned. */
-typedef const char* (lto_get_section_data_f) (struct lto_file_decl_data *,
+typedef const char* (lto_get_section_data_f) (struct lto_file_decl_data *,
enum lto_section_type,
- const char *,
+ const char *,
size_t *);
/* Return the data found from the above call. The first three
parameters are the same as above. The fourth parameter is the data
itself and the fifth is the lenght of the data. */
-typedef void (lto_free_section_data_f) (struct lto_file_decl_data *,
+typedef void (lto_free_section_data_f) (struct lto_file_decl_data *,
enum lto_section_type,
const char *,
const char *,
/* Structure used as buffer for reading an LTO file. */
-struct lto_input_block
+struct lto_input_block
{
const char *data;
unsigned int p;
/* Nonzero if this file should be recompiled with LTRANS. */
unsigned needs_ltrans_p : 1;
- /* If the file is open, this is the fd of the mapped section. This
- is -1 if the file has not yet been opened. */
- int fd;
-
/* Hash table maps lto-related section names to location in file. */
htab_t section_hash_table;
/* Number of named labels. Used to find the index of unnamed labels
since they share space with the named labels. */
- unsigned int num_named_labels;
+ unsigned int num_named_labels;
/* Number of unnamed labels. */
unsigned int num_unnamed_labels;
/* In lto-section-in.c */
extern struct lto_input_block * lto_create_simple_input_block (
- struct lto_file_decl_data *,
+ struct lto_file_decl_data *,
enum lto_section_type, const char **, size_t *);
extern void
-lto_destroy_simple_input_block (struct lto_file_decl_data *,
+lto_destroy_simple_input_block (struct lto_file_decl_data *,
enum lto_section_type,
struct lto_input_block *, const char *, size_t);
-extern void lto_set_in_hooks (struct lto_file_decl_data **,
+extern void lto_set_in_hooks (struct lto_file_decl_data **,
lto_get_section_data_f *,
lto_free_section_data_f *);
extern struct lto_file_decl_data **lto_get_file_decl_data (void);
extern struct lto_out_decl_state *lto_pop_out_decl_state (void);
extern void lto_record_function_out_decl_state (tree,
struct lto_out_decl_state *);
-extern void lto_new_extern_inline_states (void);
-extern void lto_delete_extern_inline_states (void);
-extern void lto_force_functions_extern_inline (bitmap decls);
-extern bool lto_forced_extern_inline_p (tree fn_decl);
/* In lto-streamer.c. */
/* In lto-streamer-in.c */
-extern void lto_input_function_body (struct lto_file_decl_data *, tree,
- const char *);
-extern void lto_input_constructors_and_inits (struct lto_file_decl_data *,
- const char *);
extern void lto_input_cgraph (struct lto_file_decl_data *, const char *);
extern void lto_init_reader (void);
extern tree lto_input_tree (struct lto_input_block *, struct data_in *);
extern void destroy_output_block (struct output_block *);
extern void lto_output_tree (struct output_block *, tree, bool);
extern void lto_output_bitpack (struct lto_output_stream *, struct bitpack_d *);
+extern void produce_asm (struct output_block *ob, tree fn);
/* In lto-cgraph.c */
void lto_cgraph_encoder_delete (lto_cgraph_encoder_t encoder);
void output_cgraph (cgraph_node_set);
void input_cgraph (void);
+void output_varpool (varpool_node_set);
+void input_varpool (void);
/* In lto-symtab.c. */
extern void lto_symtab_register_decl (tree, ld_plugin_symbol_resolution_t,
struct lto_file_decl_data *);
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_clear_resolution (tree decl);
/* In lto-opts.c. */