guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reporting unused local variables


From: Andy Wingo
Subject: Re: Reporting unused local variables
Date: Fri, 24 Jul 2009 00:47:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

On Thu 23 Jul 2009 23:21, address@hidden (Ludovic Courtès) writes:

> ¡Hola!
>
> Andy Wingo <address@hidden> 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
-- 
http://wingolog.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]