diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-03-20 22:52:57 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-03-20 22:52:57 -0700 |
commit | 2b717de5d7949688c7c639414a5765cbc4169f8c (patch) | |
tree | a5eccc9ada7301362e5bbfe8e2cac7491f9f076b /stdlib/txr-case.txr | |
parent | ef169a36a0d65a53b5e380a75938980e01b55989 (diff) | |
download | txr-2b717de5d7949688c7c639414a5765cbc4169f8c.tar.gz txr-2b717de5d7949688c7c639414a5765cbc4169f8c.tar.bz2 txr-2b717de5d7949688c7c639414a5765cbc4169f8c.zip |
compiler: fix unused variable situations
We fix numerous unused variable situations uncovered
by the new diagnostic. Most of those occurring inside
tree-bind or mac-param-bind forms remain unfixed.
These are caused by the idiom of binding a dummy variable
as a placeholder in the structure. I am instead going to
introduce a mechanism into tree-bind/mac-param-bind
for indicating an ignored piece of structure.
* stdlib/compiler.tl (compiler (comp-if, eliminate-frame,
comp-lambda-impl, comp-typep, comp-fun-form, expand-and,
reduce-or, compiler-emit-warnings, usr:compile
with-compile-opts): Eliminate unused variables in structural
pattern matches in various ways: eliminating predicate
argument variables, replacing place holder variables by
@nil, or just using the variables when possible.
(compiler compile-in-toplevel): Remove unused saved-nlev variable.
(compiler comp-atom): Use (use oreg) form to suppress
unused parameter warning.
(compiler comp-return-form): Eliminate unused binfo variable.
The lookup-block method is called for the side effect of
marking the block used, so we keep that call.
(compiler comp-let): Unused variable specials is gone.
(compiler comp-or): Unused variable lastfrag is gone,
as is the assignment to it. There is a reason assignment
isn't use!
(compiler comp-inline-lambda): Get rid of the two variables
called dummy by folding the associated calculation into
an adjacent initform using progn and prog1.
(comp-tree-case): Remove unused ncases, lerrtest and lnext
variables.
(safe-const-eval): Remove unused reduced-form variable,
and simplify code, eliminating another local.
Diffstat (limited to 'stdlib/txr-case.txr')
0 files changed, 0 insertions, 0 deletions