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]

Re: [PATCH] [C++] Save space in template_parm_index_s



On Jan 4, 2004, at 21:33, Andrew Pinski wrote:


In template_parm_index_s, just like saved_scope, HOST_WIDE_INT is too big for the
index and the other fields as no one is going to have 2^15-1 template parameters or
levels, yes if this happens we can just change it back but it is not going to happen
with the limit of memory as it is now.


Ok? Bootstrapped on powerpc-apple-darwin7.2.0 with no regressions?

Thanks,
Andrew Pinski

I forgot I also needed this patch to fix the warnings:


ChangeLog:

* ptree.c (cxx_print_type): TEMPLATE_TYPE_IDX, TEMPLATE_TYPE_LEVEL, and
TEMPLATE_TYPE_ORIG_LEVEL are no longer HOST_WIDE_INT so use the right format.
(cxx_print_xnode): Likewise.


Patch:
Index: ptree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/ptree.c,v
retrieving revision 1.38
diff -u -p -r1.38 ptree.c
--- ptree.c	9 Dec 2003 04:08:49 -0000	1.38
+++ ptree.c	5 Jan 2004 05:37:05 -0000
@@ -67,8 +67,7 @@ cxx_print_type (FILE *file, tree node, i
     case TEMPLATE_TEMPLATE_PARM:
     case BOUND_TEMPLATE_TEMPLATE_PARM:
       indent_to (file, indent + 3);
-      fprintf (file, "index " HOST_WIDE_INT_PRINT_DEC " level "
-	       HOST_WIDE_INT_PRINT_DEC " orig_level " HOST_WIDE_INT_PRINT_DEC,
+      fprintf (file, "index 0x%x level 0x%x orig_level 0x%x",
 	       TEMPLATE_TYPE_IDX (node), TEMPLATE_TYPE_LEVEL (node),
 	       TEMPLATE_TYPE_ORIG_LEVEL (node));
       return;
@@ -172,8 +171,7 @@ cxx_print_xnode (FILE *file, tree node,
       break;
     case TEMPLATE_PARM_INDEX:
       indent_to (file, indent + 3);
-      fprintf (file, "index " HOST_WIDE_INT_PRINT_DEC " level "
-	       HOST_WIDE_INT_PRINT_DEC " orig_level " HOST_WIDE_INT_PRINT_DEC,
+      fprintf (file, "index 0x%x level 0x%x orig_level 0x%x",
 	       TEMPLATE_PARM_IDX (node), TEMPLATE_PARM_LEVEL (node),
 	       TEMPLATE_PARM_ORIG_LEVEL (node));
       break;


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