OSDN Git Service

* Make-lang.in (cp/pt.o): Depend on vecprim.h.
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 Apr 2006 12:40:14 +0000 (12:40 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 Apr 2006 12:40:14 +0000 (12:40 +0000)
* pt.c: Include vecprim.h.
(inline_parm_levels): Change the type to VEC(int,heap) *.
(inline_parm_levels_used): Remove.
(maybe_begin_member_template_processing,
maybe_end_member_template_processing): Use VEC instead of
VARRAY.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112969 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/Make-lang.in
gcc/cp/pt.c

index 517de89..479f21a 100644 (file)
@@ -1,3 +1,13 @@
+2006-04-15  Kazu Hirata  <kazu@codesourcery.com>
+
+       * Make-lang.in (cp/pt.o): Depend on vecprim.h.
+       * pt.c: Include vecprim.h.
+       (inline_parm_levels): Change the type to VEC(int,heap) *.
+       (inline_parm_levels_used): Remove.
+       (maybe_begin_member_template_processing,
+       maybe_end_member_template_processing): Use VEC instead of
+       VARRAY.
+
 2006-04-12  Mark Mitchell  <mark@codesourcery.com>
 
        * parser.c (cp_parser_init_declarator): Initialize local variables
 2006-04-12  Mark Mitchell  <mark@codesourcery.com>
 
        * parser.c (cp_parser_init_declarator): Initialize local variables
index 63b7507..afc80fa 100644 (file)
@@ -270,7 +270,7 @@ cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) except.h \
 cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) flags.h $(EXPR_H) \
   toplev.h except.h $(TM_P_H)
 cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \
 cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) flags.h $(EXPR_H) \
   toplev.h except.h $(TM_P_H)
 cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \
-  toplev.h $(RTL_H) except.h tree-inline.h pointer-set.h gt-cp-pt.h
+  toplev.h $(RTL_H) except.h tree-inline.h pointer-set.h gt-cp-pt.h vecprim.h
 cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \
   flags.h real.h $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H)
 cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h diagnostic.h \
 cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \
   flags.h real.h $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H)
 cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h diagnostic.h \
index b0650bf..83bfd12 100644 (file)
@@ -45,6 +45,7 @@ Boston, MA 02110-1301, USA.  */
 #include "rtl.h"
 #include "timevar.h"
 #include "tree-iterator.h"
 #include "rtl.h"
 #include "timevar.h"
 #include "tree-iterator.h"
+#include "vecprim.h"
 
 /* The type of functions taking a tree, and some additional data, and
    returning an int.  */
 
 /* The type of functions taking a tree, and some additional data, and
    returning an int.  */
@@ -63,8 +64,7 @@ int processing_template_parmlist;
 static int template_header_count;
 
 static GTY(()) tree saved_trees;
 static int template_header_count;
 
 static GTY(()) tree saved_trees;
-static GTY(()) varray_type inline_parm_levels;
-static size_t inline_parm_levels_used;
+static VEC(int,heap) *inline_parm_levels;
 
 static GTY(()) tree current_tinst_level;
 
 
 static GTY(()) tree current_tinst_level;
 
@@ -396,12 +396,7 @@ maybe_begin_member_template_processing (tree decl)
 
   /* Remember how many levels of template parameters we pushed so that
      we can pop them later.  */
 
   /* Remember how many levels of template parameters we pushed so that
      we can pop them later.  */
-  if (!inline_parm_levels)
-    VARRAY_INT_INIT (inline_parm_levels, 4, "inline_parm_levels");
-  if (inline_parm_levels_used == inline_parm_levels->num_elements)
-    VARRAY_GROW (inline_parm_levels, 2 * inline_parm_levels_used);
-  VARRAY_INT (inline_parm_levels, inline_parm_levels_used) = levels;
-  ++inline_parm_levels_used;
+  VEC_safe_push (int, heap, inline_parm_levels, levels);
 }
 
 /* Undo the effects of maybe_begin_member_template_processing.  */
 }
 
 /* Undo the effects of maybe_begin_member_template_processing.  */
@@ -410,14 +405,13 @@ void
 maybe_end_member_template_processing (void)
 {
   int i;
 maybe_end_member_template_processing (void)
 {
   int i;
+  int last;
 
 
-  if (!inline_parm_levels_used)
+  if (VEC_length (int, inline_parm_levels) == 0)
     return;
 
     return;
 
-  --inline_parm_levels_used;
-  for (i = 0;
-       i < VARRAY_INT (inline_parm_levels, inline_parm_levels_used);
-       ++i)
+  last = VEC_pop (int, inline_parm_levels);
+  for (i = 0; i < last; ++i)
     {
       --processing_template_decl;
       current_template_parms = TREE_CHAIN (current_template_parms);
     {
       --processing_template_decl;
       current_template_parms = TREE_CHAIN (current_template_parms);