From: Basile Starynkevitch <basile@starynkevitch.net>
To: Pierre Vittet <piervit@pvittet.com>
Cc: gcc-patches@gcc.gnu.org, tromey@redhat.com, joseph@codesourcery.com
Subject: Re: [PATCH] c-pragma: adding a data field to pragma_handler
Date: Thu, 09 Jun 2011 07:21:00 -0000 [thread overview]
Message-ID: <20110609081635.6a3c0ad2.basile@starynkevitch.net> (raw)
In-Reply-To: <4DEFE90F.5020607@pvittet.com>
On Wed, 08 Jun 2011 23:26:39 +0200
Pierre Vittet <piervit@pvittet.com> wrote:
> I have written a test for this patch and run it (it works correctly). I
> guess there is no reason why it should not be accepted now.
> To recap, this patch add a void * data field to the pragma handler,
> allowing to pass extra data. If we want to use this field, we need to
> use the function c_register_pragma_with_data or
> c_register_pragma_with_expansion_and_data. The old
> c_register_pragma(_with_expansion) is kept compatible.
===================================================================
--- gcc/c-family/c-pragma.c (revision 174521)
+++ gcc/c-family/c-pragma.c (working copy)
@@ -1148,12 +1148,12 @@ handle_pragma_float_const_decimal64 (cpp_reader
*A }
/* A vector of registered pragma callbacks. */
+/* This is never freed as we need it during the whole execution. */
+DEF_VEC_O (internal_pragma_handler);
+DEF_VEC_ALLOC_O (internal_pragma_handler, heap);
Sorry to be picky Pierre, but that comment is not correct. It should be
instead.
/* A vector of registered pragma callbacks, which is never freed. */
What I mean is that you are right that the vector is never freed, but
it is not because it is needed during the entire execution, since
middle-end and back-end passes don't know about pragmas.
I hope your patch will be ok-ed with that small change.
Perhaps a future patch would free that registered_pragmas vector, but I
feel that is not necessary, since it is not a big vector in practice.
Regards.
--
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} ***
next prev parent reply other threads:[~2011-06-09 6:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-01 16:55 Pierre
2011-06-01 17:54 ` Basile Starynkevitch
2011-06-02 17:52 ` Tom Tromey
2011-06-03 15:32 ` Pierre Vittet
2011-06-03 15:48 ` Basile Starynkevitch
2011-06-03 20:25 ` Pierre Vittet
2011-06-08 21:35 ` Pierre Vittet
2011-06-09 7:21 ` Basile Starynkevitch [this message]
2011-06-09 9:08 ` Pierre Vittet
2011-06-09 14:53 ` Joseph S. Myers
2011-06-10 9:17 ` Pierre Vittet
2011-06-10 14:02 ` Joseph S. Myers
2011-06-10 16:15 ` Pierre Vittet
2011-06-15 15:10 ` Joseph S. Myers
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=20110609081635.6a3c0ad2.basile@starynkevitch.net \
--to=basile@starynkevitch.net \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=piervit@pvittet.com \
--cc=tromey@redhat.com \
/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).