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 | 32dd7406ef88dffe3bf5c5477e4487e617da483b (patch) | |
tree | a5eccc9ada7301362e5bbfe8e2cac7491f9f076b /eval.c | |
parent | f38d01586474c741aa813f5dc99ae5eb4e718009 (diff) | |
download | txr-32dd7406ef88dffe3bf5c5477e4487e617da483b.tar.gz txr-32dd7406ef88dffe3bf5c5477e4487e617da483b.tar.bz2 txr-32dd7406ef88dffe3bf5c5477e4487e617da483b.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 'eval.c')
0 files changed, 0 insertions, 0 deletions