Patchwork gengtype patch removing location_s

login
register
mail settings
Submitter Basile Starynkevitch
Date Oct. 18, 2010, 5 p.m.
Message ID <20101018190058.f77cb42c.basile@starynkevitch.net>
Download mbox | patch
Permalink /patch/68210/
State New
Headers show

Comments

Basile Starynkevitch - Oct. 18, 2010, 5 p.m.
On Tue, 21 Sep 2010 21:12:17 +0200
Basile Starynkevitch <basile@starynkevitch.net> wrote:
http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01709.html

and Laurynas latter replied in http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01742.html
>> Since struct location_s is no longer used inside GCC, the hack in
>> new_structure to handle it is removed.

> This is excellent, but it really should be a separate patch.

Here it is, against trunk 165645.

### gcc/ChangeLog entry ###

2010-10-18  Basile Starynkevitch  <basile@starynkevitch.net>
	* gengtype (new_structure): Remove ad-hoc "location_s" processing.
###
Ok for trunk?
Laurynas Biveinis - Oct. 19, 2010, 2:48 a.m.
2010/10/18 Basile Starynkevitch <basile@starynkevitch.net>:
> 2010-10-18  Basile Starynkevitch  <basile@starynkevitch.net>
>        * gengtype (new_structure): Remove ad-hoc "location_s" processing.

* gengtype.c

OK with ChangeLog fix and...

  /* temporary kludge - gengtype doesn't handle conditionals or
     macros.  Ignore any attempt to define struct location_s, unless
     it is coming from this file (main() sets it up safely). */
  if (!strcmp (name, "location_s") && !isunion && pos->file != this_file)
    return find_structure (name, 0);

...this fragment removed too (beginning of new_structure).

BTW grep shows that location_s is mentioned in a comment in
libcpp/include/input.h, bonus points if you take care of that too :)

Thanks,

Patch

Index: gcc/gengtype.c
===================================================================
--- gcc/gengtype.c	(revision 165645)
+++ gcc/gengtype.c	(working copy)
@@ -756,20 +756,6 @@  new_structure (const char *name, int isunion, stru
   if (s->u.s.lang_struct)
     s->u.s.lang_struct->u.s.bitmap |= bitmap;
 
-  /* Reset location_s's location to input.h so that we know where to
-     write out its mark routine.  */
-  if (!strcmp (name, "location_s") && !isunion && pos->file == this_file)
-    {
-      size_t n;
-      for (n = 0; n < num_gt_files; n++)
-	if (!strcmp (gt_files[n] + strlen (gt_files[n]) - strlen ("input.h"),
-		     "input.h"))
-	  {
-	    s->u.s.line.file = gt_files[n];
-	    break;
-	  }
-    }
-
   return s;
 }