Previous: Adding a new GIMPLE statement code, Up: GIMPLE
There are two functions available for walking statements and
sequences: walk_gimple_stmt and walk_gimple_seq,
accordingly, and a third function for walking the operands in a
statement: walk_gimple_op.
This function is used to walk the current statement in
GSI, optionally using traversal state stored inWI. IfWIisNULL, no state is kept during the traversal.The callback
CALLBACK_STMTis called. IfCALLBACK_STMTreturns true, it means that the callback function has handled all the operands of the statement and it is not necessary to walk its operands.If
CALLBACK_STMTisNULLor it returns false,CALLBACK_OPis called on each operand of the statement viawalk_gimple_op. Ifwalk_gimple_opreturns non-NULLfor any operand, the remaining operands are not scanned.The return value is that returned by the last call to
walk_gimple_op, orNULL_TREEif noCALLBACK_OPis specified.
Use this function to walk the operands of statement
STMT. Every operand is walked viawalk_treewith optional state information inWI.
CALLBACK_OPis called on each operand ofSTMTviawalk_tree. Additional parameters towalk_treemust be stored inWI. For each operandOP,walk_treeis called as:walk_tree (&OP,CALLBACK_OP,WI,WI-PSET)If
CALLBACK_OPreturns non-NULLfor an operand, the remaining operands are not scanned. The return value is that returned by the last call towalk_tree, orNULL_TREEif noCALLBACK_OPis specified.
This function walks all the statements in the sequence
SEQcallingwalk_gimple_stmton each one.WIis as inwalk_gimple_stmt. Ifwalk_gimple_stmtreturns non-NULL, the walk is stopped and the value returned. Otherwise, all the statements are walked andNULL_TREEreturned.