at.dms.backend
Class TreeWalker

java.lang.Object
  extended by at.dms.backend.TreeWalker
Direct Known Subclasses:
DeadcodeElimination, PeepholeOptimizer, RegisterAllocation, StackSchleduler

public abstract class TreeWalker
extends Object

This is the an abstract class to walk across the tree (DFS)


Constructor Summary
TreeWalker(at.dms.backend.BasicBlock[] bblocks, at.dms.backend.BasicBlock[] eblocks)
          Creates a new instruction handle.
 
Method Summary
protected  at.dms.backend.BasicBlock getBasicBlock(int which)
           
protected  void kill()
          Called when a branch is reached
protected abstract  void processNode(at.dms.backend.QNode node)
          Processes the node
protected  void removeNode(at.dms.backend.QNode node)
          Removes the specified node
protected  void traverse()
          Runs the deadcode algorithm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeWalker

public TreeWalker(at.dms.backend.BasicBlock[] bblocks,
                  at.dms.backend.BasicBlock[] eblocks)
Creates a new instruction handle. (Probably buggy description from cut and paste -- deleted references to wrong parameters)

Method Detail

traverse

protected void traverse()
Runs the deadcode algorithm


getBasicBlock

protected at.dms.backend.BasicBlock getBasicBlock(int which)

processNode

protected abstract void processNode(at.dms.backend.QNode node)
Processes the node

Parameters:
node - the node to be processed

kill

protected void kill()
Called when a branch is reached


removeNode

protected void removeNode(at.dms.backend.QNode node)
Removes the specified node