-;;; Convert a :NORMAL or :DEBUG-ENVIRONMENT TN to an :ENVIRONMENT TN. This
-;;; requires adding :LIVE conflicts to all blocks in TN-ENV.
-(defun convert-to-environment-tn (tn tn-env)
- (declare (type tn tn) (type environment tn-env))
- (assert (member (tn-kind tn) '(:normal :debug-environment)))
- (when (eq (tn-kind tn) :debug-environment)
- (assert (eq (tn-environment tn) tn-env))
- (let ((2env (environment-info tn-env)))
- (setf (ir2-environment-debug-live-tns 2env)
- (delete tn (ir2-environment-debug-live-tns 2env)))))
- (setup-environment-tn-conflicts *component-being-compiled* tn tn-env nil)
- (setf (tn-local tn) nil)
- (setf (tn-local-number tn) nil)
+;;; Convert a :NORMAL or :DEBUG-ENVIRONMENT TN to an :ENVIRONMENT TN.
+;;; This requires adding :LIVE conflicts to all blocks in TN-PHYSENV.
+(defun convert-to-environment-tn (tn tn-physenv)
+ (declare (type tn tn) (type physenv tn-physenv))
+ (aver (member (tn-kind tn) '(:normal :debug-environment)))
+ (ecase (tn-kind tn)
+ (:debug-environment
+ (setq tn-physenv (tn-physenv tn))
+ (let* ((2env (physenv-info tn-physenv)))
+ (setf (ir2-physenv-debug-live-tns 2env)
+ (delete tn (ir2-physenv-debug-live-tns 2env)))))
+ (:normal
+ (setf (tn-local tn) nil)
+ (setf (tn-local-number tn) nil)))
+ (setup-environment-tn-conflicts *component-being-compiled* tn tn-physenv nil)