OSDN Git Service

/cp
[pf3gnuchains/gcc-fork.git] / gcc / lto-section-in.c
index 16fd086..e7928c4 100644 (file)
@@ -1,6 +1,6 @@
 /* Input functions for reading LTO sections.
 
-   Copyright 2009 Free Software Foundation, Inc.
+   Copyright 2009, 2010 Free Software Foundation, Inc.
    Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
 
 This file is part of GCC.
@@ -23,26 +23,25 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "toplev.h"
 #include "tree.h"
 #include "expr.h"
 #include "flags.h"
 #include "params.h"
 #include "input.h"
-#include "varray.h"
 #include "hashtab.h"
 #include "basic-block.h"
 #include "tree-flow.h"
 #include "cgraph.h"
 #include "function.h"
 #include "ggc.h"
-#include "diagnostic.h"
+#include "diagnostic-core.h"
 #include "except.h"
 #include "vec.h"
 #include "timevar.h"
 #include "output.h"
 #include "lto-streamer.h"
 #include "lto-compress.h"
+#include "ggc.h"
 
 /* Section names.  These must correspond to the values of
    enum lto_section_type.  */
@@ -50,14 +49,17 @@ const char *lto_section_name[LTO_N_SECTION_TYPES] =
 {
   "decls",
   "function_body",
-  "static_initializer",
+  "statics",
   "cgraph",
-  "varpool",
-  "jump_funcs"
-  "ipa_pure_const",
-  "ipa_reference",
+  "vars",
+  "refs",
+  "jmpfuncs",
+  "pureconst",
+  "reference",
   "symtab",
-  "opts"
+  "opts",
+  "cgraphopt",
+  "inline"
 };
 
 unsigned char
@@ -431,11 +433,7 @@ lto_get_decl_name_mapping (struct lto_file_decl_data *decl_data,
 struct lto_in_decl_state *
 lto_new_in_decl_state (void)
 {
-  struct lto_in_decl_state *state;
-
-  state = ((struct lto_in_decl_state *) xmalloc (sizeof (*state)));
-  memset (state, 0, sizeof (*state));
-  return state;
+  return ggc_alloc_cleared_lto_in_decl_state ();
 }
 
 /* Delete STATE and its components. */
@@ -447,8 +445,8 @@ lto_delete_in_decl_state (struct lto_in_decl_state *state)
 
   for (i = 0; i < LTO_N_DECL_STREAMS; i++)
     if (state->streams[i].trees)
-      free (state->streams[i].trees);
-  free (state);
+      ggc_free (state->streams[i].trees);
+  ggc_free (state);
 }
 
 /* Hashtable helpers. lto_in_decl_states are hash by their function decls. */