public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: David Edelsohn <dje.gcc@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 3/6] Emit macro expansion related diagnostics
Date: Tue, 18 Oct 2011 18:16:00 -0000	[thread overview]
Message-ID: <m3obxetd1x.fsf@redhat.com> (raw)
In-Reply-To: <m3ty76th6f.fsf@redhat.com> (Dodji Seketeli's message of "Tue, 18	Oct 2011 18:09:44 +0200")

Dodji Seketeli <dodji@redhat.com> writes:

> David Edelsohn <dje.gcc@gmail.com> writes:
>
>> Your patch broke bootstrap on AIX because of the typedef "loc_t"
>> introduced in tree-diagnostics.c.

I have committed the patch below.  Tested on x86_64-unknown-linux-gnu
only, unfortunately.  I hope it fixes the build on AIX.

From: Dodji Seketeli <dodji@seketeli.org>
Date: Tue, 18 Oct 2011 18:40:06 +0200
Subject: [PATCH] Do not use loc_t as a type name

gcc/
	* tree-diagnostic (struct loc_t): Rename into struct loc_map_pair.
	(maybe_unwind_expanded_macro_loc): Adjust.
---
 gcc/tree-diagnostic.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/tree-diagnostic.c b/gcc/tree-diagnostic.c
index 53b350b..b4b60dc 100644
--- a/gcc/tree-diagnostic.c
+++ b/gcc/tree-diagnostic.c
@@ -56,10 +56,10 @@ typedef struct
 {
   const struct line_map *map;
   source_location where;
-} loc_t;
+} loc_map_pair;
 
-DEF_VEC_O (loc_t);
-DEF_VEC_ALLOC_O (loc_t, heap);
+DEF_VEC_O (loc_map_pair);
+DEF_VEC_ALLOC_O (loc_map_pair, heap);
 
 /* Unwind the different macro expansions that lead to the token which
    location is WHERE and emit diagnostics showing the resulting
@@ -111,9 +111,9 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context,
                                  const struct line_map **first_exp_point_map)
 {
   const struct line_map *map;
-  VEC(loc_t,heap) *loc_vec = NULL;
+  VEC(loc_map_pair,heap) *loc_vec = NULL;
   unsigned ix;
-  loc_t loc, *iter;
+  loc_map_pair loc, *iter;
 
   map = linemap_lookup (line_table, where);
   if (!linemap_macro_expansion_map_p (map))
@@ -132,7 +132,7 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context,
       loc.where = where;
       loc.map = map;
 
-      VEC_safe_push (loc_t, heap, loc_vec, &loc);
+      VEC_safe_push (loc_map_pair, heap, loc_vec, &loc);
 
       /* WHERE is the location of a token inside the expansion of a
          macro.  MAP is the map holding the locations of that macro
@@ -150,7 +150,7 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context,
      first macro which expansion triggered this trace was expanded
      inside a system header.  */
   if (!LINEMAP_SYSP (map))
-    FOR_EACH_VEC_ELT (loc_t, loc_vec, ix, iter)
+    FOR_EACH_VEC_ELT (loc_map_pair, loc_vec, ix, iter)
       {
         source_location resolved_def_loc = 0, resolved_exp_loc = 0;
         diagnostic_t saved_kind;
@@ -203,7 +203,7 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context,
         context->printer->prefix = saved_prefix;
       }
 
-  VEC_free (loc_t, heap, loc_vec);
+  VEC_free (loc_map_pair, heap, loc_vec);
 }
 
 /*  This is a diagnostic finalizer implementation that is aware of
-- 
1.7.6.2



-- 
		Dodji

  reply	other threads:[~2011-10-18 17:39 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-18 15:25 David Edelsohn
2011-10-18 15:30 ` Joseph S. Myers
2011-10-18 15:37   ` Gabriel Dos Reis
2011-10-18 15:34 ` Jakub Jelinek
2011-10-18 16:56 ` Dodji Seketeli
2011-10-18 18:16   ` Dodji Seketeli [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-10-17  9:58 [PATCH 0/6] Tracking locations of tokens resulting from macro expansion Dodji Seketeli
2011-10-17  9:58 ` [PATCH 3/6] Emit macro expansion related diagnostics Dodji Seketeli
2011-10-17 10:56   ` Richard Guenther
2011-10-17 12:22     ` Dodji Seketeli
2011-10-17 14:11       ` Dodji Seketeli
2011-10-17 17:41         ` H.J. Lu
2011-10-18  0:29           ` Dodji Seketeli
2011-10-18  6:07             ` Jason Merrill
2011-10-18  9:22               ` Dodji Seketeli
2010-12-10 11:27 [PATCH 0/6] Tracking locations of tokens resulting from macro expansion Dodji Seketeli
2010-12-10 11:27 ` [PATCH 3/6] Emit macro expansion related diagnostics Dodji Seketeli
2010-12-13 15:25   ` Paolo Bonzini
2010-12-13 15:38     ` Paolo Bonzini
2010-12-13 16:30     ` Manuel López-Ibáñez
2010-12-14  7:24     ` Dodji Seketeli
2010-12-14  7:28       ` Gabriel Dos Reis
2010-12-14  8:40         ` Dodji Seketeli
2010-12-14  9:38           ` Gabriel Dos Reis
2010-12-14  9:42             ` Dodji Seketeli
2010-12-14  9:48               ` Gabriel Dos Reis
2010-12-14  7:28     ` Dodji Seketeli
2010-12-14  8:19       ` Gabriel Dos Reis
2010-12-14  8:31         ` Paolo Bonzini
2010-12-14  9:23           ` Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3obxetd1x.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).