diff gcc/tree-browser.c @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children
line wrap: on
line diff
--- a/gcc/tree-browser.c	Tue May 25 18:58:51 2010 +0900
+++ b/gcc/tree-browser.c	Tue Mar 22 17:18:12 2011 +0900
@@ -22,20 +22,14 @@
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "tm.h"
 #include "tree.h"
-#include "tree-inline.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
-#include "hashtab.h"
-
 
 #define TB_OUT_FILE stdout
 #define TB_IN_FILE stdin
 #define TB_NIY fprintf (TB_OUT_FILE, "Sorry this command is not yet implemented.\n")
 #define TB_WF fprintf (TB_OUT_FILE, "Warning, this command failed.\n")
 
-
 /* Structures for handling Tree Browser's commands.  */
 #define DEFTBCODE(COMMAND, STRING, HELP)   COMMAND,
 enum TB_Comm_code {
@@ -109,7 +103,7 @@
 
 /* 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;
 
 
@@ -127,7 +121,7 @@
   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)                                                         \
@@ -877,11 +871,11 @@
 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;
 }