scale.score.chords
Class BeginChord

java.lang.Object
  extended by scale.common.Root
      extended by scale.score.Note
          extended by scale.score.chords.Chord
              extended by scale.score.chords.SequentialChord
                  extended by scale.score.chords.LoopHeaderChord
                      extended by scale.score.chords.BeginChord
All Implemented Interfaces:
AnnotationInterface, DisplayNode

public class BeginChord
extends LoopHeaderChord

This class is used to represent the very first node in the CFG.

$Id: BeginChord.java,v 1.28 2005-02-07 21:28:34 burrill Exp $

Copyright 2005 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.chords.LoopHeaderChord
classTrace
 
Fields inherited from class scale.score.chords.Chord
lineNumber
 
Constructor Summary
BeginChord(Scribble scribble)
          Create the first node in the CFG.
BeginChord(Scribble scribble, Chord next)
          Create the first node in the CFG.
 
Method Summary
 void addInCfgEdge(Chord node)
          Add an in-coming CFG edge.
 Chord copy()
          Make a copy of this loop header sans any data dependence information.
static int created()
          Return the number of instances of this class that were created.
 LoopPreHeaderChord getPreHeader()
          Return null for the LoopPreHeaderChord instance for this "loop".
 boolean isTrueLoop()
          Return true if this loop is an actual loop in the program.
 void visit(Predicate p)
          Process a node by calling its associated routine.
 
Methods inherited from class scale.score.chords.LoopHeaderChord
addChildLoop, addLoopExit, commonAncestor, countNodesInLoop, defPrimaryInductionVariable, getDDGraph, getDisplayColorHint, getFirstChild, getFirstExit, getInductionVar, getInductionVar, getInductionVar, getInductionVarInitExpr, getInductionVars, getInnerLoop, getInnerLoops, getInnermostLoops, getLoopChordsRecursive, getLoopExit, getLoopHeader, getLoopIndex, getLoopIndexVar, getLoopInit, getLoopNumber, getLoopTail, getLoopTest, getLowerBound, getNestedLevel, getParent, getPrimaryInductionVar, getPrimaryInductionVar, getProfEntryCnt, getProfIterationCnt, getScribble, getStepValue, getSubscripts, getSubscriptsRecursive, getTightlyNestedLoops, getTopLoop, getTripCount, getUnrollFactor, getUpperBound, hasInnerLoop, inductionVarName, inhibitLoopPermute, isAffine, isDDComplete, isInnerMostLoop, isInvariant, isLoopExit, isLoopHeader, isLoopIndex, isLoopIndex, isLoopInfoComplete, isPerfectlyNested, isPrimaryLoopIndex, isPrimaryLoopIndex, isSpecial, isSubloop, isTightlyNested, labelCFGLoopOrder, linkSubgraph, loopClean, loopContainsCall, nestedLevel, newSSAForm, numChordsInLoop, numInDataEdges, numInductionVars, numInnerLoops, numLoopExits, numPrimaryInductionVars, parentsFinished, parentsVisited, print, printSubscripts, recomputeLoop, recomputeLoops, removeChildLoop, removeLoopExit, setDDComplete, setDDIncomplete, setLoopInit, setLoopTail, setLoopTest, setParent, setProfEntryCnt, setProfIterationCnt, setScribble, setUnrollFactor, toStringSpecial, unlinkChord, usePragma, validate
 
Methods inherited from class scale.score.chords.SequentialChord
changeOutCfgEdge, clearEdge, clearEdgeMarkers, deleteInDataEdges, deleteOutCfgEdges, edgeMarked, executionCostEstimate, getDeclList, getExprList, getLoadExprList, getNextChord, getOutCfgEdge, getOutCfgEdgeArray, getTarget, indexOfOutCfgEdge, isLastInBasicBlock, isSequential, linkTo, markEdge, numOutCfgEdges, pushAllOutCfgEdges, pushOutCfgEdges, pushOutCfgEdges, pushSortedOutCfgEdges, pushSortedOutCfgEdges, removeUseDef, replaceDecl, replaceOutCfgEdge, setTarget, setTargetUnsafe
 
