scale.score.analyses
Class VirtualVar

java.lang.Object
  extended by scale.common.Root
      extended by scale.clef.Node
          extended by scale.clef.decl.Declaration
              extended by scale.clef.decl.ValueDecl
                  extended by scale.clef.decl.VariableDecl
                      extended by scale.score.analyses.VirtualVar
All Implemented Interfaces:
java.lang.Comparable, AnnotationInterface, DisplayNode
Direct Known Subclasses:
SubVirtualVar, SuperVirtualVar

public class VirtualVar
extends VariableDecl

A class that represents a virtual variable which is used to handle aliasing and indirect operations in SSA form.

$Id: VirtualVar.java,v 1.28 2006-02-28 16:37:08 burrill Exp $

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

A virtual variable is a pseudo-declaration. We don't actually generate code for the declaration, but we treat it like a declaration in the representation.


Field Summary
protected  ECR var
          A virtual variable represents a group of variables with similar alias characteristics.
 
Fields inherited from class scale.clef.decl.VariableDecl
ignoreAddressTaken
 
Constructor Summary
VirtualVar(java.lang.String name, ECR v)
          Create a new virtual variable with a given name and associated ECR.
 
Method Summary
 Declaration copy(java.lang.String name)
          Make a copy of this declaration using a new name.
static int created()
          Return the number of instances of this class created.
 java.lang.String getDisplayLabel()
          Return a String suitable for labeling this node in a graphical display.
 ECR getECR()
           
 VirtualVar getSubset(int i)
          Return the specified subset variable.
 VirtualVar getSuperset()
          Return the superset virtual variable.
 boolean inSubsets(VirtualVar vv)
          Return true if vv is in the subset.
 boolean isSuper()
          Return true if this is a superset virtual variable.
 boolean isVirtual()
          Return true if the declaration is a virtual variable.
 int numSubsets()
          Return the number of subsets of the super virtual variable.
 boolean subsetEquiv(VirtualVar vv)
          Return true if virtual variable param is equal to this, or this is a superset.
 
Methods inherited from class scale.clef.decl.VariableDecl
addressTaken, computeAttributes, declareFtnResultVar, getAddressRegister, getConstantValue, getDisplacement, getInitialValue, getOriginal, getStorageLoc, getValueRegister, hasHiddenAliases, hasHiddenPtrAliases, hasInvalidArrayReferences, inMemory, isCommonBaseVar, isCommonBaseVariable, isConst, isFtnResultVar, isNotAliasCandidate, isNotSSACandidate, isReferenced, isRestricted, isStatic, isStorageLocSet, isTemporary, isVariableDecl, isVolatile, optimizationCandidate, residency, returnVariableDecl, setAddressRegister, setAddressTaken, setDisplacement, setHiddenAliases, setHiddenPtrAliases, setInitialValue, setInvalidArrayReferences, setReferenced, setResidency, setStorageLoc, setTemporary, setType, setValue, setValueRegister, setVisibility, shouldBeInRegister, specifyCommonBaseVariable, toStringSpecial, valueRegMode, visit
 
Methods inherited from class scale.clef.decl.ValueDecl
getChild, getValue, isValueDecl, numChildren, returnValueDecl
 
Methods inherited from class scale.clef.decl.Declaration
accessibility, compareTo, getActualType, getAlias, getCoreType, getDecl, getDisplayColorHint, getDisplayShapeHint, getMode, getName, getPointedToCore, getTag, getType, hashCode, isCaseLabelDecl, isEnumElementDecl, isEquivalenceDecl, isExceptionDecl, isFieldDecl, isFileDecl, isFormalDecl, isForwardProcedureDecl, isGlobal, isLabelDecl, isProcedureDecl, isPure, isRenamed, isRenamedVariableDecl, isRoutineDecl, isStmtFtnDecl, isTypeDecl, isTypeName, isUnknownFormals, isWeak, returnCaseLabelDecl, returnEnumElementDecl, returnEquivalenceDecl, returnExceptionDecl, returnFieldDecl, returnFileDecl, returnFormalDecl, returnForwardProcedureDecl, returnLabelDecl, returnProcedureDecl, returnRenamedVariableDecl, returnRoutineDecl, returnStmtFtnDecl, returnTypeDecl, returnTypeName, returnUnknownFormals, setAccessibility, setAlias, setName, setTag, setWeak, visibility
 
Methods inherited from class scale.clef.Node
getSourceLineNumber, setAnnotationLevel, setReportLevel, setSourceLineNumber, toString, toString, toStringChildren
 
Methods inherited from class scale.common.Root
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, trace, trace, trace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

var

protected ECR var
A virtual variable represents a group of variables with similar alias characteristics. We represent the group of variables using Steensgaard's ECR data structure.

Constructor Detail

VirtualVar

public VirtualVar(java.lang.String name,
                  ECR v)
Create a new virtual variable with a given name and associated ECR. The virtual variable does not have a type.

Method Detail

created

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


getDisplayLabel

public java.lang.String getDisplayLabel()
Description copied from class: Declaration
Return a String suitable for labeling this node in a graphical display. This method should be over-ridden as it simplay returns the class name.

Specified by:
getDisplayLabel in interface DisplayNode
Overrides:
getDisplayLabel in class Declaration

getSuperset

public VirtualVar getSuperset()
Return the superset virtual variable.


isSuper

public boolean isSuper()
Return true if this is a superset virtual variable.


isVirtual

public boolean isVirtual()
Return true if the declaration is a virtual variable.

Overrides:
isVirtual in class Declaration

inSubsets

public boolean inSubsets(VirtualVar vv)
Return true if vv is in the subset.


numSubsets

public int numSubsets()
Return the number of subsets of the super virtual variable.


getSubset

public VirtualVar getSubset(int i)
Return the specified subset variable.


subsetEquiv

public boolean subsetEquiv(VirtualVar vv)
Return true if virtual variable param is equal to this, or this is a superset.


copy

public Declaration copy(java.lang.String name)
Make a copy of this declaration using a new name.

Overrides:
copy in class VariableDecl

getECR

public ECR getECR()