From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6331 invoked by alias); 3 May 2011 19:07:17 -0000 Received: (qmail 6285 invoked by uid 22791); 3 May 2011 19:07:15 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 May 2011 19:07:00 +0000 Received: (qmail 21433 invoked from network); 3 May 2011 19:06:59 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 May 2011 19:06:59 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1QHKvy-0003CF-1P; Tue, 03 May 2011 19:06:58 +0000 Date: Tue, 03 May 2011 19:07:00 -0000 From: "Joseph S. Myers" To: Eric Botcazou cc: Jan Hubicka , gcc-patches@gcc.gnu.org, Xinliang David Li Subject: Re: [google]: initialize language field for clone function struct In-Reply-To: <201105032034.51751.ebotcazou@adacore.com> Message-ID: References: <20110503164614.GB18705@kam.mff.cuni.cz> <201105032034.51751.ebotcazou@adacore.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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-05/txt/msg00211.txt.bz2 On Tue, 3 May 2011, Eric Botcazou wrote: > > I am however completely missing the point of this langhook and doc is not > > exactly informative either: > > > > /* Returns nonzero if we are in the global binding level. Ada > > returns -1 for an undocumented reason used in stor-layout.c. */ > > > > What is the purpose of this hook? > > I've seen things far more undocumented in GCC than this one ;-) > > > tree > variable_size (tree size) > { > > [...] > > /* If the language-processor is to take responsibility for variable-sized > items (e.g., languages which have elaboration procedures like Ada), > just return SIZE unchanged. */ > if (lang_hooks.decls.global_bindings_p () < 0) > return size; In my view we should require front ends to take responsibility for variable-size types, and get rid of this language-independent function (copying such parts as are needed into the front ends that need them). C for example uses its own version as the language-independent one isn't right for C. Similarly, the pending_size code should be local to front ends. -- Joseph S. Myers joseph@codesourcery.com