coins.sym
Class SubpImpl

java.lang.Object
  extended bycoins.sym.SymImpl
      extended bycoins.sym.SubpImpl
All Implemented Interfaces:
java.lang.Cloneable, HasStringObject, Subp, Sym, Sym0

public class SubpImpl
extends SymImpl
implements Subp

Subp Class Subp (subprogram) class. Subprogram means such program construct as procedure, function, method, constructor, destructor, statement function, library function, etc. Each subprogram has its local symbol table which is maintained by pushSymbolTable, popSymbolTable, reopenSymbolTable in SymbolTableInterface. Enhancement is required to implement object oriented languages.


Field Summary
protected  java.util.Set fAccessedSyms
          Set of FlowAnalSym symbols accessed in this subprogram
protected  IrList fCallList
          List of subprograms called from this subprogram
protected  Label fEndLabel
           
protected  int fErrorCount
           
protected  java.lang.Object fFlowInf
          Information locally used for flow analysis, optimization, parallelyzation, etc.
protected  Stmt fHirBody
          The HIR body statement of this subprogram
protected  BlockStmt fInitiationProcess
          initiation procedure of this subprogram
protected  IrList fLabelDefList
          Defineded labels in this subprogram
protected  SymTable fLocalSymTable
           
protected  Subp fNextSubp
          Link to the next subproguram
protected  boolean fNoParamSpec
          fIsAnyParamPermitted is true if any number of parameters of any kind are permitted.
protected  java.lang.Object fOptInf
           
protected  Param fOptParam
          Optional parameter generated for this subprogram if this subprogram has optional parameters.
protected  java.lang.Object fParallelInf
           
protected  IrList fParamList
          Parameter IrList of this subprogram.
protected  boolean fParamListIsSet
          fParamListIsSet is changed to true if fParamList is set (so as not to change it any more).
protected  IrList fParamListTemp
          Parameter type list of this subprogram.
protected  IrList fParamTypeListTemp
          Parameter type list temporally used in addParamType.
protected  Type fReturnValueType
           
 boolean fSafeArrayAll
          fSafeArrayAll is set to true if #pragama safeArrayAll is given.
protected  Label fStartLabel
           
protected  SubpDefinition fSubpDefinition
          The IR SubpDefinition node of this subprogram
protected  int fSubpKind
          Kind of this subprogram
protected  int fTempCount
           
protected  int fTempDCount
           
protected  IrList fTempDVarList
          List of temporal double variables ganerated by compiler
protected  IrList fTempVarList
          List of temporal long variables ganerated by compiler
 
Fields inherited from class coins.sym.SymImpl
fDbgLevel, fDefinedIn, fFlagBox, fKind, fName, fNextSym, fRecordedIn, fSourceInf, fSymInf, fType, fUniqueNameSym, fWork, machineParam, sourceLanguage, symRoot
 
Fields inherited from interface coins.sym.Sym
KIND_NAME, VISIBILITY
 
Fields inherited from interface coins.sym.Sym0
FLAG_ADDRESS_TAKEN, FLAG_CASTLESS_SUBP, FLAG_COMMON, FLAG_COMPLEX_STRUCT, FLAG_DERIVED_SYM, FLAG_GENERATED_SYM, FLAG_INCOMPLETE_TYPE, FLAG_POINTER_OPERATION, FLAG_REGION_ELEM, FLAG_RESERVED_NAME, FLAG_SIZEOF_TAKEN, FLAG_UNFIXED_SIZE, FLAG_UNIFORM_SIZE, FLAG_VALUE_IS_ASSIGNED, KIND_AREG, KIND_BOOL_CONST, KIND_CHAR_CONST, KIND_CONST_FIRST, KIND_CONST_LAST, KIND_ELEM, KIND_EXP_ID, KIND_FLOAT_CONST, KIND_INT_CONST, KIND_LABEL, KIND_MREG, KIND_NAMED_CONST, KIND_OTHER, KIND_PARAM, KIND_REMOVED, KIND_STRING_CONST, KIND_SUBP, KIND_TAG, KIND_TYPE, KIND_VAR, SYM_COMPILE_UNIT, SYM_EXTERN, SYM_PRIVATE, SYM_PROTECTED, SYM_PUBLIC
 
