GCC Middle and Back End API Reference
rewrite_dom_walker Class Reference
Inheritance diagram for rewrite_dom_walker:
Collaboration diagram for rewrite_dom_walker:

Public Member Functions

 rewrite_dom_walker (cdi_direction direction)
virtual void before_dom_children (basic_block)
virtual void after_dom_children (basic_block)
void walk (basic_block)

Constructor & Destructor Documentation

rewrite_dom_walker::rewrite_dom_walker ( cdi_direction  direction)
inline

References is_gimple_reg(), and SSA_NAME_VAR.


Member Function Documentation

void rewrite_dom_walker::after_dom_children ( basic_block  bb)
virtual

Called after visiting all the statements in basic block BB and all of its dominator children. Restore CURRDEFS to its original value.

 Restore CURRDEFS to its original state.   
         If we recorded an SSA_NAME, then make the SSA_NAME the
         current definition of its underlying variable.  Note that
         if the SSA_NAME is not for a GIMPLE register, the symbol
         being defined is stored in the next slot in the stack.
         This mechanism is needed because an SSA name for a
         non-register symbol may be the definition for more than
         one symbol (e.g., SFTs, aliased variables, etc).   
         If we recorded anything else, it must have been a _DECL
         node and its current reaching definition must have been
         NULL.   

Reimplemented from dom_walker.

void rewrite_dom_walker::before_dom_children ( basic_block  bb)
virtual

SSA Rewriting Step 1. Initialization, create a block local stack of reaching definitions for new SSA names produced in this block (BLOCK_DEFS). Register new definitions for every PHI node in the block.

 Mark the unwind point for this block.   
 Step 1.  Register new definitions for every PHI node in the block.
 Conceptually, all the PHI nodes are executed in parallel and each PHI
 node introduces a new version for the associated variable.   
 Step 2.  Rewrite every variable used in each statement in the block
 with its immediate reaching definitions.  Update the current definition
 of a variable when a new real or virtual definition is found.   
 Step 3.  Visit all the successor blocks of BB looking for PHI nodes.
 For every PHI node found, add a new argument containing the current
 reaching definition for the variable and the edge through which that
 definition is reaching the PHI node.   

Reimplemented from dom_walker.

void dom_walker::walk ( basic_block  bb)
inherited

Walk the dominator tree.

Recursively walk the dominator tree. BB is the basic block we are currently visiting.

     Don't worry about unreachable blocks.   
         Callback for subclasses to do custom things before we have walked
         the dominator children, but before we walk statements.   
         Mark the current BB to be popped out of the recursion stack
         once children are processed.   
     NULL is used to mark pop operations in the recursion stack.   
         Callback allowing subclasses to do custom things after we have
         walked dominator children, but before we walk statements.   

References bb_postorder, inverted_post_order_compute(), last_basic_block, n_basic_blocks, and postorder_num.


The documentation for this class was generated from the following file: