X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ftree-browser.c;h=3803a50418557467306e40c8c94b61d1ea08812a;hb=7e4882391b8b224682064d2b57cc5dc38d291f8e;hp=ae3d270843d533b2b389525acf36a02f10a48751;hpb=e014fc6a6fa7fa85994ce6484985ea16f3e46cbd;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/tree-browser.c b/gcc/tree-browser.c index ae3d270843d..3803a504185 100644 --- a/gcc/tree-browser.c +++ b/gcc/tree-browser.c @@ -1,5 +1,6 @@ /* Tree browser. - Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2007, 2008, 2010 + Free Software Foundation, Inc. Contributed by Sebastian Pop This file is part of GCC. @@ -24,7 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "tm.h" #include "tree.h" #include "tree-inline.h" -#include "diagnostic.h" +#include "tree-pretty-print.h" #include "hashtab.h" @@ -107,7 +108,7 @@ void browse_tree (tree); /* Static variables. */ static htab_t TB_up_ht; -static tree TB_history_stack = NULL_TREE; +static VEC(tree,gc) *TB_history_stack; static int TB_verbose = 1; @@ -125,7 +126,7 @@ browse_tree (tree begin) fprintf (TB_OUT_FILE, "\nTree Browser\n"); #define TB_SET_HEAD(N) do { \ - TB_history_stack = tree_cons (NULL_TREE, (N), TB_history_stack); \ + VEC_safe_push (tree, gc, TB_history_stack, N); \ head = N; \ if (TB_verbose) \ if (head) \ @@ -875,11 +876,11 @@ find_node_with_code (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, static tree TB_history_prev (void) { - if (TB_history_stack) + if (!VEC_empty (tree, TB_history_stack)) { - TB_history_stack = TREE_CHAIN (TB_history_stack); - if (TB_history_stack) - return TREE_VALUE (TB_history_stack); + tree last = VEC_last (tree, TB_history_stack); + VEC_pop (tree, TB_history_stack); + return last; } return NULL_TREE; }