scale.score.pred
Class ExpressionList

java.lang.Object
  extended by scale.score.pred.Supertype
      extended by scale.score.pred.TraceChords
          extended by scale.score.pred.ExpressionList
All Implemented Interfaces:
Predicate

public class ExpressionList
extends TraceChords

This class scans a Scribble CFG looking for lexically identical binary expressions.

$Id: ExpressionList.java,v 1.47 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.


Field Summary
 
Fields inherited from class scale.score.pred.TraceChords
rl, thisChord, wl
 
Constructor Summary
ExpressionList()
           
 
Method Summary
 java.util.Enumeration<Expr> allExprs()
          Return an enumeration of all expressions that have lexically equivalent binary expressions.
 HashSet<Chord> allOccurs(Expr original)
          Return a set of all expressions lexically equivalent to the original expression.
 int numExpressions()
          Return the number of different expressions.
 void visitBinaryExpr(BinaryExpr e)
           
 void visitChord(Chord c)
          Visit each statement and traverse the expression tree (if any) connected to it.
 
Methods inherited from class scale.score.pred.TraceChords
getChord, setChord
 
Methods inherited from class scale.score.pred.Supertype
visitAbsoluteValueExpr, visitAdditionExpr, visitAllocateExpr, visitAndExpr, visitArrayIndexExpr, visitBeginChord, 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
 

Constructor Detail

ExpressionList

public ExpressionList()
Method Detail

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. Only the low expression of a DualExpr is used.

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

Overrides:
visitChord in class TraceChords
See Also:
DualExpr

visitBinaryExpr

public void visitBinaryExpr(BinaryExpr e)
Overrides:
visitBinaryExpr in class Supertype

allExprs

public java.util.Enumeration<Expr> allExprs()
Return an enumeration of all expressions that have lexically equivalent binary expressions.


allOccurs

public HashSet<Chord> allOccurs(Expr original)
Return a set of all expressions lexically equivalent to the original expression.


numExpressions

public int numExpressions()
Return the number of different expressions.