Constructor Summary
SubpImpl(SymRoot pSymRoot)
           
SubpImpl(SymRoot pSymRoot, java.lang.String pName, Type pReturnValueType, Sym pDefinedIn)
           
 
Method Summary
 void addInitiationStmt(Stmt pInitiation)
          addInitiationStmt Add pInitiation as the HIR statement in initiation procedure.
 void addParam(Param pParam)
          addParam
 void addParamType(Type pParamType)
          addParamType Add parameter type to a temporal parameter type list.
 void addToCallList(Subp pCallee)
          addToCallList Add pCallee as a subprogram in the call list of this subprogram.
 void addToErrorCount(int pCount)
          addToErrorCount Add pCount to the number of syntax/semantic error counter of this subprogram.
 void addToLabelDefList(Label pLabel)
           
 void buildLabelRefList()
          Build the list of labels defined in the subprogram so as getLabelDefList() returns proper list, and build the list of LabelNode for every labels to show the label node refering them.
 void closeSubpHeader()
          closeSubpHeader
 void closeSubpPrototype()
          closeSubpPrototype
 java.util.Set getAccessedSyms()
           
 IrList getCallList()
          getCallList Get the list of subprograms called in this subprogram.
 Label getEndLabel()
          getEndLabel setEndLabel Get/set a label attached to the exit point of this subprogram.
 int getErrorCount()
          getErrorCount Get the number of syntax/semantic errors of this subprogram.
 java.lang.Object getFlowInf()
          getEntryBBlock
 Stmt getHirBody()
          getHirBody Get the procedural body of this subprogram represented in high level intermediate representation (HIR).
 IrList getLabelDefList()
          getLabelDefList Get the list of labels defined in this subprogram.
 Subp getNextSubp()
          getNextSubp Get the subprogram next to this one having the same scope as this.
 java.lang.Object getOptInf()
           
 Param getOptionalParam()
          getOptionalParam -- TO BE DELETED Get the formal parameter generated by setOptionalParam for this subprogram.
 java.lang.Object getParallelInf()
           
 IrList getParamList()
          getParamList Get the parameter list of this subprogram.
 IrList getParamTypeList()
          getParamTypeList Get the parameter type list of this subprogram.
 Type getReturnValueType()
          getReturnValueType Get the return value type of this subprogram.
 Label getStartLabel()
          getStartLabel setStartLabel Get/set a label attached to the entry point of this subprogram.
 Stmt getStmtWithLabel(Label pLabel)
          getStmtWithLabel Get the HIR Stmt attached with pLabel.
 SubpDefinition getSubpDefinition()
          getFirstLocalVar //## Deleted.
 int getSubpKind()
          getSubpKind Get subprogram kind (subpOrdinary/subpMember/subpConstructor/subpDestructor).
 SymTable getSymTable()
          getSymTable Get the symbol table local to this subprogram.
 int getVisibility()
          getVisibility setVisibility Get/set the visibility attribute of the subprogram.
 boolean hasNoParamSpec()
          
 boolean hasOptionalParam()
          hasOptionalParam
 BlockStmt initiationProcedure()
          initiationProcedure Get HIR initiation procedure of this subprogram, where the initiation procedure is executed at the first invocation of this subprogram or at the beginning of execution and skipped in later invocations.
 boolean isSafeArrayAll()
           
 void printLabelRefList()
          Print the label reference list built by buildLabelRefList().
 void removeLabelDef(Label pLabel)
           
 void resetLabelLink()
          resetLabelLink Reset label reference list of labels in this subprogram.
 void setAccessedSyms(java.util.Set pAccessedSyms)
           
 void setEndLabel(Label pLabel)
           
 void setFlowInf(java.lang.Object pInf)
           
 void setHirBody(Stmt pHirBody, Label pStartLabel, Label pEndLabel)
          setHirBody Set the procedural body of this subprogram represented in high level intermediate representation (HIR).
 void setNextSubp(Subp pNext)
          setNextSubp Set pNext as the subprogram next to this one and make the original next subprogram as the next one of pNext.
 void setNoParamSpec()
          Permit any number of parameters of any type for this subprogram.
 void setOptInf(java.lang.Object pInf)
           
 Param setOptionalParam()
          setOptionalParam -- TO BE DELETED Generate a formal parameter corresponding to "..." in parameter specification and make getOptionalParam() to be true for this subprogram.
 void setParallelInf(java.lang.Object pInf)
           
 void setReturnValueType(Type pType)
          setReturnValueType Set the return value type of this subprogram.
 void setStartLabel(Label pLabel)
           
 void setSubpDefinition(SubpDefinition pSubpDefinition)
          setSubpDefinition Set the SubpDefinition node defining the IR body of this subprogram.
 void setSubpKind(int pSubpKind)
          setSubpKind Set subprogram kind (subpOrdinary/subpMember/subpConstructor/subpDestructor).
 void setSymTable(SymTable pSymTable)
          setSymTable Set the symbol table local to this subprogram.
 void setVisibility(int pVisibility)
          SetVisibility Sset the visibility attribute of the subprogram.
 java.lang.String toStringDetail()
          toStringDetail Get detailed attributes of this symbol in text which is not interned.
 
