- (format t "~%block start c~D" (cont-num (block-start block)))
-
- (let ((last (block-last block)))
- (terpri)
- (do ((cont (block-start block) (node-cont (continuation-next cont))))
- (())
- (let ((node (continuation-next cont)))
- (format t "~3D: " (cont-num (node-cont node)))
- (etypecase node
- (ref (print-leaf (ref-leaf node)))
- (basic-combination
- (let ((kind (basic-combination-kind node)))
- (format t "~(~A ~A~) c~D"
- (if (fun-info-p kind) "known" kind)
- (type-of node)
- (cont-num (basic-combination-fun node)))
- (dolist (arg (basic-combination-args node))
- (if arg
- (print-continuation arg)
- (format t " <none>")))))
- (cset
- (write-string "set ")
- (print-leaf (set-var node))
- (print-continuation (set-value node)))
- (cif
- (format t "if c~D" (cont-num (if-test node)))
- (print-continuation (block-start (if-consequent node)))
- (print-continuation (block-start (if-alternative node))))
- (bind
- (write-string "bind ")
- (print-leaf (bind-lambda node)))
- (creturn
- (format t "return c~D " (cont-num (return-result node)))
- (print-leaf (return-lambda node)))
- (entry
- (format t "entry ~S" (entry-exits node)))
- (exit
- (let ((value (exit-value node)))
- (cond (value
- (format t "exit c~D" (cont-num value)))
- ((exit-entry node)
- (format t "exit <no value>"))
- (t
- (format t "exit <degenerate>"))))))
- (terpri)
- (when (eq node last) (return)))))
-
- (let ((succ (block-succ block)))
- (format t "successors~{ c~D~}~%"
- (mapcar (lambda (x) (cont-num (block-start x))) succ)))
+ (pprint-logical-block (nil nil)
+ (format t "~:@_IR1 block ~D start c~D"
+ (block-number block) (cont-num (block-start block)))
+
+ (let ((last (block-last block)))
+ (pprint-newline :mandatory)
+ (do ((cont (block-start block) (node-cont (continuation-next cont))))
+ ((not cont))
+ (let ((node (continuation-next cont)))
+ (format t "~3D: " (cont-num (node-cont node)))
+ (etypecase node
+ (ref (print-leaf (ref-leaf node)))
+ (basic-combination
+ (let ((kind (basic-combination-kind node)))
+ (format t "~(~A ~A~) c~D"
+ (if (fun-info-p kind) "known" kind)
+ (type-of node)
+ (cont-num (basic-combination-fun node)))
+ (dolist (arg (basic-combination-args node))
+ (if arg
+ (print-continuation arg)
+ (format t " <none>")))))
+ (cset
+ (write-string "set ")
+ (print-leaf (set-var node))
+ (print-continuation (set-value node)))
+ (cif
+ (format t "if c~D" (cont-num (if-test node)))
+ (print-continuation (block-start (if-consequent node)))
+ (print-continuation (block-start (if-alternative node))))
+ (bind
+ (write-string "bind ")
+ (print-leaf (bind-lambda node)))
+ (creturn
+ (format t "return c~D " (cont-num (return-result node)))
+ (print-leaf (return-lambda node)))
+ (entry
+ (format t "entry ~S" (entry-exits node)))
+ (exit
+ (let ((value (exit-value node)))
+ (cond (value
+ (format t "exit c~D" (cont-num value)))
+ ((exit-entry node)
+ (format t "exit <no value>"))
+ (t
+ (format t "exit <degenerate>"))))))
+ (pprint-newline :mandatory)
+ (when (eq node last) (return)))))
+
+ (let ((succ (block-succ block)))
+ (format t "successors~{ c~D~}~%"
+ (mapcar (lambda (x) (cont-num (block-start x))) succ))))