-;;; Note: we deliberately don't use the DO-NODES macro, since the block can be
-;;; split out from underneath us, and DO-NODES would scan past the block end in that
-;;; case.
-(macrolet ((frob ()
- '(do* ((node (continuation-next (block-start block))
- (continuation-next cont))
- (cont (node-cont node) (node-cont node))
- ;; KLUDGE: Since LEXENV and POLICY seem to be only used
- ;; inside this FROB, why not define them in here instead of
- ;; requiring them to be defined externally both in
- ;; LTN-ANALYZE and LTN-ANALYZE-BLOCK? Or perhaps just
- ;; define this whole FROB as an inline function? (Right now
- ;; I don't want to make even a small unnecessary change
- ;; like this, but'd prefer to wait until the system runs so
- ;; that I can test it immediately after the change.)
- ;; -- WHN 19990808
- )
- (())
- (unless (eq (node-lexenv node) lexenv)
- (setq policy (translation-policy node))
- (setq lexenv (node-lexenv node)))
-
- (etypecase node
- (ref)
- (combination
- (case (basic-combination-kind node)
- (:local (ltn-analyze-local-call node policy))
- ((:full :error) (ltn-default-call node policy))
- (t
- (ltn-analyze-known-call node policy))))
- (cif
- (ltn-analyze-if node policy))
- (creturn
- (ltn-analyze-return node policy))
- ((or bind entry))
- (exit
- (ltn-analyze-exit node policy))
- (cset (ltn-analyze-set node policy))
- (mv-combination
- (ecase (basic-combination-kind node)
- (:local (ltn-analyze-mv-bind node policy))
- ((:full :error) (ltn-analyze-mv-call node policy)))))
-
- (when (eq node (block-last block))
- (return)))))
-
-;;; Loop over the blocks in Component, doing stuff to nodes that receive
-;;; values. In addition to the stuff done by FROB, we also see whether there
-;;; are any unknown values receivers, making notations in the components
-;;; Generators and Receivers as appropriate.
+;;; Note: we deliberately don't use the DO-NODES macro, since the
+;;; block can be split out from underneath us, and DO-NODES would scan
+;;; past the block end in that case.
+(defun ltn-analyze-block (block)
+ (do* ((node (block-start-node block)
+ (ctran-next ctran))
+ (ctran (node-next node) (node-next node)))
+ (nil)
+ (etypecase node
+ (ref)
+ (combination
+ (ecase (basic-combination-kind node)
+ (:local (ltn-analyze-local-call node))
+ ((:full :error) (ltn-default-call node))
+ (:known
+ (ltn-analyze-known-call node))))
+ (cif (ltn-analyze-if node))
+ (creturn (ltn-analyze-return node))
+ ((or bind entry))
+ (exit (ltn-analyze-exit node))
+ (cset (ltn-analyze-set node))
+ (cast (ltn-analyze-cast node))
+ (mv-combination
+ (ecase (basic-combination-kind node)
+ (:local
+ (ltn-analyze-mv-bind node))
+ ((:full :error)
+ (ltn-analyze-mv-call node)))))
+ (when (eq node (block-last block))
+ (return))))
+
+;;; Loop over the blocks in COMPONENT, doing stuff to nodes that
+;;; receive values. In addition to the stuff done by FROB, we also see
+;;; whether there are any unknown values receivers, making notations
+;;; in the components' GENERATORS and RECEIVERS as appropriate.