- (setf (lambda-tail-set fun) new-tail-set
- (tail-set-functions new-tail-set) (list fun)))))
- ;; The documentation on TAIL-SET-INFO doesn't tell whether it
- ;; remains valid in this case, so we nuke it on the theory that
- ;; missing information is less dangerous than incorrect information.
- (setf (tail-set-info (lambda-tail-set fun)) nil)
+ (setf (lambda-tail-set clambda) new-tail-set
+ (tail-set-funs new-tail-set) (list clambda)))))
+ ;; The documentation on TAIL-SET-INFO doesn't tell whether it could
+ ;; remain valid in this case, so we nuke it on the theory that
+ ;; missing information tends to be less dangerous than incorrect
+ ;; information.
+ (setf (tail-set-info (lambda-tail-set clambda)) nil))
+
+;;; Handle the environment semantics of LET conversion. We add CLAMBDA
+;;; and its LETs to LETs for the CALL's home function. We merge the
+;;; calls for CLAMBDA with the calls for the home function, removing
+;;; CLAMBDA in the process. We also merge the ENTRIES.
+;;;
+;;; We also unlink the function head from the component head and set
+;;; COMPONENT-REANALYZE to true to indicate that the DFO should be
+;;; recomputed.
+(defun merge-lets (clambda call)
+
+ (declare (type clambda clambda) (type basic-combination call))
+
+ (let ((component (block-component (node-block call))))
+ (unlink-blocks (component-head component) (lambda-block clambda))
+ (setf (component-lambdas component)
+ (delete clambda (component-lambdas component)))
+ (setf (component-reanalyze component) t))
+ (setf (lambda-call-lexenv clambda) (node-lexenv call))
+
+ (depart-from-tail-set clambda)