aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-06-18 15:51:37 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-06-18 15:51:37 +0000
commitbc87224e9341b186905d8ac849aeb59463ae4f6b (patch)
tree099f2565c44bc86efadd0114c6699753ab14efa5
parent76d971ccfb886e192d3d21705b1d9327d61f8827 (diff)
downloadgcc-bc87224e9341b186905d8ac849aeb59463ae4f6b.zip
gcc-bc87224e9341b186905d8ac849aeb59463ae4f6b.tar.gz
gcc-bc87224e9341b186905d8ac849aeb59463ae4f6b.tar.bz2
function.h (types_used_by_cur_var_decl): Change type to a VEC.
gcc/ * function.h (types_used_by_cur_var_decl): Change type to a VEC. * function.c (types_used_by_cur_var_decl): Likewise. (used_types_insert): Adjust for new type of types_used_by_cur_var_decl. gcc/c-family/ * c-common.c (record_types_used_by_current_var_decl): Adjust for new type of types_used_by_cur_var_decl. From-SVN: r161001
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-common.c13
-rw-r--r--gcc/function.c6
-rw-r--r--gcc/function.h6
5 files changed, 20 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ef71ff7..0e723ef 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2010-06-18 Nathan Froyd <froydnj@codesourcery.com>
+ * function.h (types_used_by_cur_var_decl): Change type to a VEC.
+ * function.c (types_used_by_cur_var_decl): Likewise.
+ (used_types_insert): Adjust for new type of
+ types_used_by_cur_var_decl.
+
+2010-06-18 Nathan Froyd <froydnj@codesourcery.com>
+
* tree.h (record_layout_info): Change type of pending_statics field
to a VEC.
* stor-layout.c (start_record_layout): Store NULL into
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index fcf46b8..c13367e 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-18 Nathan Froyd <froydnj@codesourcery.com>
+
+ * c-common.c (record_types_used_by_current_var_decl): Adjust for
+ new type of types_used_by_cur_var_decl.
+
2010-06-17 Joern Rennecke <joern.rennecke@embecosm.com>
PR bootstrap/44512
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 63cd728..4bafd1c 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -9191,17 +9191,10 @@ record_types_used_by_current_var_decl (tree decl)
{
gcc_assert (decl && DECL_P (decl) && TREE_STATIC (decl));
- if (types_used_by_cur_var_decl)
+ while (!VEC_empty (tree, types_used_by_cur_var_decl))
{
- tree node;
- for (node = types_used_by_cur_var_decl;
- node;
- node = TREE_CHAIN (node))
- {
- tree type = TREE_PURPOSE (node);
- types_used_by_var_decl_insert (type, decl);
- }
- types_used_by_cur_var_decl = NULL;
+ tree type = VEC_pop (tree, types_used_by_cur_var_decl);
+ types_used_by_var_decl_insert (type, decl);
}
}
diff --git a/gcc/function.c b/gcc/function.c
index c5b80b0..5c31955 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -132,7 +132,7 @@ static GTY((if_marked ("ggc_marked_p"), param_is (struct rtx_def)))
htab_t types_used_by_vars_hash = NULL;
-tree types_used_by_cur_var_decl = NULL;
+VEC(tree,gc) *types_used_by_cur_var_decl;
/* Forward declarations. */
@@ -5562,9 +5562,7 @@ used_types_insert (tree t)
/* So this might be a type referenced by a global variable.
Record that type so that we can later decide to emit its debug
information. */
- types_used_by_cur_var_decl =
- tree_cons (t, NULL, types_used_by_cur_var_decl);
-
+ VEC_safe_push (tree, gc, types_used_by_cur_var_decl, t);
}
}
diff --git a/gcc/function.h b/gcc/function.h
index deb170d..6170348 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -645,9 +645,9 @@ hashval_t types_used_by_vars_do_hash (const void*);
int types_used_by_vars_eq (const void *, const void *);
void types_used_by_var_decl_insert (tree type, tree var_decl);
-/* During parsing of a global variable, this linked list points to
- the list of types referenced by the global variable. */
-extern GTY(()) tree types_used_by_cur_var_decl;
+/* During parsing of a global variable, this vector contains the types
+ referenced by the global variable. */
+extern GTY(()) VEC(tree,gc) *types_used_by_cur_var_decl;
/* cfun shouldn't be set directly; use one of these functions instead. */