scale.score.pred
Class TraceChords

java.lang.Object
  extended by scale.score.pred.Supertype
      extended by scale.score.pred.TraceChords
All Implemented Interfaces:
Predicate
Direct Known Subclasses:
ExpressionList, FindAliases, PlaceIndirectOps

public abstract class TraceChords
extends Supertype

This class visits all the expressions in the a Scribble graph.

$Id: TraceChords.java,v 1.36 2007-10-04 19:58:34 burrill Exp $

Copyright 2008 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.

This class visits all the expressions in the a Scribble graph, but does so on a per statement basis. Hence, each expression node may be visited multiple times.

For each statement in a Scribble graph, this class initiates a traversal of the data dependence graph associated with the current node. The current statement is recorded in a "global" variable.


Field Summary
protected  Stack<Expr> rl
          Allows expressions to be visited in leaf -> root order.
protected  Chord thisChord
          The current statment in the traversal.
protected  Stack<Expr> wl
          Work list of expressions to visit.
 
Constructor Summary
TraceChords()
          Construct a predicate to visit the statements in a Scribble graph.
 
Method Summary
 Chord getChord()
          Return the current statment begin traversed.
protected  void setChord(Chord stmt)
          Set the statement to be used.
 void visitChord(Chord c)
          Visit each statement and traverse the expression tree (if any) connected to it.
 
Methods inherited from class scale.score.pred.Supertype
visitAbsoluteValueExpr, visitAdditionExpr, visitAllocateExpr, visitAndExpr, visitArrayIndexExpr, visitBeginChord, visitBinaryExpr, visitBitAndExpr, visitBitComplementExpr, visitBitOrExpr, visitBitShiftExpr, visitBitXorExpr, visitBranchChord, visitCallExpr, visitCallFunctionExpr, visitCallMethodExpr, visitCompareExpr, visitComplexValueExpr, visitConditionalExpr, visitConversionExpr, visitDecisionChord, visitDivisionExpr, visitDualExpr, visitEndChord, visitEqualityExpr, visitExitChord, visitExponentiationExpr, visitExpr, visitExprChord, visitExprPhiExpr, visitFieldExpr, visitGotoChord, visitGreaterEqualExpr, visitGreaterExpr, visitIfThenElseChord, visitLeaveChord, visitLessEqualExpr, visitLessExpr, visitLiteralExpr, visitLoadDeclAddressExpr, visitLoadDeclValueExpr, visitLoadExpr, visitLoadFieldAddressExpr, visitLoadFieldValueExpr, visitLoadValueIndirectExpr, visitLoopExitChord, visitLoopHeaderChord, visitLoopInitChord, visitLoopPreHeaderChord, visitLoopTailChord, visitMarkerChord, visitMaxExpr, visitMinExpr, visitMultiplicationExpr, visitNaryExpr, visitNegativeExpr, visitNilExpr, visitNote, visitNotEqualExpr, visitNotExpr, visitNullChord, visitOrExpr, visitPhiExpr, visitPhiExprChord, visitRemainderExpr, visitReturnChord, visitSequentialChord, visitSubscriptExpr, visitSubtractionExpr, visitSwitchChord, visitTernaryExpr, visitTranscendental2Expr, visitTranscendentalExpr, visitUnaryExpr, visitVaArgExpr, visitVaEndExpr, visitValueExpr, visitVarArgExpr, visitVaStartExpr, visitVectorExpr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thisChord

protected Chord thisChord
The current statment in the traversal.


wl

protected Stack<Expr> wl
Work list of expressions to visit.


rl

protected Stack<Expr> rl
Allows expressions to be visited in leaf -> root order.

Constructor Detail

TraceChords

public TraceChords()
Construct a predicate to visit the statements in a Scribble graph.

Method Detail

getChord

public Chord getChord()
Return the current statment begin traversed.


setChord

protected void setChord(Chord stmt)
Set the statement to be used. This method is used when only expressions are visited.

Parameters:
stmt - is the statement associated with the expression.

visitChord

public void visitChord(Chord c)
Visit each statement and traverse the expression tree (if any) connected to it. The expression tree is traversed leaf-to-root which is necessary for some algorithms such as alias analyses.

Note - this logic assumes that the expression tree is a tree and not a dag.

Overrides:
visitChord in class Supertype