+;;;; final decision on stack allocation of dynamic-extent structores
+(defun recheck-dynamic-extent-lvars (component)
+ (declare (type component component))
+ (dolist (lambda (component-lambdas component))
+ (loop for entry in (lambda-entries lambda)
+ for cleanup = (entry-cleanup entry)
+ do (when (eq (cleanup-kind cleanup) :dynamic-extent)
+ (collect ((real-dx-lvars))
+ (loop for lvar in (cleanup-info cleanup)
+ do (let ((use (lvar-uses lvar)))
+ (if (and (combination-p use)
+ (eq (basic-combination-kind use) :known)
+ (awhen (fun-info-stack-allocate-result
+ (basic-combination-fun-info use))
+ (funcall it use)))
+ (real-dx-lvars lvar)
+ (setf (lvar-dynamic-extent lvar) nil))))
+ (setf (cleanup-info cleanup) (real-dx-lvars))
+ (setf (component-dx-lvars component)
+ (append (real-dx-lvars) (component-dx-lvars component)))))))
+ (values))
+\f