Methods inherited from class coins.sym.SymImpl
bareStringConst, baseType, boolConst, charConst, charConst, charConst, definedType, definedType, defineElem, defineLabel, defineParam, defineRegionVar, defineSubp, defineVar, defineVar, derivedSym, enumType, enumType, floatConst, floatConst, getDefinedColumn, getDefinedFile, getDefinedIn, getDefinedInName, getDefinedLine, getFlag, getInf, getName, getNameOrNull, getNextSym, getOrAddInf, getOriginalSym, getOriginalSym, getPureName, getRecordedIn, getSourceInf, getSymKind, getSymKindName, getSymType, getUniqueName, getWork, intConst, intConst, intObject, isGlobal, isHIR, isRemoved, isSym, linkSym, makeCstring, makeCstringWithTrailing0, makeEnumTypeName, makeExpString, makeJavaString, makeStructUnionTypeName, makeSubpTypeName, makeSubpTypeName, makeVectorTypeName, makeVectorTypeName, makeVectorTypeName, namedConst, namedConst, pointerType, pointerType, pointerType, pointerType, pointerType, print, print, regionType, regionType, remove, setDefinedFile, setDefinedIn, setDefinedLine, setFlag, setOriginalSym, setParameters, setRecordedIn, setSourceInf, setSymKind, setSymType, setUniqueNameSym, setWork, stringConst, stringConstFromQuotedString, structType, structType, subpType, subpType, symbol, toString, toStringShort, unionType, unionType, vectorType, vectorType, vectorType, vectorType, vectorTypeUnfixed, vectorTypeUnfixed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface coins.sym.Sym
baseType, boolConst, charConst, defineVar, derivedSym, floatConst, getDefinedColumn, getDefinedInName, getDefinedLine, getInf, getNameOrNull, getOrAddInf, getOriginalSym, getOriginalSym, getPureName, getSymKindName, getWork, intConst, intObject, isRemoved, makeCstring, makeCstringWithTrailing0, makeEnumTypeName, makeJavaString, makeStructUnionTypeName, makeSubpTypeName, makeVectorTypeName, makeVectorTypeName, makeVectorTypeName, namedConst, pointerType, pointerType, pointerType, regionType, remove, setDefinedFile, setDefinedIn, setDefinedLine, setRecordedIn, setSymKind, setSymType, setUniqueNameSym, setWork, stringConstFromQuotedString, symbol, toStringShort, vectorType, vectorType, vectorType, vectorTypeUnfixed
 
Methods inherited from interface coins.sym.Sym0
charConst, definedType, defineElem, defineLabel, defineParam, defineSubp, defineVar, enumType, floatConst, getDefinedFile, getDefinedIn, getFlag, getName, getNextSym, getRecordedIn, getSymKind, getSymType, getUniqueName, intConst, isGlobal, namedConst, pointerType, setFlag, stringConst, structType, subpType, unionType, vectorType, vectorTypeUnfixed
 

Field Detail

fNextSubp

protected Subp fNextSubp
Link to the next subproguram


fSubpKind

protected int fSubpKind
Kind of this subprogram


fReturnValueType

protected Type fReturnValueType

fLocalSymTable

protected SymTable fLocalSymTable

