From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13668 invoked by alias); 9 Jun 2011 06:16:58 -0000 Received: (qmail 13658 invoked by uid 22791); 9 Jun 2011 06:16:57 -0000 X-SWARE-Spam-Status: No, hits=0.2 required=5.0 tests=AWL,BAYES_40,RDNS_DYNAMIC,TVD_RCVD_IP X-Spam-Check-By: sourceware.org Received: from 195-14-0-142.nuxit.net (HELO de558.ispfr.net) (195.14.0.142) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Jun 2011 06:16:43 +0000 Received: from ours.starynkevitch.net ([213.41.244.95] helo=glinka.lesours) by de558.ispfr.net with smtp (Exim 4.72) (envelope-from ) id 1QUYXm-0004DR-6T; Thu, 09 Jun 2011 08:16:38 +0200 Date: Thu, 09 Jun 2011 07:21:00 -0000 From: Basile Starynkevitch To: Pierre Vittet Cc: gcc-patches@gcc.gnu.org, tromey@redhat.com, joseph@codesourcery.com Subject: Re: [PATCH] c-pragma: adding a data field to pragma_handler Message-Id: <20110609081635.6a3c0ad2.basile@starynkevitch.net> In-Reply-To: <4DEFE90F.5020607@pvittet.com> References: <4DE66ECE.5030102@laposte.net> <4DE8FE4D.6050404@pvittet.com> <4DEFE90F.5020607@pvittet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00703.txt.bz2 On Wed, 08 Jun 2011 23:26:39 +0200 Pierre Vittet 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: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mine, sont seulement les miennes} ***