From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5321 invoked by alias); 7 Mar 2003 21:22:01 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 5288 invoked from network); 7 Mar 2003 21:21:59 -0000 Received: from unknown (HELO mail-out2.apple.com) (17.254.0.51) by 172.16.49.205 with SMTP; 7 Mar 2003 21:21:59 -0000 Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out2.apple.com (8.12.7/8.12.7) with ESMTP id h27LLwnR018955 for ; Fri, 7 Mar 2003 13:21:58 -0800 (PST) Received: from scv1.apple.com (scv1.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id ; Fri, 7 Mar 2003 13:21:32 -0800 Received: from bothner.com (il0102b-dhcp93.apple.com [17.201.26.143]) by scv1.apple.com (8.11.3/8.11.3) with ESMTP id h27LLZs07928; Fri, 7 Mar 2003 13:21:35 -0800 (PST) Message-ID: <3E690741.1080101@bothner.com> Date: Fri, 07 Mar 2003 21:57:00 -0000 From: Per Bothner User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Geoff Keating CC: GCC Hackers Subject: Re: Putting C++ code into gcc front end References: <3E64C09A.9070500@comsys.se> <87isuzjb71.fsf@fleche.redhat.com> <3E67FBA6.1000907@bothner.com> <20030307125056.GA23848@gauvain.u-strasbg.fr> <20030307202316.GD31657@daikokuya.co.uk> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-03/txt/msg00533.txt.bz2 Geoff Keating wrote: > Yes, I completely agree. In particular, we currently represent types > and statements/expressions using trees, and I believe it's never the > case that you can substitute one for the other (and what would that > mean, anyway?); so why don't we have completely distinct type_tree and > expr_tree data structures? Agree in principle, but there are some complications. For example decls can be expressions, which means expr_tree and decl_tree have to be the same. If you have "unresolved identifier" in the tree, then identifier has to be an expr_tree. You can solve both of these cleanly by adding a DECL_REFERENCE expression type. > Of course, this has been mentioned several times before, and no-one's > produced a patch... Is there a way to make this change incrementally, such that you could use type_tree in a variable or parameter declaration, without having to fix everywhere at once? Of course C++ would make that too easier ... For C, I can't think of any way, except making type_tree just be a typedef for tree, which might still be worthwhile for documentation purposes. -- --Per Bothner per@bothner.com http://www.bothner.com/per/