fParamList

protected IrList fParamList
Parameter IrList of this subprogram. This is effective only after closeSubpHeader is called.


fParamListIsSet

protected boolean fParamListIsSet
fParamListIsSet is changed to true if fParamList is set (so as not to change it any more). fParamList is set by closeSubpHeader but not set by closeSubpPrototype.


fParamListTemp

protected IrList fParamListTemp
Parameter type list of this subprogram. This is temporally used for constructing SubpType and getParamTypeList() of SubpType does not refer this field.


fParamTypeListTemp

protected IrList fParamTypeListTemp
Parameter type list temporally used in addParamType.


fOptParam

protected Param fOptParam
Optional parameter generated for this subprogram if this subprogram has optional parameters. fOptParam is null if this subprogram has no optional param.


fNoParamSpec

protected boolean fNoParamSpec
fIsAnyParamPermitted is true if any number of parameters of any kind are permitted.


fTempVarList

protected IrList fTempVarList
List of temporal long variables ganerated by compiler


fTempCount

protected int fTempCount

fTempDVarList

protected IrList fTempDVarList
List of temporal double variables ganerated by compiler


fTempDCount

protected int fTempDCount

fSubpDefinition

protected SubpDefinition fSubpDefinition
The IR SubpDefinition node of this subprogram


fHirBody

protected Stmt fHirBody
The HIR body statement of this subprogram


fInitiationProcess

protected BlockStmt fInitiationProcess
initiation procedure of this subprogram


fLabelDefList

protected IrList fLabelDefList
Defineded labels in this subprogram


fStartLabel

protected Label fStartLabel

fEndLabel

protected Label fEndLabel

fCallList

protected IrList fCallList
List of subprograms called from this subprogram


fAccessedSyms

protected java.util.Set fAccessedSyms
Set of FlowAnalSym symbols accessed in this subprogram


fSafeArrayAll

public boolean fSafeArrayAll
fSafeArrayAll is set to true if #pragama safeArrayAll is given. It means that all subscripted variables and pointer expressions representing array elements never access memory location outside the corresponding array and their subscript values and offset values are all non-negative.


fFlowInf

protected java.lang.Object fFlowInf
Information locally used for flow analysis, optimization, parallelyzation, etc. of this subprogram.


fOptInf

protected java.lang.Object fOptInf

fParallelInf

protected java.lang.Object fParallelInf

fErrorCount

protected int fErrorCount
Constructor Detail

SubpImpl

public SubpImpl(SymRoot pSymRoot)

SubpImpl

public SubpImpl(SymRoot pSymRoot,
                java.lang.String pName,
                Type pReturnValueType,
                Sym pDefinedIn)
Method Detail

getNextSubp

public Subp getNextSubp()
getNextSubp Get the subprogram next to this one having the same scope as this. Default sequence is defined according to the order of creation by defineUnique, etc. in SymInterface, but it may also be set by setNextSubp.

Specified by:
getNextSubp in interface Subp
Returns:
the next subprogram which has the same DefinedIn as this subprogram. If there is no next subprogram, then return null.

setNextSubp

public void setNextSubp(Subp pNext)
setNextSubp Set pNext as the subprogram next to this one and make the original next subprogram as the next one of pNext.

Specified by:
setNextSubp in interface Subp
Parameters:
pNext - subprogram defined in the same scope as this subprogram.

getSubpKind

public int getSubpKind()
getSubpKind Get subprogram kind (subpOrdinary/subpMember/subpConstructor/subpDestructor).

Specified by:
getSubpKind in interface Subp
Returns:
int The subprogram kind of this subprogram.

setSubpKind

public void setSubpKind(int pSubpKind)
setSubpKind Set subprogram kind (subpOrdinary/subpMember/subpConstructor/subpDestructor).

Specified by:
setSubpKind in interface Subp
Parameters:
pSubpKind - subprogram kind to be set to this subprogram. setSubpKind set the subprogram kind of this subprogram as pSubpKind.

getVisibility

public int getVisibility()
getVisibility setVisibility Get/set the visibility attribute of the subprogram. "this" may be any subprogram.

Specified by:
getVisibility in interface Subp
Returns:
the visibility attribute of the subprogram

setVisibility

