(check-fun-reached leaf node)))))
(basic-combination
(check-dest (basic-combination-fun node) node)
+ (when (and (mv-combination-p node)
+ (eq (basic-combination-kind node) :local))
+ (let ((fun-lvar (basic-combination-fun node)))
+ (unless (ref-p (lvar-uses fun-lvar))
+ (barf "function in a local mv-combination is not a LEAF: ~S" node))
+ (let ((fun (ref-leaf (lvar-use fun-lvar))))
+ (unless (lambda-p fun)
+ (barf "function ~S in a local mv-combination ~S is not local"
+ fun node))
+ (unless (eq (functional-kind fun) :mv-let)
+ (barf "function ~S in a local mv-combination ~S is not of kind :MV-LET"
+ fun node)))))
(dolist (arg (basic-combination-args node))
(cond
(arg (check-dest arg node))
(format t "v~D " (cont-num cont))
(values))
+(defun print-lvar-stack (stack &optional (stream *standard-output*))
+ (loop for (lvar . rest) on stack
+ do (format stream "~:[u~;d~]v~D~@[ ~]"
+ (lvar-dynamic-extent lvar) (cont-num lvar) rest)))
+
;;; Print out the nodes in BLOCK in a format oriented toward
;;; representing what the code does.
(defun print-nodes (block)
(format t " <deleted>"))
(pprint-newline :mandatory)
+ (awhen (block-info block)
+ (format t "start stack: ")
+ (print-lvar-stack (ir2-block-start-stack it))
+ (pprint-newline :mandatory))
(do ((ctran (block-start block) (node-next (ctran-next ctran))))
((not ctran))
(let ((node (ctran-next ctran)))
- (format t "~:[ ~;~:*~3D:~] "
+ (format t "~3D>~:[ ~;~:*~3D:~] "
+ (cont-num ctran)
(when (and (valued-node-p node) (node-lvar node))
(cont-num (node-lvar node))))
(etypecase node
(let ((kind (basic-combination-kind node)))
(format t "~(~A~A ~A~) "
(if (node-tail-p node) "tail " "")
- (if (fun-info-p kind) "known" kind)
+ kind
(type-of node))
(print-lvar (basic-combination-fun node))
(dolist (arg (basic-combination-args node))
(print-lvar (return-result node))
(print-leaf (return-lambda node)))
(entry
- (format t "entry ~S" (entry-exits node)))
+ (let ((cleanup (entry-cleanup node)))
+ (case (cleanup-kind cleanup)
+ ((:dynamic-extent)
+ (format t "entry DX~{ v~D~}"
+ (mapcar #'cont-num (cleanup-info cleanup))))
+ (t
+ (format t "entry ~S" (entry-exits node))))))
(exit
(let ((value (exit-value node)))
(cond (value
(cast-asserted-type node)))))
(pprint-newline :mandatory)))
+ (awhen (block-info block)
+ (format t "end stack: ")
+ (print-lvar-stack (ir2-block-end-stack it))
+ (pprint-newline :mandatory))
(let ((succ (block-succ block)))
(format t "successors~{ c~D~}~%"
(mapcar (lambda (x) (cont-num (block-start x))) succ))))