Methods inherited from class scale.score.chords.Chord
changeInDataEdge, changeParentOutCfgEdge, copySourceLine, deadCFGNodes, deletedCFGNodes, deleteInCfgEdge, executionOrder, expungeFromCfg, extractFromCfg, findLoopExit, findPhiChords, firstInBasicBlock, getCall, getDefExpr, getDisplayLabel, getDisplayShapeHint, getFirstInCfgEdge, getInCfgEdge, getInCfgEdge, getInCfgEdgeArray, getInDataEdge, getInDataEdgeArray, getLabel, getLoopHeader, getSourceLineNumber, gotoCFGNodes, inBasicBlock, indexOfInCfgEdge, insertAfterOutCfg, insertBeforeInCfg, isAssignChord, isBranch, isExprChord, isFirstInBasicBlock, isLoopExit, isLoopPreHeader, isLoopTail, isMarker, isPhiExpr, lastInBasicBlock, nextVisit, nthIndexOfInCfgEdge, nullCFGNodes, numInCfgEdges, numOfInCfgEdge, pushAllInCfgEdges, pushChordWhenReady, pushChordWhenReady, pushInCfgEdges, pushInCfgEdges, pushInDataEdges, recordRefs, removeDeadCode, removeDualExprs, removeFromCfg, removeRefs, reorderInCfgEdgesOfCopy, replaceInCfgEdge, setLabel, setSourceLineNumber, setVisited, visited
 
Methods inherited from class scale.score.Note
getChord, getEssentialUse, setAnnotationLevel, setReportLevel, toString
 
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

BeginChord

public BeginChord(Scribble scribble,
                  Chord next)
Create the first node in the CFG.

Parameters:
scribble - represents the entire CFG
next - is the out-going CFG edge

BeginChord

public BeginChord(Scribble scribble)
Create the first node in the CFG.

Parameters:
scribble - represents the entire CFG
Method Detail

created

public static int created()
Return the number of instances of this class that were created.


copy

public Chord copy()
Description copied from class: LoopHeaderChord
Make a copy of this loop header sans any data dependence information.

Overrides:
copy in class LoopHeaderChord
Returns:
a copy of this node

visit

public void visit(Predicate p)
Description copied from class: Note
Process a node by calling its associated routine. See the "visitor" design pattern in Design Patterns: Elements of Reusable Object-Oriented Software by E. Gamma, et al, Addison Wesley, ISBN 0-201-63361-2.

Each class has a visit(Predicate p) method. For example, in class ABC:

   public void visit(Predicate p)
   {
     p.visitABC(this);
   }
 
and the class that implements Predicate has a method
   public void visitABC(Note n)
   {
     ABC a = (ABC) n;
     ...
   }
 
Thus, the class that implements Predicate can call
   n.visit(this);
 
where n is a Note sub-class without determining which specific sub-class n is. The visit pattern basically avoids implementing a large switch statement or defining different methods in each class for some purpose.

Overrides:
visit in class LoopHeaderChord
See Also:
Predicate

addInCfgEdge

public void addInCfgEdge(Chord node)
Description copied from class: Chord
Add an in-coming CFG edge. Maintaining the validity of the CFG is the responsibility of the caller.

Overrides:
addInCfgEdge in class Chord
Parameters:
node - CFG node which is pointing to me

isTrueLoop

public boolean isTrueLoop()
Return true if this loop is an actual loop in the program.

Overrides:
isTrueLoop in class LoopHeaderChord

getPreHeader

public LoopPreHeaderChord getPreHeader()
Return null for the LoopPreHeaderChord instance for this "loop".

Overrides:
getPreHeader in class LoopHeaderChord