public void setVisibility(int pVisibility)
Description copied from interface: Subp
SetVisibility Sset the visibility attribute of the subprogram.

Specified by:
setVisibility in interface Subp
Parameters:
pVisibility - visibility attribute to be set by setVisibility. (SYM_EXTERN, SYM_PUBLIC, SYM_PROTECTED, SYM_PRIVATE, SYM_COMPILE_UNIT)

getSymTable

public SymTable getSymTable()
Description copied from interface: Subp
getSymTable Get the symbol table local to this subprogram. (The symbol table given by setSymTable.)

Specified by:
getSymTable in interface Subp
Returns:
the symbol table local to this subprogram.

setSymTable

public void setSymTable(SymTable pSymTable)
Description copied from interface: Subp
setSymTable Set the symbol table local to this subprogram. If the symbol table is nested, then give the outermost symbol table local to this subprogram.

Specified by:
setSymTable in interface Subp

getReturnValueType

public Type getReturnValueType()
Description copied from interface: Subp
getReturnValueType Get the return value type of this subprogram.

Specified by:
getReturnValueType in interface Subp
Returns:
the return value type.

setReturnValueType

public void setReturnValueType(Type pType)
Description copied from interface: Subp
setReturnValueType Set the return value type of this subprogram.

Specified by:
setReturnValueType in interface Subp
Parameters:
pType - the return value type.

getParamList

public IrList getParamList()
Description copied from interface: Subp
getParamList Get the parameter list of this subprogram. If it has no parameter, then return empty list. //##80 Before calling this method, closeSubpHeader should be called. The returned value may be incorrect if this is called before calling closeSubpHeader.

Specified by:
getParamList in interface Subp
Returns:
the parameter list.

getParamTypeList

public IrList getParamTypeList()
Description copied from interface: Subp
getParamTypeList Get the parameter type list of this subprogram. If it has no parameter, then return null. If neither closeSubpHeader nore closeSubpPrototype is called before calling this method, getParamTypeList may return null.

Specified by:
getParamTypeList in interface Subp
Returns:
the list of parameter types.

addParam

public void addParam(Param pParam)
Description copied from interface: Subp
addParam
  Add parameter to the parameter list of this subprogram.
  If closeSubpPrototype has been called by processing
  prototype declaration, getParamTypeList will return
  the list of parameter types. It is recommended to check
  the consistency between prototype declaration and
  subprogram definition before calling addParam for
  each parameter. If null is returned by getParamTypeList,
  then prototype declaration is not yet given
  (closeSubpPrototype is not yet called.)
  See closeSubpHeader.

Specified by:
addParam in interface Subp

addParamType

public void addParamType(Type pParamType)
Description copied from interface: Subp
addParamType Add parameter type to a temporal parameter type list. See closeSubpPrototype.

Specified by:
addParamType in interface Subp

getOptionalParam

public Param getOptionalParam()
getOptionalParam -- TO BE DELETED Get the formal parameter generated by setOptionalParam for this subprogram. If this subprogram has no optional parameter, return null.

Returns:
the formal parameter generated for "..." in parameter specification.

setOptionalParam

public Param setOptionalParam()
setOptionalParam -- TO BE DELETED Generate a formal parameter corresponding to "..." in parameter specification and make getOptionalParam() to be true for this subprogram.


hasOptionalParam

public boolean hasOptionalParam()
Description copied from interface: Subp
hasOptionalParam

Specified by:
hasOptionalParam in interface Subp
Returns:
true if this subprogram has optional parameter (represented by ... in C in such way as int printf(char*, ...)) otherwise return false.

setNoParamSpec

public void setNoParamSpec()
Description copied from interface: Subp
Permit any number of parameters of any type for this subprogram.

Specified by:
setNoParamSpec in interface Subp

hasNoParamSpec

public boolean hasNoParamSpec()
Description copied from interface: Subp

Specified by:
hasNoParamSpec in interface Subp
Returns:
true if any number of parameters of any type are permitted in such case as extern sub(); sub(a); sub(a, b); in old C language style.

closeSubpHeader

