From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Reporting unused local variables Date: Fri, 24 Jul 2009 00:47:12 +0200 Message-ID: References: <87ocs8rn0y.fsf@gnu.org> <874otvvvgs.fsf@gnu.org> <87ljmfxfhm.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1248389690 21151 80.91.229.12 (23 Jul 2009 22:54:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jul 2009 22:54:50 +0000 (UTC) Cc: guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jul 24 00:54:43 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MU7BP-00060i-O9 for guile-devel@m.gmane.org; Fri, 24 Jul 2009 00:54:40 +0200 Original-Received: from localhost ([127.0.0.1]:59124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MU7BP-0004mj-9X for guile-devel@m.gmane.org; Thu, 23 Jul 2009 18:54:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MU7BF-0004ks-4h for guile-devel@gnu.org; Thu, 23 Jul 2009 18:54:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MU7B6-0004fd-1s for guile-devel@gnu.org; Thu, 23 Jul 2009 18:54:24 -0400 Original-Received: from [199.232.76.173] (port=42251 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MU7B5-0004fX-On for guile-devel@gnu.org; Thu, 23 Jul 2009 18:54:19 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:54353 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MU7B0-0002w5-MK; Thu, 23 Jul 2009 18:54:14 -0400 Original-Received: from localhost.localdomain (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id D3C0EFEA7; Thu, 23 Jul 2009 18:54:12 -0400 (EDT) Original-Received: from unquote (unknown [81.38.186.175]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 13D88FEA2; Thu, 23 Jul 2009 18:54:10 -0400 (EDT) In-Reply-To: <87ljmfxfhm.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 23 Jul 2009 23:21:25 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: BD7D7D14-77DB-11DE-8DD1-AEF1826986A2-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:8953 Archived-At: On Thu 23 Jul 2009 23:21, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > =C2=A1Hola! > > Andy Wingo writes: > >> OK, here's another idea. Why don't we keep this as a separate pass -- >> enabled if you pass a compilation option. That way it can be more >> functional, and you can keep approximate source information. > > By "pass", you mean a new "language" in the tower? As in > `lookup-compilation-order'? No, just a procedure to run on the tree-il, after tree-il optimization but before tree-il->glil compilation >> At each node you have a set of identifiers that are bound but not >> referenced. If the node is a reference, you remove that identifier >> from the set. If it is a binding, you add the bindings, traverse >> subexpressions, then do a set difference between your bindings and the >> return value from subexpression traversal -- that's your unused >> bindings. > > Yes, this is roughly what I initially did[*], so that sounds reasonable. > [*] http://thread.gmane.org/gmane.lisp.guile.devel/8795 Apologies for being MIA, then ;-) Cheers, Andy --=20 http://wingolog.org/