From 4ed1829b72513c3284e3668de33ec2d96b3b77a9 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Sun, 21 Jun 2009 17:53:17 +0000 Subject: [PATCH] * rtl-traverse.scm (-rtx-traverse-expr): Tweak comments. (-rtx-traverse, rtx-traverse): Ditto. --- ChangeLog | 2 ++ rtl-traverse.scm | 36 ++++++++++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ee47c3..1bd0a7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2009-06-21 Doug Evans * rtl-c.scm (delay): Add FIXME, tweak formatting. + * rtl-traverse.scm (-rtx-traverse-expr): Tweak comments. + (-rtx-traverse, rtx-traverse): Ditto. 2009-06-20 Doug Evans diff --git a/rtl-traverse.scm b/rtl-traverse.scm index c1478f9..eb4f590 100644 --- a/rtl-traverse.scm +++ b/rtl-traverse.scm @@ -619,14 +619,33 @@ ) ; Traverse an expression. +; +; RTX-OBJ is the object of the (outer) expression being traversed. +; +; EXPR is the expression to be traversed. +; +; MODE is the name of the mode of EXPR. +; +; PARENT-EXPR is the expression EXPR is contained in. The top-level +; caller must pass #f for it. +; +; OP-POS is the position EXPR appears in PARENT-EXPR. The +; top-level caller must pass 0 for it. +; +; TSTATE is the current traversal state. +; +; APPSTUFF is for application specific use. +; ; For syntax expressions arguments are not pre-evaluated before calling the ; user's expression handler. Otherwise they are. -; If EXPR-FN wants to just scan the operands, rather than evaluating them, -; one thing it can do is call back to rtx-traverse-operands. -; If EXPR-FN returns #f, traverse the operands normally and return -; (rtx's-name traversed-operand1 ...). +; +; If (tstate-expr-fn TSTATE) wants to just scan the operands, rather than +; evaluating them, one thing it can do is call back to rtx-traverse-operands. +; If (tstate-expr-fn TSTATE) returns #f, traverse the operands normally and +; return (rtx's-name ([options]) mode traversed-operand1 ...), +; i.e., the canonicalized form. ; This is for semantic-compile's sake and all traversal handlers are -; required to do this if EXPR-FN returns #f. +; required to do this if the expr-fn returns #f. (define (-rtx-traverse-expr rtx-obj expr mode parent-expr op-pos tstate appstuff) (let* ((expr2 (cons (car expr) @@ -648,8 +667,9 @@ ; Main entry point for expression traversal. ; (Actually rtx-traverse is, but it's just a cover function for this.) ; -; The result is the result of the lambda EXPR-FN looks up in the case of -; expressions or an operand object (usually ) in the case of operands. +; The result is the result of the lambda (tstate-expr-fn TSTATE) looks up +; in the case of expressions, or an operand object (usually ) +; in the case of operands. ; ; EXPR is the expression to be traversed. ; @@ -748,7 +768,7 @@ ; User visible procedures to traverse an rtl expression. ; These calls -rtx-traverse to do most of the work. -; See tstate-make for an explanation of EXPR-FN. +; See tstate-make for explanations of OWNER, EXPR-FN. ; CONTEXT is a object or #f if there is none. ; LOCALS is a list of (mode . name) elements (the locals arg to `sequence'). ; APPSTUFF is for application specific use. -- 2.43.5