public void closeSubpHeader()
Description copied from interface: Subp
closeSubpHeader
  Finalize the header part of subprogram.
  This method will set subprogram type for this subprogram
  and set other inevitable information for this subprogram.
  Before calling this method, addParam, setOptionalParam,
  setVisibility should be called if required and return value type
  should be given if required as it is written
  in defineSubp of Sym interface.
  It is the responsibility of language dependent front end
  to check the consistency between prototype declaration and
  subprogram definition.
  If closeSubpPrototype has been called by processing
  prototype declaration, getParamTypeList will return
  the list of parameter types. It is recommended to check
  the consistency between prototype declaration and
  subprogram definition before calling addParam for
  each parameter. The closeSubpHeader will adjust
  the parameter type list according to the list get by
  getParamList and so the consistency check will not be
  effective after the call.

Specified by:
closeSubpHeader in interface Subp

closeSubpPrototype

public void closeSubpPrototype()
Description copied from interface: Subp
closeSubpPrototype
  Finalize a prototype declaration of subprogram.
  This method will set subprogram type for this subprogram.
  Before calling this method, addParamType, setOptionalParam,
  setVisibility should be called if required and return value type
  should also be given if required.
  It is the responsibility of language dependent front end
  to check the consistency between prototype declaration and
  subprogram definition.
  Typical sequence of processing prototype declaration is:
    Subp lSubp = symRoot.sym.defineSubp("name".intern(), returnType);
    lSubp.resetParamTypeList(); // If multiple declaration is allowed.
    lSubp.addParamType(paramType1);
    lSubp.addParamType(paramType2);
    ....
    lSubp.setOptionalparam(); // only when optional parameter is given.
    lSubp.setVisibility(Sym.SYM_PUBLIC); // only if public.
    lSubp.closeSubpPrototype();

Specified by:
closeSubpPrototype in interface Subp

getSubpDefinition

public SubpDefinition getSubpDefinition()
getFirstLocalVar //## Deleted. See nextVar of SymIterator. Get the first local variable of this subprogram.

Specified by:
getSubpDefinition in interface Subp
Returns:
the first local variable of this subprogram. If this has no local variable, then return null. The first local variable is set when a variable is defined for the first time specifying this subprogram by pDefinedIn parameter in define etc.

setSubpDefinition

public void setSubpDefinition(SubpDefinition pSubpDefinition)
Description copied from interface: Subp
setSubpDefinition Set the SubpDefinition node defining the IR body of this subprogram.

Specified by:
setSubpDefinition in interface Subp
Parameters:
pSubpDefinition - the SubpDefinition node of this subprogram.

getHirBody

public Stmt getHirBody()
getHirBody Get the procedural body of this subprogram represented in high level intermediate representation (HIR).

Specified by:
getHirBody in interface Subp
Returns:
HIR procedural body of this subprogram. If no procedural body is given in this compile unit (i.e. external subprogram) then return null.

setHirBody

public void setHirBody(Stmt pHirBody,
                       Label pStartLabel,
                       Label pEndLabel)
setHirBody Set the procedural body of this subprogram represented in high level intermediate representation (HIR).

Specified by:
setHirBody in interface Subp
Parameters:
pHirBody - procedural body represented in HIR specifying operations to be performed when this subprogram is called. setHirBody set pHirBody as the HIR procedural body of this subprogram.
pStartLabel - Label to be attached at entry point.
pEndLabel - Label to be attached at exit point.

initiationProcedure

public BlockStmt initiationProcedure()
initiationProcedure Get HIR initiation procedure of this subprogram, where the initiation procedure is executed at the first invocation of this subprogram or at the beginning of execution and skipped in later invocations.

Returns:
initiation procedure block. Return null if no initiation procedure is specified.

addInitiationStmt

public void addInitiationStmt(Stmt pInitiation)
addInitiationStmt Add pInitiation as the HIR statement in initiation procedure.

Parameters:
pInitiation - statement to be put in the ititiation block.

getLabelDefList

public IrList getLabelDefList()
getLabelDefList Get the list of labels defined in this subprogram. A label is added to the label list of symRoot.subpCurrent when defineLabel of Sym is called.

Returns:
the list of labels defined in this subprogram.

resetLabelLink

public void resetLabelLink()
Description copied from interface: Subp
resetLabelLink Reset label reference list of labels in this subprogram. getLabelRefList() for labels will return null when resetLabelLink is called and addToHirList, addToLirList are not yet called.

