scale.score.expr
Class ValueExpr

java.lang.Object
  extended by scale.common.Root
      extended by scale.score.Note
          extended by scale.score.expr.Expr
              extended by scale.score.expr.ValueExpr
All Implemented Interfaces:
AnnotationInterface, DisplayNode
Direct Known Subclasses:
LiteralExpr, NilExpr

public abstract class ValueExpr
extends Expr

This class is the superclass of all value expressions.

$Id: ValueExpr.java,v 1.34 2007-10-17 13:40:01 burrill Exp $

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

A value operator is an operator with no operands. Value operators may obtain their value in one of two ways:

  1. The value may be intrinsic to the operator (e.g., true, false, and this).
  2. The value may originate from a non-graph edge (e.g., type or declaration nodes).


Field Summary
 
Fields inherited from class scale.score.expr.Expr
fpReorder, SE_DOMAIN, SE_NONE, SE_OVERFLOW, SE_STATE
 
Constructor Summary
ValueExpr(Type t)
           
 
Method Summary
 void getDeclList(java.util.AbstractCollection<Declaration> varList)
          Add all declarations referenced in this expression to the Vector.
 void getExprList(Vector<Expr> expList)
          Add all Expr instances in this expression to the Vector.
 void getLoadExprList(Vector<LoadExpr> expList)
          Add all LoadExpr instances in this expression to the Vector.
 Expr[] getOperandArray()
          Return an array of the operands to the expression.
 boolean isLoopInvariant(LoopHeaderChord loop)
          Return true if this expression is loop invariant.
 int numOperands()
          Return the number of operands to this expression.
 void pushOperands(Stack<Expr> wl)
          Push all of the operands of this expression on the Stack.
 void recordRefs(Chord stmt, References refs)
          Record any variable references in this expression in the table of references.
 void removeRefs(Chord stmt, References refs)
          Remove any variable references in this expression from the table of references.
 void removeUseDef()
          Remove any use - def links, may - use links, etc.
 boolean replaceDecl(Declaration oldDecl, Declaration newDecl)
          Replace all occurrances of a Declaration with another Declaration.
 int sideEffects()
          Return an indication of the side effects execution of this expression may cause.
 
Methods inherited from class scale.score.expr.Expr
addCast, addCast, canonical, changeInDataEdge, conditionalCopy, conditionalUnlinkExpression, containsDeclaration, copy, deleteOutDataEdge, dependsOnDeclaration, equivalent, executionOrder, executionOrdinal, findCriticalChord, findLinearCoefficient, findSubscriptExpr, getAffineExpr, getAffineRepresentation, getAliasAnnote, getCall, getConstantValue, getConstantValue, getCoreType, getCriticalChord, getDefExpr, getDisplayColorHint, getDisplayLabel, getDisplayShapeHint, getDualExpr, getInDataEdge, getInDataEdgeArray, getLoopHeader, getLow, getLValue, getOperand, getOutDataEdge, getPointedToCore, getReference, getReuseLevel, getRValue, getType, getUseDef, hasTrueFalseResult, isCast, isDefined, isDefined, isLiteralExpr, isMatchExpr, isMemoryDef, isMemRefExpr, isScalar, isSimpleExpr, loopClean, mayGenerateCall, numInDataEdges, optimizationCandidate, reduce, removeDualExprs, setCrossloopReuse, setOperand, setOutDataEdge, setSpatialReuse, setStep, setTemporalReuse, setType, setUseDef, toStringSpecial, unlinkExpression, validate, validLValue
 
Methods inherited from class scale.score.Note
executionCostEstimate, getChord, getEssentialUse, setAnnotationLevel, setReportLevel, toString, visit
 
Methods inherited from class scale.common.Root
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, trace, trace, trace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueExpr

public ValueExpr(Type t)
Method Detail

getDeclList

public void getDeclList(java.util.AbstractCollection<Declaration> varList)
Add all declarations referenced in this expression to the Vector.

Specified by:
getDeclList in class Expr

getLoadExprList

public void getLoadExprList(Vector<LoadExpr> expList)
Add all LoadExpr instances in this expression to the Vector.

Specified by:
getLoadExprList in class Expr

getExprList

public void getExprList(Vector<Expr> expList)
Add all Expr instances in this expression to the Vector.

Specified by:
getExprList in class Expr

pushOperands

public void pushOperands(Stack<Expr> wl)
Push all of the operands of this expression on the Stack.

Specified by:
pushOperands in class Expr

replaceDecl

public boolean replaceDecl(Declaration oldDecl,
                           Declaration newDecl)
Replace all occurrances of a Declaration with another Declaration. Return true if a replace occurred.

Specified by:
replaceDecl in class Expr
Returns:
true if a replace occurred.

isLoopInvariant

public boolean isLoopInvariant(LoopHeaderChord loop)
Return true if this expression is loop invariant.

Overrides:
isLoopInvariant in class Expr
Parameters:
loop - is the loop

removeUseDef

public void removeUseDef()
Remove any use - def links, may - use links, etc.

Specified by:
removeUseDef in class Expr

getOperandArray

public final Expr[] getOperandArray()
Return an array of the operands to the expression.

Specified by:
getOperandArray in class Expr

numOperands

public final int numOperands()
Return the number of operands to this expression.

Specified by:
numOperands in class Expr

recordRefs

public void recordRefs(Chord stmt,
                       References refs)
Record any variable references in this expression in the table of references.

Specified by:
recordRefs in class Expr

removeRefs

public void removeRefs(Chord stmt,
                       References refs)
Remove any variable references in this expression from the table of references.

Specified by:
removeRefs in class Expr

sideEffects

public int sideEffects()
Return an indication of the side effects execution of this expression may cause.

Specified by:
sideEffects in class Expr
See Also:
Expr.SE_NONE