- (let ((use (continuation-use this-cont))
- (uses (block-start-uses block)))
- (when (and (null use) (= (length uses) 1))
- (barf "~S has a unique use, but no USE." this-cont))
- (dolist (node uses)
- (unless (eq (node-cont node) this-cont)
- (barf "The USE ~S for START in ~S has wrong CONT." node block))
- (check-node-reached node)))
-
- (let* ((last-cont (node-cont last))
- (cont-block (continuation-block last-cont))
- (dest (continuation-dest last-cont)))
- (ecase (continuation-kind last-cont)
- (:deleted)
- (:deleted-block-start
- (let ((dest (continuation-dest last-cont)))
- (when dest
- (check-node-reached dest)))
- (unless (member last (block-start-uses cont-block))
- (barf "LAST in ~S is missing from uses of its Cont." block)))
- (:block-start
- (check-node-reached (continuation-next last-cont))
- (unless (member last (block-start-uses cont-block))
- (barf "LAST in ~S is missing from uses of its Cont." block)))
- (:inside-block
- (unless (eq cont-block block)
- (barf "CONT of LAST in ~S is in a different BLOCK." block))
- (unless (eq (continuation-use last-cont) last)
- (barf "USE is not LAST in CONT of LAST in ~S." block))
- (when (continuation-next last-cont)
- (barf "CONT of LAST has a NEXT in ~S." block))))
-
- (when dest
- (check-node-reached dest)))