/* Functions for writing LTO sections.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2013 Free Software Foundation, Inc.
Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
This file is part of GCC.
#include "hashtab.h"
#include "basic-block.h"
#include "tree-flow.h"
-#include "tree-pass.h"
#include "cgraph.h"
#include "function.h"
#include "ggc.h"
#include "lto-streamer.h"
#include "lto-compress.h"
-static VEC(lto_out_decl_state_ptr, heap) *decl_state_stack;
+static vec<lto_out_decl_state_ptr> decl_state_stack;
/* List of out decl states used by functions. We use this to
generate the decl directory later. */
-VEC(lto_out_decl_state_ptr, heap) *lto_function_decl_states;
+vec<lto_out_decl_state_ptr> lto_function_decl_states;
/* Returns a hash code for P. */
hashval_t
new_slot->t = name;
new_slot->slot_num = index;
*slot = new_slot;
- VEC_safe_push (tree, heap, encoder->trees, name);
+ encoder->trees.safe_push (name);
new_entry_p = TRUE;
}
else
memset (&header, 0, sizeof (struct lto_simple_header));
header.lto_header.major_version = LTO_major_version;
header.lto_header.minor_version = LTO_minor_version;
- header.lto_header.section_type = LTO_section_cgraph;
header.compressed_size = 0;
struct lto_out_decl_state *
lto_get_out_decl_state (void)
{
- return VEC_last (lto_out_decl_state_ptr, decl_state_stack);
+ return decl_state_stack.last ();
}
/* Push STATE to top of out decl stack. */
void
lto_push_out_decl_state (struct lto_out_decl_state *state)
{
- VEC_safe_push (lto_out_decl_state_ptr, heap, decl_state_stack, state);
+ decl_state_stack.safe_push (state);
}
/* Pop the currently used out-decl state from top of stack. */
struct lto_out_decl_state *
lto_pop_out_decl_state (void)
{
- return VEC_pop (lto_out_decl_state_ptr, decl_state_stack);
+ return decl_state_stack.pop ();
}
/* Record STATE after it has been used in serializing the body of
state->streams[i].tree_hash_table = NULL;
}
state->fn_decl = fn_decl;
- VEC_safe_push (lto_out_decl_state_ptr, heap, lto_function_decl_states,
- state);
+ lto_function_decl_states.safe_push (state);
}