};
typedef int inline_hints;
-DEF_VEC_O (condition);
-DEF_VEC_ALLOC_O (condition, gc);
-typedef VEC(condition,gc) *conditions;
+typedef vec<condition, va_gc> *conditions;
/* Representation of predicates i.e. formulas using conditions defined
above. Predicates are simple logical formulas in conjunctive-disjunctive
int size;
int time;
} size_time_entry;
-DEF_VEC_O (size_time_entry);
-DEF_VEC_ALLOC_O (size_time_entry, gc);
/* Function inlining information. */
struct GTY(()) inline_summary
/* Conditional size/time information. The summaries are being
merged during inlining. */
conditions conds;
- VEC(size_time_entry,gc) *entry;
+ vec<size_time_entry, va_gc> *entry;
/* Predicate on when some loop in the function becomes to have known
bounds. */
typedef struct inline_summary inline_summary_t;
-DEF_VEC_O(inline_summary_t);
-DEF_VEC_ALLOC_O(inline_summary_t,gc);
-extern GTY(()) VEC(inline_summary_t,gc) *inline_summary_vec;
+extern GTY(()) vec<inline_summary_t, va_gc> *inline_summary_vec;
/* Information kept about parameter of call site. */
struct inline_param_summary
int change_prob;
};
typedef struct inline_param_summary inline_param_summary_t;
-DEF_VEC_O(inline_param_summary_t);
-DEF_VEC_ALLOC_O(inline_param_summary_t,heap);
/* Information kept about callgraph edges. */
struct inline_edge_summary
/* Array indexed by parameters.
0 means that parameter change all the time, REG_BR_PROB_BASE means
that parameter is constant. */
- VEC (inline_param_summary_t, heap) *param;
+ vec<inline_param_summary_t> param;
};
typedef struct inline_edge_summary inline_edge_summary_t;
-DEF_VEC_O(inline_edge_summary_t);
-DEF_VEC_ALLOC_O(inline_edge_summary_t,heap);
-extern VEC(inline_edge_summary_t,heap) *inline_edge_summary_vec;
+extern vec<inline_edge_summary_t> inline_edge_summary_vec;
typedef struct edge_growth_cache_entry
{
int time, size;
inline_hints hints;
} edge_growth_cache_entry;
-DEF_VEC_O(edge_growth_cache_entry);
-DEF_VEC_ALLOC_O(edge_growth_cache_entry,heap);
-extern VEC(int,heap) *node_growth_cache;
-extern VEC(edge_growth_cache_entry,heap) *edge_growth_cache;
+extern vec<int> node_growth_cache;
+extern vec<edge_growth_cache_entry> edge_growth_cache;
/* In ipa-inline-analysis.c */
void debug_inline_summary (struct cgraph_node *);
int estimate_time_after_inlining (struct cgraph_node *, struct cgraph_edge *);
int estimate_size_after_inlining (struct cgraph_node *, struct cgraph_edge *);
void estimate_ipcp_clone_size_and_time (struct cgraph_node *,
- VEC (tree, heap) *, VEC (tree, heap) *,
- VEC (ipa_agg_jump_function_p, heap) *,
+ vec<tree>, vec<tree>,
+ vec<ipa_agg_jump_function_p>,
int *, int *, inline_hints *);
int do_estimate_growth (struct cgraph_node *);
void inline_merge_summary (struct cgraph_edge *edge);
void compute_inline_parameters (struct cgraph_node *, bool);
/* In ipa-inline-transform.c */
-bool inline_call (struct cgraph_edge *, bool, VEC (cgraph_edge_p, heap) **, int *, bool);
+bool inline_call (struct cgraph_edge *, bool, vec<cgraph_edge_p> *, int *, bool);
unsigned int inline_transform (struct cgraph_node *);
void clone_inlined_nodes (struct cgraph_edge *e, bool, bool, int *);
static inline struct inline_summary *
inline_summary (struct cgraph_node *node)
{
- return &VEC_index (inline_summary_t, inline_summary_vec, node->uid);
+ return &(*inline_summary_vec)[node->uid];
}
static inline struct inline_edge_summary *
inline_edge_summary (struct cgraph_edge *edge)
{
- return &VEC_index (inline_edge_summary_t,
- inline_edge_summary_vec, edge->uid);
+ return &inline_edge_summary_vec[edge->uid];
}
/* Return estimated unit growth after inlning all calls to NODE.
estimate_growth (struct cgraph_node *node)
{
int ret;
- if ((int)VEC_length (int, node_growth_cache) <= node->uid
- || !(ret = VEC_index (int, node_growth_cache, node->uid)))
+ if ((int)node_growth_cache.length () <= node->uid
+ || !(ret = node_growth_cache[node->uid]))
return do_estimate_growth (node);
return ret - (ret > 0);
}
estimate_edge_size (struct cgraph_edge *edge)
{
int ret;
- if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache) <= edge->uid
- || !(ret = VEC_index (edge_growth_cache_entry,
- edge_growth_cache,
- edge->uid).size))
+ if ((int)edge_growth_cache.length () <= edge->uid
+ || !(ret = edge_growth_cache[edge->uid].size))
return do_estimate_edge_size (edge);
return ret - (ret > 0);
}
estimate_edge_time (struct cgraph_edge *edge)
{
int ret;
- if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache) <= edge->uid
- || !(ret = VEC_index (edge_growth_cache_entry,
- edge_growth_cache,
- edge->uid).time))
+ if ((int)edge_growth_cache.length () <= edge->uid
+ || !(ret = edge_growth_cache[edge->uid].time))
return do_estimate_edge_time (edge);
return ret - (ret > 0);
}
estimate_edge_hints (struct cgraph_edge *edge)
{
inline_hints ret;
- if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache) <= edge->uid
- || !(ret = VEC_index (edge_growth_cache_entry,
- edge_growth_cache,
- edge->uid).hints))
+ if ((int)edge_growth_cache.length () <= edge->uid
+ || !(ret = edge_growth_cache[edge->uid].hints))
return do_estimate_edge_hints (edge);
return ret - 1;
}
static inline void
reset_node_growth_cache (struct cgraph_node *node)
{
- if ((int)VEC_length (int, node_growth_cache) > node->uid)
- VEC_replace (int, node_growth_cache, node->uid, 0);
+ if ((int)node_growth_cache.length () > node->uid)
+ node_growth_cache[node->uid] = 0;
}
/* Reset cached value for EDGE. */
static inline void
reset_edge_growth_cache (struct cgraph_edge *edge)
{
- if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache) > edge->uid)
+ if ((int)edge_growth_cache.length () > edge->uid)
{
struct edge_growth_cache_entry zero = {0, 0, 0};
- VEC_replace (edge_growth_cache_entry, edge_growth_cache, edge->uid, zero);
+ edge_growth_cache[edge->uid] = zero;
}
}