diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2010-06-30 12:13:34 +0000 |
---|---|---|
committer | Nathan Froyd <froydnj@gcc.gnu.org> | 2010-06-30 12:13:34 +0000 |
commit | 533374223d1c9eedba6d7ec1631835427aa1ca08 (patch) | |
tree | 02221e0415e3b7c8f780ac36db1e5c0cdc55b9ee /gcc | |
parent | 501d1a703a8517fd55a6dac6955cb7b4637c2f6a (diff) | |
download | gcc-533374223d1c9eedba6d7ec1631835427aa1ca08.zip gcc-533374223d1c9eedba6d7ec1631835427aa1ca08.tar.gz gcc-533374223d1c9eedba6d7ec1631835427aa1ca08.tar.bz2 |
repo.c (pending_repo): Change type to a VEC.
* repo.c (pending_repo): Change type to a VEC.
(finish_repo): Adjust for new type of pending_repo.
(repo_emit_p): Likewise.
From-SVN: r161598
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/repo.c | 12 |
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 72463e8..7bf190e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2010-06-30 Nathan Froyd <froydnj@codesourcery.com> + + * repo.c (pending_repo): Change type to a VEC. + (finish_repo): Adjust for new type of pending_repo. + (repo_emit_p): Likewise. + 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org> * tree.c: Include gimple.h. Do not include tree-flow.h diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c index 08a4d62..15c6d65 100644 --- a/gcc/cp/repo.c +++ b/gcc/cp/repo.c @@ -43,7 +43,7 @@ static FILE *open_repo_file (const char *); static char *afgets (FILE *); static FILE *reopen_repo_file_for_write (void); -static GTY(()) tree pending_repo; +static GTY(()) VEC(tree,gc) *pending_repo; static char *repo_name; static const char *old_args, *old_dir, *old_main; @@ -236,9 +236,10 @@ reopen_repo_file_for_write (void) void finish_repo (void) { - tree t; + tree val; char *dir, *args; FILE *repo_file; + unsigned ix; if (!flag_use_repository || flag_compare_debug) return; @@ -266,9 +267,10 @@ finish_repo (void) fprintf (repo_file, "\n"); } - for (t = pending_repo; t; t = TREE_CHAIN (t)) + for (ix = VEC_length (tree, pending_repo) - 1; + VEC_iterate (tree, pending_repo, ix, val); + ix--); { - tree val = TREE_VALUE (t); tree name = DECL_ASSEMBLER_NAME (val); char type = IDENTIFIER_REPO_CHOSEN (name) ? 'C' : 'O'; fprintf (repo_file, "%c %s\n", type, IDENTIFIER_POINTER (name)); @@ -352,7 +354,7 @@ repo_emit_p (tree decl) if (!DECL_REPO_AVAILABLE_P (decl)) { DECL_REPO_AVAILABLE_P (decl) = 1; - pending_repo = tree_cons (NULL_TREE, decl, pending_repo); + VEC_safe_push (tree, gc, pending_repo, decl); } return IDENTIFIER_REPO_CHOSEN (DECL_ASSEMBLER_NAME (decl)) ? 1 : ret; |