(let ((var (or (lexenv-find name variables) (find-free-variable name))))
(etypecase var
(leaf
- (when (and (lambda-var-p var) (lambda-var-ignorep var))
- ;; (ANSI's specification for the IGNORE declaration requires
- ;; that this be a STYLE-WARNING, not a full WARNING.)
- (compiler-style-warning "reading an ignored variable: ~S" name))
+ (when (lambda-var-p var)
+ (let ((home (continuation-home-lambda-or-null start)))
+ (when home
+ (pushnew var (lambda-calls-or-closes home))))
+ (when (lambda-var-ignorep var)
+ ;; (ANSI's specification for the IGNORE declaration requires
+ ;; that this be a STYLE-WARNING, not a full WARNING.)
+ (compiler-style-warning "reading an ignored variable: ~S" name)))
(reference-leaf start cont var))
(cons
(aver (eq (car var) 'MACRO))
(t
(ir1-convert-global-functoid-no-cmacro start cont form fun)))))
-;;; Handle the case of where the call was not a compiler macro, or was a
-;;; compiler macro and passed.
+;;; Handle the case of where the call was not a compiler macro, or was
+;;; a compiler macro and passed.
(defun ir1-convert-global-functoid-no-cmacro (start cont form fun)
(declare (type continuation start cont) (list form))
;; FIXME: Couldn't all the INFO calls here be converted into
(return))
(let ((this-cont (make-continuation)))
(ir1-convert this-start this-cont form)
- (setq this-start this-cont forms (cdr forms)))))))
+ (setq this-start this-cont
+ forms (cdr forms)))))))
(values))
\f
;;;; converting combinations
;;; Convert a function call where the function (i.e. the FUN argument)
-;;; is a LEAF. We return the COMBINATION node so that we can poke at
-;;; it if we want to.
+;;; is a LEAF. We return the COMBINATION node so that the caller can
+;;; poke at it if it wants to.
(declaim (ftype (function (continuation continuation list leaf) combination)
ir1-convert-combination))
(defun ir1-convert-combination (start cont form fun)
(specifier-type 'function))))
(values))
-\f
-;;;; hacking function names
-
-;;; This is like LAMBDA, except the result is tweaked so that FUN-NAME
-;;; can extract a name. (Also possibly the name could also be used at
-;;; compile time to emit more-informative name-based compiler
-;;; diagnostic messages as well.)
-(defmacro-mundanely named-lambda (name args &body body)
-
- ;; FIXME: For now, in this stub version, we just discard the name. A
- ;; non-stub version might use either macro-level LOAD-TIME-VALUE
- ;; hackery or customized IR1-transform level magic to actually put
- ;; the name in place.
- (aver (legal-fun-name-p name))
- `(lambda ,args ,@body))