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]

misc gengtype micro-patch (computing fn in get_output_file_for_structure)



The following patch seems to correct a bug in
get_output_file_for_structure. Otherwise, could anyone explain why the
original thing worked? I suspect it is it was never called with a
TYPE_PARAM_STRUCT, or for some other reason I cannot understand.

Index: gcc/gengtype.c
===================================================================
--- gcc/gengtype.c	(revision 166376)
+++ gcc/gengtype.c	(working copy)
@@ -2637,9 +2637,14 @@ output_type_enum (outf_p of, type_p s)
 static outf_p
 get_output_file_for_structure (const_type_p s, type_p *param)
 {
-  const char *fn = s->u.s.line.file;
+  const char *fn;
   int i;
 
+  if (UNION_OR_STRUCT_P (s))
+    fn = s->u.s.line.file;
+  else if (s->kind == TYPE_PARAM_STRUCT)
+    fn = s->u.param_struct.line.file;
+
   /* This is a hack, and not the good kind either.  */
   for (i = NUM_PARAM - 1; i >= 0; i--)
     if (param && param[i] && param[i]->kind == TYPE_POINTER

############## gcc/ChangeLog entry
2010-11-05  Basile Starynkevitch  <basile@starynkevitch.net>
	* gengtype (get_output_file_for_structure): Fix computation of 
          file name for a TYPE_PARAM_STRUCT
############## 

Ok for trunk?
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***


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