-;;; lambda.
-;;;
-;;; If the function isn't a LET, we unlink the function head and tail
-;;; from the component head and tail to indicate that the code is
-;;; unreachable. We also delete the function from COMPONENT-LAMBDAS
-;;; (it won't be there before local call analysis, but no matter.) If
-;;; the lambda was never referenced, we give a note.
-;;;
-;;; If the lambda is an XEP, then we null out the ENTRY-FUN in its
-;;; ENTRY-FUN so that people will know that it is not an entry point
-;;; anymore.
-(defun delete-lambda (leaf)
- (declare (type clambda leaf))
- (let ((kind (functional-kind leaf))
- (bind (lambda-bind leaf)))
- (aver (not (member kind '(:deleted :optional :toplevel))))
- (aver (not (functional-has-external-references-p leaf)))
- (setf (functional-kind leaf) :deleted)
- (setf (lambda-bind leaf) nil)
- (dolist (let (lambda-lets leaf))
+;;; CLAMBDA.
+(defun delete-lambda (clambda)
+ (declare (type clambda clambda))
+ (let ((original-kind (functional-kind clambda))
+ (bind (lambda-bind clambda)))
+ (aver (not (member original-kind '(:deleted :optional :toplevel))))
+ (aver (not (functional-has-external-references-p clambda)))
+ (setf (functional-kind clambda) :deleted)
+ (setf (lambda-bind clambda) nil)
+ (dolist (let (lambda-lets clambda))