Specified by:
resetLabelLink in interface Subp

addToLabelDefList

public void addToLabelDefList(Label pLabel)

removeLabelDef

public void removeLabelDef(Label pLabel)

getStmtWithLabel

public Stmt getStmtWithLabel(Label pLabel)
Description copied from interface: Subp
getStmtWithLabel Get the HIR Stmt attached with pLabel.

Specified by:
getStmtWithLabel in interface Subp
Parameters:
pLabel - Label with which Stmt is to be searched.
Returns:
Stmt attached with pLabel. return null if no statement is found having pLabel.

getStartLabel

public Label getStartLabel()
Description copied from interface: Subp
getStartLabel setStartLabel Get/set a label attached to the entry point of this subprogram. The start label is attached by SubpDefinition and other classes are not required to worry about setting it.

Specified by:
getStartLabel in interface Subp

setStartLabel

public void setStartLabel(Label pLabel)
Specified by:
setStartLabel in interface Subp

getEndLabel

public Label getEndLabel()
Description copied from interface: Subp
getEndLabel setEndLabel Get/set a label attached to the exit point of this subprogram. The end label is attached by SubpDefinition and other classes are not required to worry about setting it.

Specified by:
getEndLabel in interface Subp

setEndLabel

public void setEndLabel(Label pLabel)
Specified by:
setEndLabel in interface Subp

getCallList

public IrList getCallList()
getCallList Get the list of subprograms called in this subprogram.

Specified by:
getCallList in interface Subp
Returns:
list of subprograms called in this subprogram.

addToCallList

public void addToCallList(Subp pCallee)
addToCallList Add pCallee as a subprogram in the call list of this subprogram. If pCallee is already in the call list, no addition is performed.

Specified by:
addToCallList in interface Subp
Parameters:
pCallee - a subprogram called in this subprogram.

getAccessedSyms

public java.util.Set getAccessedSyms()

setAccessedSyms

public void setAccessedSyms(java.util.Set pAccessedSyms)

getFlowInf

public java.lang.Object getFlowInf()
getEntryBBlock

Specified by:
getFlowInf in interface Subp
Returns:
the entry basic block of the graph of basic blocks corresponding to this subprogram. If there is no basic block for this subprogram, return null.

setFlowInf

public void setFlowInf(java.lang.Object pInf)
Specified by:
setFlowInf in interface Subp

getOptInf

public java.lang.Object getOptInf()
Specified by:
getOptInf in interface Subp

setOptInf

public void setOptInf(java.lang.Object pInf)
Specified by:
setOptInf in interface Subp

getParallelInf

public java.lang.Object getParallelInf()
Specified by:
getParallelInf in interface Subp

setParallelInf

public void setParallelInf(java.lang.Object pInf)
Specified by:
setParallelInf in interface Subp

isSafeArrayAll

public boolean isSafeArrayAll()
Specified by:
isSafeArrayAll in interface Subp
Returns:
true if #pragma safeArrayAll is specified.

addToErrorCount

public void addToErrorCount(int pCount)
Description copied from interface: Subp
addToErrorCount Add pCount to the number of syntax/semantic error counter of this subprogram.

Specified by:
addToErrorCount in interface Subp

getErrorCount

public int getErrorCount()
Description copied from interface: Subp
getErrorCount Get the number of syntax/semantic errors of this subprogram.

Specified by:
getErrorCount in interface Subp

buildLabelRefList

public void buildLabelRefList()
Description copied from interface: Subp
Build the list of labels defined in the subprogram so as getLabelDefList() returns proper list, and build the list of LabelNode for every labels to show the label node refering them. This method may be called by finishHir() of HIR interface.

Specified by:
buildLabelRefList in interface Subp

printLabelRefList

public void printLabelRefList()
Description copied from interface: Subp
Print the label reference list built by buildLabelRefList().

Specified by:
printLabelRefList in interface Subp

toStringDetail

public java.lang.String toStringDetail()
Description copied from interface: Sym
toStringDetail Get detailed attributes of this symbol in text which is not interned.

Specified by:
toStringDetail in interface Sym
Overrides:
toStringDetail in class SymImpl