#include "target.h"
#include "cgraph.h"
#include "vec.h"
-#include "vecprim.h"
#include "alloc-pool.h"
#include "gcov-io.h"
#include "diagnostic.h"
} lto_decl_stream_e_t;
typedef enum ld_plugin_symbol_resolution ld_plugin_symbol_resolution_t;
-DEF_VEC_I(ld_plugin_symbol_resolution_t);
-DEF_VEC_ALLOC_I(ld_plugin_symbol_resolution_t, heap);
/* Macro to define convenience functions for type and decl streams
unsigned int initializer:1;
} lto_encoder_entry;
-DEF_VEC_O(lto_encoder_entry);
-DEF_VEC_ALLOC_O(lto_encoder_entry, heap);
/* Encoder data structure used to stream callgraph nodes. */
struct lto_symtab_encoder_d
{
- VEC(lto_encoder_entry,heap) *nodes;
+ vec<lto_encoder_entry> nodes;
pointer_map_t *map;
};
{
htab_t tree_hash_table; /* Maps pointers to indices. */
unsigned int next_index; /* Next available index. */
- VEC(tree,heap) *trees; /* Maps indices to pointers. */
+ vec<tree> trees; /* Maps indices to pointers. */
};
typedef struct lto_out_decl_state *lto_out_decl_state_ptr;
-DEF_VEC_P(lto_out_decl_state_ptr);
-DEF_VEC_ALLOC_P(lto_out_decl_state_ptr, heap);
/* Compact representation of a index <-> resolution pair. Unpacked to an
vector later. */
};
typedef struct res_pair res_pair;
-DEF_VEC_O(res_pair);
-DEF_VEC_ALLOC_O(res_pair, heap);
/* One of these is allocated for each object file that being compiled
by lto. This structure contains the tables that are needed by the
unsigned HOST_WIDE_INT id;
/* Symbol resolutions for this file */
- VEC(res_pair, heap) * GTY((skip)) respairs;
+ vec<res_pair> GTY((skip)) respairs;
unsigned max_index;
struct gcov_ctr_summary GTY((skip)) profile_info;
int current_col;
/* Maps each reference number to the resolution done by the linker. */
- VEC(ld_plugin_symbol_resolution_t,heap) *globals_resolution;
+ vec<ld_plugin_symbol_resolution_t> globals_resolution;
/* Cache of pickled nodes. */
struct streamer_tree_cache_d *reader_cache;
extern void lto_input_toplevel_asms (struct lto_file_decl_data *, int);
extern struct data_in *lto_data_in_create (struct lto_file_decl_data *,
const char *, unsigned,
- VEC(ld_plugin_symbol_resolution_t,heap) *);
+ vec<ld_plugin_symbol_resolution_t> );
extern void lto_data_in_delete (struct data_in *);
extern void lto_input_data_block (struct lto_input_block *, void *, size_t);
location_t lto_input_location (struct bitpack_d *, struct data_in *);
extern void lto_symtab_merge_decls (void);
extern void lto_symtab_merge_cgraph_nodes (void);
extern tree lto_symtab_prevailing_decl (tree decl);
-extern GTY(()) VEC(tree,gc) *lto_global_var_decls;
+extern GTY(()) vec<tree, va_gc> *lto_global_var_decls;
/* In lto-opts.c. */
/* Holds all the out decl states of functions output so far in the
current output file. */
-extern VEC(lto_out_decl_state_ptr, heap) *lto_function_decl_states;
+extern vec<lto_out_decl_state_ptr> lto_function_decl_states;
/* Return true if LTO tag TAG corresponds to a tree code. */
static inline bool
{
encoder->tree_hash_table = htab_create (37, hash_fn, eq_fn, free);
encoder->next_index = 0;
- encoder->trees = NULL;
+ encoder->trees.create (0);
}
/* Hash table may be delete already. */
if (encoder->tree_hash_table)
htab_delete (encoder->tree_hash_table);
- VEC_free (tree, heap, encoder->trees);
+ encoder->trees.release ();
}
/* Return the number of trees encoded in ENCODER. */
static inline unsigned int
lto_tree_ref_encoder_size (struct lto_tree_ref_encoder *encoder)
{
- return VEC_length (tree, encoder->trees);
+ return encoder->trees.length ();
}
/* Return the IDX-th tree in ENCODER. */
lto_tree_ref_encoder_get_tree (struct lto_tree_ref_encoder *encoder,
unsigned int idx)
{
- return VEC_index (tree, encoder->trees, idx);
+ return encoder->trees[idx];
}
static inline int
lto_symtab_encoder_size (lto_symtab_encoder_t encoder)
{
- return VEC_length (lto_encoder_entry, encoder->nodes);
+ return encoder->nodes.length ();
}
/* Value used to represent failure of lto_symtab_encoder_lookup. */
static inline symtab_node
lsei_node (lto_symtab_encoder_iterator lsei)
{
- return VEC_index (lto_encoder_entry,
- lsei.encoder->nodes, lsei.index).node;
+ return lsei.encoder->nodes[lsei.index].node;
}
/* Return the node pointed to by LSI. */
static inline struct cgraph_node *
lsei_cgraph_node (lto_symtab_encoder_iterator lsei)
{
- return cgraph (VEC_index (lto_encoder_entry,
- lsei.encoder->nodes, lsei.index).node);
+ return cgraph (lsei.encoder->nodes[lsei.index].node);
}
/* Return the node pointed to by LSI. */
static inline struct varpool_node *
lsei_varpool_node (lto_symtab_encoder_iterator lsei)
{
- return varpool (VEC_index (lto_encoder_entry,
- lsei.encoder->nodes, lsei.index).node);
+ return varpool (lsei.encoder->nodes[lsei.index].node);
}
/* Return the cgraph node corresponding to REF using ENCODER. */
if (ref == LCC_NOT_FOUND)
return NULL;
- return VEC_index (lto_encoder_entry, encoder->nodes, ref).node;
+ return encoder->nodes[ref].node;
}
/* Return an iterator to the first node in LSI. */