This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[c++ patch] tidy up


Hi,
this little patch tidies up the conversion of template parms from
a TREE_LIST to TREE_VEC.  I was getting very confused as to why
the resultant TREE_VEC pointed into a each part of the list.

built & tested on i686-pc-linux-gnu, ok?

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2001-11-30  Nathan Sidwell  <nathan@codesourcery.com>

	* pt.c (end_template_parm_list): Clear TREE_CHAIN of each parm.

Index: pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.559
diff -c -3 -p -r1.559 pt.c
*** pt.c	2001/11/22 02:32:56	1.559
--- pt.c	2001/11/30 17:11:43
*************** end_template_parm_list (parms)
*** 2000,2016 ****
       tree parms;
  {
    int nparms;
!   tree parm;
    tree saved_parmlist = make_tree_vec (list_length (parms));
  
    current_template_parms
      = tree_cons (size_int (processing_template_decl),
  		 saved_parmlist, current_template_parms);
  
!   for (parm = parms, nparms = 0; 
!        parm; 
!        parm = TREE_CHAIN (parm), nparms++)
!     TREE_VEC_ELT (saved_parmlist, nparms) = parm;
  
    --processing_template_parmlist;
  
--- 2000,2018 ----
       tree parms;
  {
    int nparms;
!   tree parm, next;
    tree saved_parmlist = make_tree_vec (list_length (parms));
  
    current_template_parms
      = tree_cons (size_int (processing_template_decl),
  		 saved_parmlist, current_template_parms);
  
!   for (parm = parms, nparms = 0; parm; parm = next, nparms++)
!     {
!       next = TREE_CHAIN (parm);
!       TREE_VEC_ELT (saved_parmlist, nparms) = parm;
!       TREE_CHAIN (parm) = NULL_TREE;
!     }
  
    --processing_template_parmlist;
  
*************** get_bindings_overload (fn, decl, explici
*** 9188,9194 ****
  
  /* Return the innermost template arguments that, when applied to a
     template specialization whose innermost template parameters are
!    TPARMS, and whose specialization arguments are ARGS, yield the
     ARGS.  
  
     For example, suppose we have:
--- 9190,9196 ----
  
  /* Return the innermost template arguments that, when applied to a
     template specialization whose innermost template parameters are
!    TPARMS, and whose specialization arguments are PARMS, yield the
     ARGS.  
  
     For example, suppose we have:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]