|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object | +--coins.ir.hir.HIR_Impl
HIR_Impl class
| フィールドの概要 | |
protected IR[] |
fAdditionalChild
|
protected int |
fChildCount
|
protected IR |
fChildNode1
|
protected IR |
fChildNode2
|
protected int |
fDbgLevel
|
protected HirAnnex |
fHirAnnex
|
protected int |
fOperator
|
protected IR |
fParentNode
|
protected Type |
fType
|
HirRoot |
hirRoot
|
(パッケージプライベート) static int[] |
inversionTable
|
protected static MachineParam |
machineParam
|
protected static SourceLanguage |
sourceLanguage
|
| インタフェース coins.ir.hir.HIR から継承したフィールド |
OP_CODE_NAME, OP_CODE_NAME_DENSE |
| インタフェース coins.ir.IR から継承したフィールド |
OP_INF, OP_LIST, OP_PROG, OP_SUBP_DEF |
| コンストラクタの概要 | |
|
HIR_Impl()
Default constructor |
|
HIR_Impl(HirRoot pHirRoot)
Constructor to set hirRoot |
protected |
HIR_Impl(HirRoot pHirRoot,
int pOperator)
Usually, HIR constructor should be given operation code. |
| メソッドの概要 | |
void |
accept(HirVisitor pVisitor)
accept Acceptor used in HIR visitor. |
void |
addInf(java.lang.String pInfKindInterned,
java.lang.Object pInfObject)
addInf Add (attach) information pInfObject to this IR node. |
Exp |
addrExp(Exp pExp)
addrExp Build addr expression representing the address of pExp. |
AsmStmt |
asmStmt(java.lang.String pInstructions,
HirList pActualParamList)
asmStmt Make a statement representing asm( formalParams, instructionList, actualParams ). |
AssignStmt |
assignStmt(Exp pLeft,
Exp pRight)
assignStmt Build an assignemnt statement. |
BlockStmt |
blockStmt(Stmt pStmtSequence)
blockStmt Make an instance of block statement that may contain a sequence of statements. |
ExpStmt |
callStmt(Exp pSubpSpec,
IrList pActualParamList)
callStmt Build a subprogram call statement. |
void |
checkLinkage(java.lang.String pHeader)
Check parent-child linkage if debug level (ioRoot.dbgHir.getLevel()) is greater than 0. |
java.lang.Object |
clone()
clone Override Object.clone in HIR. |
Exp |
conditionalExp(Exp pExp)
conditionalExp builds boolean expression to be used as conditional expression of IfStmt and LoopStmt. |
Exp |
conditionalExp1(Exp pExp)
|
ConstNode |
constNode(Const pConst)
constNode Make a ConstNode instance having constant symbol pConst. |
boolean |
contains(HIR pSubtree)
Check if pSubtree is contained in this subtree. |
Exp |
contentsExp(Exp pPointerExp)
contentsExp Build an expression that gets the contents pointed by pPointerExp. |
Exp |
convExp(Type pType,
Exp pExp)
convExp Build an expression to convert the type of pExp to pType. |
void |
copyInfListFrom(HIR pFromHir)
Copy the contents of InfList attached to pFromHir to the InfList of this node. |
HIR |
copyWithOperands()
copyWithOperands Make a subtree that is the same to this subtree. |
HIR |
copyWithOperandsChangingLabels(IrList pLabelCorrespondence)
copyWithOperandsChangingLabels Copy this subtree changing labels that are defined in this subtree to avoid label duplication. |
void |
cutParentLink()
cutParentLink Cut both links from/to parent node if they exist. |
void |
cutParentLink(int pChildNumber)
|
Exp |
decayExp(Exp pExp)
decayExp Build an expression that decay a vector to a pointer to vector element, or decay a String into a pointer to Char element. |
ElemNode |
elemNode(Elem pElem)
elemNode Make an ElemNode instance having Elem symbol pElem. |
Exp |
exp(int pOperator,
Exp pExp1)
exp Build unary expression according to the operator given: OP_NOT // bitwise not (~) one's complement // logical not for bool (!) |
Exp |
exp(int pOperator,
Exp pExp1,
Exp pExp2)
exp Build binary expression. |
Exp |
exp(int pOperator,
Exp pExp1,
Exp pExp2,
Exp pExp3)
exp: Build ternary expression (OP_SELECT, etc.). |
Exp |
expList(java.util.List pList)
expList Make an expression representing a list of expressions, that is, make an instance of ExpListExp. |
Exp |
expRepeat(Exp pValue,
Exp pCount)
expRepeat Make an expression representing a list of expressions of the same value. |
ExpStmt |
expStmt(Exp pExp)
expStmt Create a statement treating pExp as a statement. |
ConstNode |
falseNode()
falseNode Make a ConstNode instance having boolean false value. |
void |
fatalError(int pId,
java.lang.String pMessage)
|
boolean |
finishHir()
finishHir does closing operations for HIR. |
boolean |
flagsAreAllFalse()
|
ForStmt |
forStmt(Stmt pInitStmt,
Exp pCondition,
Stmt pLoopBody,
Stmt pStepPart)
|
ForStmt |
forStmt(Stmt pInitStmt,
Label pLoopBackLabel,
Exp pCondition,
Stmt pLoopBody,
Label pLoopStepLabel,
Stmt pStepPart,
Label pLoopEndLabel)
|
FunctionExp |
functionExp(Exp pFunctionSpec,
IrList pActualParamList)
functionExp Build a function expression node that computes function value. |
IR |
getChild(int pNumber)
getChild |
IR |
getChild1()
getChild1 Get the first child of this node. |
IR |
getChild2()
getChild2 Get the second child of this node. |
int |
getChildCount()
getChildCount Get the number of children that may be attached to this node. |
int |
getChildNumber()
getChildNumber Get the child number of this node. |
IR |
getClone()
|
ExpId |
getExpId()
getExpId Get the expression identifier assigned to this node. |
boolean |
getFlag(int pFlagNumber)
getFlag returns the value (true/false) of the flag indicated by pFlagNumber. |
FlagBox |
getFlagBox()
getFlagBox Users are recommended to use getFlag( int pFlagNumber ) except when they understand the treatment of FlagBox in detail. |
FlowAnalSym |
getFlowAnalSym()
getFlowAnalSym Get the flow analysis symbol assigned to this node if it is given. |
java.lang.String |
getIndentSpace(int pIndent)
getIndentSace Get a sequence of spaces specified by pIndent. |
int |
getIndex()
getIndex Get the index number assigned to "this" node. |
java.lang.Object |
getInf(java.lang.String pInfKindInterned)
getInf Get the information of the kind pInfKindInterned. |
IrList |
getInfList()
getInfList Get the information list attached to this node. |
java.lang.String |
getInfString()
Get the string image of Inf. |
java.lang.String |
getIrName()
getIrName Get operation name and node index to display node in compact form for flow analysis, debug, etc. |
HIR |
getNextNode()
getNextNode is not recommended to be used in traversing HIR subtree because it has high overhead. |
protected HIR |
getNextNodeSeeingAncestor(HIR pHir)
|
Stmt |
getNextStmt()
getNextStmt Get statement next to this statement. |
int |
getOperator()
getOperator Get operation code of "this" node. |
IR |
getParent()
getParent Get the parent of this node. |
Sym |
getResultOperand()
|
Sym |
getResultVar()
|
HIR |
getSourceNode(int pNumber)
getSourceNode Get the pNumber-th source operand of "this" node. |
HIR |
getSourceNode1()
getSourceNode1 Get the 1st source operand node of "this" node where the source is an operand used/refered in "this" operation. |
HIR |
getSourceNode2()
getSourceNode2 Get the 2nd source operand node of "this" node. |
Stmt |
getStmtContainingThisNode()
getStmtContainingThisNode Get the innermost statement or LabeledStmt containing this node by traversing ancestors of this node. |
Sym |
getSym()
getSym Get the symbol represented by "this" node if this is a node representing a symbol (simple variable, element/field name, subprogram, label, constant, etc.). |
FlowAnalSym |
getSymOrExpId()
getSymOrExpId If this is a SymNode with FlowAnalSym instance, then return it else return getExpId(). |
Type |
getType()
getType Get the type attached to this node. |
java.lang.Object |
getWork()
getWork Get information set by setWork for this node. |
HIR |
hirClone()
hirClone Make the clone of this node to get a clone in the situation where clone() can not be used directly. |
HirIterator |
hirIterator(IR pSubtree)
hirIterator Get an iterator to traverse all nodes or statements under pSubtree. |
HirList |
hirList()
|
HIR |
hirNodeClone()
Make a copy of this HIR node without copying children. |
HirSeq |
hirSeq(HIR pChild1)
hirSeq Make an HirSeq node that have some definite number of children. |
HirSeq |
hirSeq(HIR pChild1,
HIR pChild2)
hirSeq Make an HirSeq node that have some definite number of children. //##59 (See HIR interface for HirSeq with more than 2 children.) |
HirSeq |
hirSeq(HIR pChild1,
HIR pChild2,
HIR pChild3)
hirSeq Make an HirSeq node that have some definite number of children. |
IfStmt |
ifStmt(Exp pCondition,
Stmt pThenPart,
Stmt pElsePart)
ifStmt Build an if-statement with then-part (pThenPart) and else-part (pElsePart). |
IndexedLoopStmt |
indexedLoopStmt(Var pLoopIndex,
Exp pStartValue,
Exp pEndValue,
Exp pStepValue,
boolean pUpward,
Stmt pStmtBody)
|
IndexedLoopStmt |
indexedLoopStmt(Var pLoopIndex,
Exp pStartValue,
Exp pEndValue,
Exp pStepValue,
Stmt pStmtBody)
|
InfStmt |
infStmt(java.lang.String pInfKind,
IrList pInfData)
infStmt Build an InfStmt representing some information. |
InfStmt |
infStmt(java.lang.String pInfKind,
java.lang.Object pInfData)
|
ConstNode |
intConstNode(int pIntValue)
intConstNode Make a ConstNode instance having pIntValue as its value. |
ConstNode |
intConstNode(long pIntValue)
intConstNode Make a ConstNode instance having pIntValue as its value. |
IrList |
irList()
irList Make an empty HirList node that make a LinkedList. |
IrList |
irList(java.util.LinkedList pList)
irList Make an HirList node that makes a LinkedList. |
boolean |
isEmpty(HIR pHir)
isEmpty Decide if pHir is empty or not, where empty means either null, NullNode, HIR with OP_NULL as its operator, LabeledStmt whose statement body isEmpty, or ExpStmt whose Exp part isEmpty. |
boolean |
isHIR()
Test if this is an HIR object. |
boolean |
isLIR()
|
boolean |
isSameAs(HIR pTree)
isSameAs Compare this tree with pTree and if they have the same tree shape (same operator and same operands) then return true. |
boolean |
isStmt()
isStmt |
boolean |
isSym()
Test if this is a Sym object. |
boolean |
isTerminal()
|
boolean |
isTree()
isTree Test if this does not violates tree structure, that is, detect node adherence in branches and handshake miss in parent-child relation. |
protected boolean |
isTree(java.util.Set pVisitedNodes,
int pErrorCounter,
java.util.Set pSetOfLabels)
isTree Test if this does not violates tree structure, that is, detect node adherence in branches and handshake miss in parent-child relation. |
JumpStmt |
jumpStmt(Label pLabelSym)
jumpStmt Create a jump statement and increment reference count of pLabelSym. |
LabelDef |
labelDef(Label pLabel)
labelDef Make a LabelDef instance that defines the label pLabel. |
LabeledStmt |
labeledStmt(Label pLabel,
Stmt pStmt)
labeledStmt Build labeled statement using pLabel as its label and pStmt as its statement body. |
LabelNode |
labelNode(Label pLabel)
labelNode Make a LabelNode instance having Label symbol pLabel. |
NullNode |
nullNode()
nullNode Make a NullNode instance. |
Stmt |
nullStmt()
nullStmt Make a statement having NullNode as its statement body. |
ConstNode |
offsetConstNode(long pIntValue)
offsetConstNode Make a ConstNode instance having pIntValue as its offset value. |
PhiExp |
phiExp(Var pVar,
Label pLabel)
phiExp Make a phi expression used in SSA. |
PointedExp |
pointedExp(Exp pStructUnionExp,
ElemNode pElemNode)
pointedExp Build a pointed expression. |
void |
print(int pIndent)
Print the object. |
void |
print(int pIndent,
boolean pDetail)
Print the object. |
Program |
program(Sym pProgSym,
SymTable pGlobalSymTable,
IR pInitiationPart,
IrList pSubpList)
program Make a program node. |
QualifiedExp |
qualifiedExp(Exp pStructUnionExp,
ElemNode pElemNode)
qualifiedExp Build a qualified expression. |
void |
removeInf(java.lang.String pInfKindInterned)
removeInf Remove the information of the kind pInfKindInterned. |
RepeatStmt |
repeatStmt(Label pLoopBackLabel,
Stmt pLoopBody,
Label pLoopStepLabel,
Exp pCondition,
Label pLoopEndLabel)
|
RepeatStmt |
repeatStmt(Stmt pLoopBody,
Exp pCondition)
|
void |
replaceOperator(int pOperator)
|
void |
replaceResultOperand(HIR pOperand)
|
void |
replaceResultVar(HIR pOperand)
|
HIR |
replaceSource(int pNumber,
IR pOperand)
replaceSource Replace pNumber-th source operand of "this" node by pOperand. |
HIR |
replaceSource1(HIR pOperand)
replaceSource1 Replace the source operand 1 of "this" node by pOperand. |
HIR |
replaceSource2(HIR pOperand)
replaceSource2 Replace the source operand 2 of "this" node by pOperand. |
HIR |
replaceThisNode(HIR pNewNode)
replaceThisNode Replace "this" node by pNewNode. |
ReturnStmt |
returnStmt()
returnStmt Build return statement that terminates the execution of current subprogram under construction. |
ReturnStmt |
returnStmt(Exp pReturnValue)
returnStmt Build return statement that terminates the execution of current subprogram under construction. |
void |
setChild(int pNumber,
IR pHir)
setChild Set pHir as pNumber-th child of this node. |
void |
setChild1(IR pChild)
|
void |
setChild2(IR pChild)
|
void |
setChildren(IR p1,
IR p2)
|
void |
setChildren(IR p1,
IR p2,
IR p3)
|
void |
setChildren(IR p1,
IR p2,
IR p3,
IR p4)
|
void |
setChildren(IR p1,
IR p2,
IR p3,
IR p4,
IR p5)
|
SetDataStmt |
setDataStmt(Exp pVariable,
Exp pValueExp)
setDataStmt Make the statement that sets initial value or a list of initial values (pValueExp) to a variable (pVariable). |
void |
setFlag(int pFlagNumber,
boolean pYesNo)
setFlag setFlag sets the flag of specified number. |
void |
setIndex(int pIndex)
setIndex Set an index number to "this" node. |
int |
setIndexNumberToAllNodes(int pStartNumber)
setIndexNumberToAllNodes Set sequencial index number to all nodes traversing the subtree rooted by this node in depth-first order. |
int |
setIndexNumberToAllNodes(int pStartNumber,
boolean pResetSymIndex)
Set index number to all nodes and if pResetSymIndex is true, reset Sym index by resetFlowAnalInf for FlowAnalSym nodes. |
int |
setIndexNumberToAllNodes2(int pStartNumber,
boolean pResetSymIndex)
|
void |
setParameters(MachineParam pMachineParam,
SourceLanguage pSourceLanguage)
|
void |
setParent(IR pParent)
setParent Set the parent of this node as pParent. |
void |
setType(Type pType)
setType Attach a type to this node. |
void |
setWork(java.lang.Object pWork)
setWork Set information privately used in each phase. |
void |
severeError(int pId,
java.lang.String pMessage)
|
Exp |
sizeofExp(Exp pExp)
sizeofExp Build the expression that get the size of pExp. |
Exp |
sizeofExp(Type pType)
sizeofExp Build the expression that get the size of pType. |
void |
slightError(int pId,
java.lang.String pMessage)
|
SubpDefinition |
subpDefinition(Subp pSubpSym)
|
SubpDefinition |
subpDefinition(Subp pSubpSym,
SymTable pLocalSymTable)
subpDefifnition Make a subprogram definition node and set symRoot.subpCurrent = pSubpSym, set symRoot.symTableCurrentSubp = pLocalSymTable. |
SubpDefinition |
subpDefinition(Subp pSubpSym,
SymTable pLocalSymTable,
BlockStmt pInitiationPart,
BlockStmt pHIRbody)
subpDefinition with full specification. |
java.util.Iterator |
subpIterator()
subpIterator Make an iterator that traverses all subprogram definitions in the current compile unit. |
SubpNode |
subpNode(Subp pSubp)
subpNode Make a SubpNode instance having Subp symbol pSubp. |
SubscriptedExp |
subscriptedExp(Exp pArrayExp,
Exp pSubscript)
subscriptedExp Build a subscripted expression. |
Exp |
subscriptedExp(Exp pArrayExp,
Exp pSubscript,
Exp pElemSize)
subscriptedExp Build an expression representing the indicated element of a vector whose element size is unfixed. |
SwitchStmt |
switchStmt(Exp pSelectExp,
IrList pJumpList,
Label pDefaultLabel,
Stmt pSwitchBody,
Label pEndLabel)
switchStmt Make a SwitchStmt instance. |
SymNode |
symNode(Sym pSym)
symNode Make a SymNode instance having pSym as attached symbol. |
java.lang.String |
toString()
toString Get text representation of this node without traversing children. |
java.lang.String |
toStringDetail()
toStringDetail Get text string of this node showing detail information. |
java.lang.String |
toStringShort()
toStringShort Get text string of this node showing node name and index only. |
java.lang.String |
toStringWithChildren()
toStringWithChildren Get the string of this node and its children traversing the children in depth-first order. |
ConstNode |
trueNode()
trueNode Make a ConstNode instance having boolean true value. |
TypeNode |
typeNode(Type pType)
|
Exp |
undecayExp(Exp pPointerExp,
ConstNode pElemCount)
undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type. |
Exp |
undecayExp(Exp pPointerExp,
Exp pElemCount,
Exp pLowerBound)
undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type. |
Exp |
undecayExp(Exp pPointerExp,
long pElemCount)
undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type. |
Exp |
undecayExp(Exp pPointerExp,
long pElemCount,
long pLowerBound)
undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type. |
VarNode |
varNode(Var pVar)
varNode Make a VarNode instance having Var symbol pVar. |
void |
warinig(int pId,
java.lang.String pMessage)
|
WhileStmt |
whileStmt(Exp pCondition,
Stmt pLoopBody)
|
WhileStmt |
whileStmt(Label pLoopBackLabel,
Exp pCondition,
Stmt pLoopBody,
Label pLoopStepLabel,
Label pLoopEndLabel)
ifStmt Build an if-statement with then-part (pThenPart) and else-part (pElsePart). |
boolean |
withInf()
|
| クラス java.lang.Object から継承したメソッド |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| フィールドの詳細 |
public final HirRoot hirRoot
protected int fOperator
protected IR fChildNode1
protected IR fChildNode2
protected IR[] fAdditionalChild
protected IR fParentNode
protected int fChildCount
protected HirAnnex fHirAnnex
protected Type fType
protected final int fDbgLevel
protected static MachineParam machineParam
protected static SourceLanguage sourceLanguage
static final int[] inversionTable
| コンストラクタの詳細 |
public HIR_Impl()
public HIR_Impl(HirRoot pHirRoot)
protected HIR_Impl(HirRoot pHirRoot,
int pOperator)
| メソッドの詳細 |
public void setParameters(MachineParam pMachineParam,
SourceLanguage pSourceLanguage)
public int getOperator()
IR0 の記述:
IR0 内の getOperatorpublic IR getParent()
IR の記述:
IR 内の getParentpublic void setParent(IR pParent)
HIR の記述:
HIR 内の setParentpParent - node to be set as parent of this node.public int getChildCount()
IR0 の記述:
IR0 内の getChildCountpublic IR getChild1()
IR の記述:
IR 内の getChild1public IR getChild2()
IR の記述:
IR 内の getChild2public IR getChild(int pNumber)
IR0 の記述:
IR0 内の getChildpNumber - the child number of the child to be returned.
public void setChild1(IR pChild)
HIR 内の setChild1public void setChild2(IR pChild)
HIR 内の setChild2
public void setChild(int pNumber,
IR pHir)
IR0 内の setChildpNumber - Child numberpublic int getChildNumber()
HIR0 の記述:
HIR0 内の getChildNumber
public void addInf(java.lang.String pInfKindInterned,
java.lang.Object pInfObject)
IR の記述:
IR 内の addInfpInfObject - Object to be added as information.
It may be String, Sym, IR, List, and so on,
hence they may be non-IR elements.public java.lang.Object getInf(java.lang.String pInfKindInterned)
IR の記述:
IR 内の getInfpublic void removeInf(java.lang.String pInfKindInterned)
IR の記述:
IR 内の removeInfpublic IrList getInfList()
IR の記述:
IR 内の getInfListpublic void copyInfListFrom(HIR pFromHir)
HIR の記述:
HIR 内の copyInfListFrompFromHir - HIR node that may have InfList.public java.lang.String getInfString()
HIR の記述:
HIR 内の getInfStringpublic boolean withInf()
public java.lang.Object getWork()
HIR の記述:
HIR 内の getWorkpublic void setWork(java.lang.Object pWork)
HIR の記述:
HIR 内の setWorkpWork - any information of arbitrary class to be set to this node;
You may define a new class that represents arbitrary information
and give its reference as pWork.
This method is moved to IR interface.public int getIndex()
IR0 の記述:
IR0 内の getIndexpublic void setIndex(int pIndex)
HIR の記述:
HIR 内の setIndexpIndex - the index number to be assigned to "this" node.public boolean isStmt()
HIR の記述:
HIR 内の isStmtpublic Stmt getStmtContainingThisNode()
HIR0 の記述:
HIR0 内の getStmtContainingThisNodepublic ExpId getExpId()
HIR の記述:
HIR 内の getExpIdpublic FlowAnalSym getSymOrExpId()
HIR の記述:
HIR 内の getSymOrExpIdpublic FlowAnalSym getFlowAnalSym()
HIR の記述:
HIR 内の getFlowAnalSympublic HIR getSourceNode1()
HIR の記述:
HIR 内の getSourceNode1public HIR getSourceNode2()
HIR の記述:
HIR 内の getSourceNode2public HIR getSourceNode(int pNumber)
HIR の記述:
HIR 内の getSourceNodepNumber - 1: source 1, 2: source 2, 3: source 3, ... .
public Sym getSym()
IR の記述:
IR 内の getSympublic Sym getResultOperand()
public Sym getResultVar()
public HIR replaceSource1(HIR pOperand)
HIR の記述:
HIR 内の replaceSource1pOperand - node that take place of source operand 1.public HIR replaceSource2(HIR pOperand)
HIR の記述:
HIR 内の replaceSource2pOperand - node that take place of source operand 2.
public HIR replaceSource(int pNumber,
IR pOperand)
HIR の記述:
HIR 内の replaceSourcepNumber - 1: source 1, 2: source 2, 3: source 3, ... .pOperand - node that take place of source operand.public void replaceResultOperand(HIR pOperand)
public void replaceResultVar(HIR pOperand)
public HIR replaceThisNode(HIR pNewNode)
HIR0 の記述:
HIR0 内の replaceThisNodepNewNode - node that takes place of "this" node.public void replaceOperator(int pOperator)
public void cutParentLink()
HIR の記述:
HIR 内の cutParentLinkpublic void cutParentLink(int pChildNumber)
public boolean isSym()
HasStringObject の記述:
HasStringObject 内の isSympublic boolean isHIR()
HasStringObject の記述:
HasStringObject 内の isHIRpublic boolean isLIR()
public boolean isEmpty(HIR pHir)
HIR の記述:
HIR 内の isEmptypHir - HIR node to be tested if empty or not.
public boolean isTerminal()
public boolean contains(HIR pSubtree)
HIR の記述:
HIR 内の containspSubtree - subtree to be searched.
public java.lang.String toString()
HIR の記述:
HIR 内の toStringjava.lang.Object 内の toStringpublic java.lang.String toStringShort()
HIR の記述:
HIR 内の toStringShortpublic java.lang.String toStringDetail()
HIR の記述:
HIR 内の toStringDetailpublic java.lang.String toStringWithChildren()
HIR の記述:
HIR 内の toStringWithChildrenpublic java.lang.String getIrName()
HIR の記述:
HIR 内の getIrNamepublic void print(int pIndent)
HasStringObject の記述:
IR 内の print
public void print(int pIndent,
boolean pDetail)
HasStringObject の記述:
IR 内の printpublic java.lang.String getIndentSpace(int pIndent)
HIR の記述:
HIR 内の getIndentSpacepIndent - number of spaces to be generated.
public int setIndexNumberToAllNodes(int pStartNumber)
HIR0 の記述:
HIR0 内の setIndexNumberToAllNodespStartNumber - starting value of the index
(greater than 0).
public int setIndexNumberToAllNodes(int pStartNumber,
boolean pResetSymIndex)
HIR の記述:
HIR 内の setIndexNumberToAllNodespStartNumber - pResetSymIndex - true if resetFlowAnalInf is to be done.
public int setIndexNumberToAllNodes2(int pStartNumber,
boolean pResetSymIndex)
public boolean finishHir()
HIR0 の記述:
finishHir does closing operations for HIR.
finishHir should be called for Program or SubpDefinition
when HIR building or restructuring were completed in such
timing as
at the end of new HIR generation in front-end
(call for hirRoot.programRoot),
at the end of restructuring (optimization, parallelization, etc.)
(call for corresponding SubpDefinition subtree).
If finishHir is scheduled to be called for programRoot after successive
generation or restructuring of SubpDefinitions before passing it to other
phases, then it is unnecessary to call it for each SubpDefinition.
finishHir set index number to all nodes of this subtree
and verifies its tree structure.
It also certificates the value of getHirPosition() for labels //##60
and buildLabelRefList is called for SubpDefinition
(for Program, buildLabelRefList is called for every SubpDefinitions). //##62
If finishHir is called then it is not necessary to call
setIndexNumberToAllNnodes() nor isTree().
If error is found, then finishHir() returns false after isuing
error message. If no error is found then it returns true.
In either case, processing will continue.
HIR0 内の finishHir
public void warinig(int pId,
java.lang.String pMessage)
public void slightError(int pId,
java.lang.String pMessage)
public void severeError(int pId,
java.lang.String pMessage)
public void fatalError(int pId,
java.lang.String pMessage)
public Program program(Sym pProgSym,
SymTable pGlobalSymTable,
IR pInitiationPart,
IrList pSubpList)
HIR0 の記述:
HIR0 内の programpProgSym - Program name (may be null).pGlobalSymTable - Symbol table for global symbols.pInitiationPart - Initiation statement (may be null).pSubpList - List of subprograms; At first, it may be
an empty list; (See addSubpDefinition of Program interface).
public SubpDefinition subpDefinition(Subp pSubpSym,
SymTable pLocalSymTable)
HIR0 の記述:
HIR0 内の subpDefinitionpSubpSym - Subprogram symbol. Should be given.pLocalSymTable - Symbol table local in the subprogram;
If subprogram uses a local symbol table, this parameter
should be given (by using pushSymTable() of SymTable
interface); If the source language permits no local symbol
for subprogram, this parameter may be null.
public SubpDefinition subpDefinition(Subp pSubpSym)
public SubpDefinition subpDefinition(Subp pSubpSym,
SymTable pLocalSymTable,
BlockStmt pInitiationPart,
BlockStmt pHIRbody)
HIR の記述:
HIR 内の subpDefinitionpSubpSym - Subprogram symbol. Should be given.pLocalSymTable - Symbol table local in the subprogram;
If subprogram uses a local symbol table, this parameter
should be given (by using pushSymTable() of SymTable
interface); Even if the source program does not use
local symbol, this parameter is required to register
temporal variables and internal labels generated by
the compiler. //##51pInitiationPart - Initiation statement block. optional.pHIRbody - Subprogram body in HIR. optional.public IrList irList(java.util.LinkedList pList)
HIR の記述:
HIR 内の irListpList - List of objects to be included in the HirList;
The elements of the list are an HIR object or Sym object.
public IrList irList()
HIR0 の記述:
HIR0 内の irListpublic HirList hirList()
HIR0 内の hirList
public InfStmt infStmt(java.lang.String pInfKind,
IrList pInfData)
HIR の記述:
HIR 内の infStmtpInfKind - pInfData -
public InfStmt infStmt(java.lang.String pInfKind,
java.lang.Object pInfData)
HIR 内の infStmtpublic VarNode varNode(Var pVar)
HIR0 の記述:
HIR0 内の varNodepVar - Variable symbol to be attached to the node.
public ElemNode elemNode(Elem pElem)
HIR0 の記述:
HIR0 内の elemNodepElem - Struct/union element symbol to be attached to the node.
public SubpNode subpNode(Subp pSubp)
HIR0 の記述:
HIR0 内の subpNodepSubp - Subprogram symbol to be attached to the node.
public TypeNode typeNode(Type pType)
public LabelNode labelNode(Label pLabel)
HIR0 の記述:
HIR0 内の labelNodepLabel - Label symbol to be attached to the node.
public ConstNode constNode(Const pConst)
HIR0 の記述:
HIR0 内の constNodepConst - Constant symbol to be attached to the node.
public ConstNode intConstNode(int pIntValue)
HIR の記述:
HIR 内の intConstNodepIntValue - Integer value to be attached to the node.
public ConstNode intConstNode(long pIntValue)
HIR0 の記述:
HIR0 内の intConstNodepIntValue - Integer value to be attached to the node.
public ConstNode offsetConstNode(long pIntValue)
HIR の記述:
HIR 内の offsetConstNodepIntValue - Offset value to be attached to the node.
public ConstNode trueNode()
HIR0 の記述:
HIR0 内の trueNodepublic ConstNode falseNode()
HIR0 の記述:
HIR0 内の falseNodepublic SymNode symNode(Sym pSym)
HIR0 の記述:
HIR0 内の symNodepSym - Symbol to be attached to the node.
public NullNode nullNode()
HIR の記述:
HIR 内の nullNodepublic LabelDef labelDef(Label pLabel)
HIR0 の記述:
HIR0 内の labelDefpLabel - Label symbol to be defined.
public Exp exp(int pOperator,
Exp pExp1)
HIR0 の記述:
Build unary expression according to the
operator given:
OP_NOT // bitwise not (~) one's complement
// logical not for bool (!)
OP_NEG // negate (unary minus)
OP_ADDR // get address (&)
OP_CONTENTS // get contents of pointed memory
OP_CONV // type conversion for basic type
OP_DECAY // convert array to pointer
OP_SIZEOF // sizeof operator
OP_ENCLOSE // honor parenthesis
The type of resultant expression is set according to the rule
described in the HIR specifications, however, it may be necessary
to do language-wise treatment. In such case, front-end part of the
language should set type after creating the instance of Exp.
(In C, expressions related to pointer and vector are specially
treated in C front end ToHirC.)
HIR0 内の exppOperator - unary operator such as
OP_NOT, OP_NEG, OP_ADDR, OP_CONTENTS, OP_CONV,
OP_DECAY, OP_SIZEOF, OP_ENCLOSE
defined in HIR interface.pExp1 - operand expression.
public Exp exp(int pOperator,
Exp pExp1,
Exp pExp2)
HIR0 の記述:
HIR0 内の exppOperator - binary operator such as OP_ADD, OP_MULT, etc.
defined in HIR interface.pExp1 - operand 1 expression.pExp2 - operand 2 expression.
public Exp exp(int pOperator,
Exp pExp1,
Exp pExp2,
Exp pExp3)
HIR の記述:
HIR 内の exppExp1 - operand 1 expression.pExp2 - operand 2 expression.pExp3 - operand 3 expression.
public Exp decayExp(Exp pExp)
HIR0 の記述:
HIR0 内の decayExppExp - vector variable or string constant.
public Exp undecayExp(Exp pPointerExp,
ConstNode pElemCount)
HIR の記述:
HIR 内の undecayExppPointerExp - pointer expression pointing to the
first element of the resultant vector.pElemCount - Constant expression showing element count of
the resultant vector.
public Exp undecayExp(Exp pPointerExp,
Exp pElemCount,
Exp pLowerBound)
HIR の記述:
HIR 内の undecayExppPointerExp - pointer expression pointing to the
first element of the resultant vector.pElemCount - Expression showing element count of
the resultant vector.pLowerBound - Expression showing the lower index bound of
the resultant vector.
public Exp undecayExp(Exp pPointerExp,
long pElemCount)
HIR の記述:
HIR 内の undecayExppPointerExp - pointer expression pointing to the
first element of the resultant vector.pElemCount - element count of the resultant vector.
public Exp undecayExp(Exp pPointerExp,
long pElemCount,
long pLowerBound)
HIR0 の記述:
HIR0 内の undecayExppPointerExp - pointer expression pointing to the
first element of the resultant vector.pElemCount - element count of the resultant vector.pLowerBound - lower index bound of the resultant vector.
public SubscriptedExp subscriptedExp(Exp pArrayExp,
Exp pSubscript)
HIR0 の記述:
HIR0 内の subscriptedExppArrayExp - array expression to which subscript is
to be attached;
If multi-dimensional subscript is required, make pArrayExp
as a subscripted variable and add more subscript by this method.pSubscript - subscript expression.
public Exp subscriptedExp(Exp pArrayExp,
Exp pSubscript,
Exp pElemSize)
HIR の記述:
HIR 内の subscriptedExppArrayExp - is array expression to which subscript is
to be attached (it is unfixed size vector).pSubscript - is subscript expression.pElemSize - is the element size of pArrayExp in bytes.
public QualifiedExp qualifiedExp(Exp pStructUnionExp,
ElemNode pElemNode)
HIR0 の記述:
HIR0 内の qualifiedExppStructUnionExp - expression specifying structure or union
or region_variable to qualify.pElemNode - An element of pStructUnionExp.
public PointedExp pointedExp(Exp pStructUnionExp,
ElemNode pElemNode)
HIR0 の記述:
HIR0 内の pointedExppStructUnionExp - expression specifying structure or union
whose element is to be pointed.pElemNode - An element of pStructUnionExp.
public Exp contentsExp(Exp pPointerExp)
HIR0 の記述:
HIR0 内の contentsExppPointerExp - Expression representing a pointer.
public Exp convExp(Type pType,
Exp pExp)
HIR0 の記述:
HIR0 内の convExppType - Type to which pExp is to be changed.pExp - Expression to be converted.
public Exp sizeofExp(Type pType)
HIR0 の記述:
HIR0 内の sizeofExppType - Type of object.
public Exp sizeofExp(Exp pExp)
HIR0 の記述:
HIR0 内の sizeofExppExp - Expression whose size is to be taken.
public FunctionExp functionExp(Exp pFunctionSpec,
IrList pActualParamList)
HIR0 の記述:
HIR0 内の functionExppFunctionSpec - function specification part which may be either
a function name (SubpNode), or an expression specifying
a function name ((addr SubpNode), etc.).pActualParamList - actual parameter list (made by hirList).
public Exp addrExp(Exp pExp)
HIR の記述:
HIR 内の addrExppExp - l-value expression or SubpNode.
public Exp conditionalExp1(Exp pExp)
public Exp conditionalExp(Exp pExp)
HIR の記述:
HIR 内の conditionalExppExp - boolean expression.
public ExpStmt callStmt(Exp pSubpSpec,
IrList pActualParamList)
HIR0 の記述:
HIR0 内の callStmtpSubpSpec - subprogram specification part which may be either
a subprogram name (SubpNode), or an expression specifying
a subprogram name ((addr SubpNode), etc.).pActualParamList - actual parameter list (made by hirList).
public AssignStmt assignStmt(Exp pLeft,
Exp pRight)
HIR0 の記述:
HIR0 内の assignStmtpLeft - left hand side (l-value) expression to which
the value of expression is to be assigned.pRight - expression (subtree) that is to be assigned
to pLeftSide.
public IfStmt ifStmt(Exp pCondition,
Stmt pThenPart,
Stmt pElsePart)
HIR0 の記述:
HIR0 内の ifStmtpCondition - conditional expression subtree.pThenPart - then-part statement that is executed when
pCondition is true.pElsePart - else-part statement that is executed when
pCondition is false.
public WhileStmt whileStmt(Exp pCondition,
Stmt pLoopBody)
HIR0 内の whileStmt
public WhileStmt whileStmt(Label pLoopBackLabel,
Exp pCondition,
Stmt pLoopBody,
Label pLoopStepLabel,
Label pLoopEndLabel)
HIR の記述:
HIR 内の whileStmtpCondition - conditional expression subtree.
public ForStmt forStmt(Stmt pInitStmt,
Exp pCondition,
Stmt pLoopBody,
Stmt pStepPart)
HIR0 内の forStmt
public ForStmt forStmt(Stmt pInitStmt,
Label pLoopBackLabel,
Exp pCondition,
Stmt pLoopBody,
Label pLoopStepLabel,
Stmt pStepPart,
Label pLoopEndLabel)
HIR 内の forStmt
public RepeatStmt repeatStmt(Stmt pLoopBody,
Exp pCondition)
HIR0 内の repeatStmt
public RepeatStmt repeatStmt(Label pLoopBackLabel,
Stmt pLoopBody,
Label pLoopStepLabel,
Exp pCondition,
Label pLoopEndLabel)
HIR 内の repeatStmt
public IndexedLoopStmt indexedLoopStmt(Var pLoopIndex,
Exp pStartValue,
Exp pEndValue,
Exp pStepValue,
Stmt pStmtBody)
HIR 内の indexedLoopStmt
public IndexedLoopStmt indexedLoopStmt(Var pLoopIndex,
Exp pStartValue,
Exp pEndValue,
Exp pStepValue,
boolean pUpward,
Stmt pStmtBody)
HIR 内の indexedLoopStmt
public LabeledStmt labeledStmt(Label pLabel,
Stmt pStmt)
HIR0 の記述:
HIR0 内の labeledStmtpublic BlockStmt blockStmt(Stmt pStmtSequence)
HIR0 の記述:
HIR0 内の blockStmtpStmtSequence - statement to be included in BlockStmt
(may be null).
public ReturnStmt returnStmt(Exp pReturnValue)
HIR0 の記述:
HIR0 内の returnStmtpReturnValue - return value of function subprogram.
If the subprogram has no return value, it is null.
public ReturnStmt returnStmt()
HIR の記述:
HIR 内の returnStmtpublic JumpStmt jumpStmt(Label pLabelSym)
HIR0 の記述:
HIR0 内の jumpStmtpLabelSym - jump target label.
public SwitchStmt switchStmt(Exp pSelectExp,
IrList pJumpList,
Label pDefaultLabel,
Stmt pSwitchBody,
Label pEndLabel)
HIR0 の記述:
HIR0 内の switchStmtpSelectExp - Expression to select case statement.pJumpList - Jump list that correlate case constant
and case label.pDefaultLabel - label to be attached to default statement part.pSwitchBody - Switch statement body that contains statements
with case-label.pEndLabel - Label as the target of jump corresponding to break.
public ExpStmt expStmt(Exp pExp)
HIR0 の記述:
HIR0 内の expStmtpExp - expression to be treated as a statement.
public Stmt nullStmt()
HIR の記述:
HIR 内の nullStmt
public PhiExp phiExp(Var pVar,
Label pLabel)
HIR の記述:
HIR 内の phiExppVar - variable to be selected.pLabel - label attached to a basic block from which
control tranfers.
public HirSeq hirSeq(HIR pChild1)
HIR の記述:
HIR 内の hirSeqpChild1 - Child 1 HIR node.
public HirSeq hirSeq(HIR pChild1,
HIR pChild2)
HIR0 の記述:
HIR0 内の hirSeqpChild1 - Child 1 HIR node.pChild2 - Child 2 HIR node.
public HirSeq hirSeq(HIR pChild1,
HIR pChild2,
HIR pChild3)
HIR の記述:
HIR 内の hirSeqpChild1 - Child 1 HIR node.pChild2 - Child 2 HIR node.pChild3 - Child 3 HIR node.
public SetDataStmt setDataStmt(Exp pVariable,
Exp pValueExp)
HIR の記述:
HIR 内の setDataStmtpVariable - Variable to which initial value is to be set.pValueExp - Value or list of values to be set to pVariable.
public Exp expList(java.util.List pList)
HIR の記述:
HIR 内の expListpList - list of expressions.
public Exp expRepeat(Exp pValue,
Exp pCount)
HIR の記述:
HIR 内の expRepeatpValue - Expression representing a value to be repeated.pCount - Specifies the number of repeat count.
public AsmStmt asmStmt(java.lang.String pInstructions,
HirList pActualParamList)
HIR の記述:
HIR 内の asmStmtpInstructions - String representing formal parameters and
sequence of instructions.pActualParamList - List of variable nodes and arithmetic expressions
representing actual parameters.
public void setChildren(IR p1,
IR p2)
HIR 内の setChildren
public void setChildren(IR p1,
IR p2,
IR p3)
HIR 内の setChildren
public void setChildren(IR p1,
IR p2,
IR p3,
IR p4)
public void setChildren(IR p1,
IR p2,
IR p3,
IR p4,
IR p5)
public Type getType()
HIR0 の記述:
HIR0 内の getTypepublic void setType(Type pType)
HIR の記述:
HIR 内の setTypepType - type to be attached to this node;
It should represent a proper type corresponding to the
result of subtree represented by this node.public Stmt getNextStmt()
HIR0 の記述:
HIR0 内の getNextStmtpublic HIR getNextNode()
protected HIR getNextNodeSeeingAncestor(HIR pHir)
public boolean getFlag(int pFlagNumber)
HIR0 内の getFlagpFlagNumber - flag identification number.
public void setFlag(int pFlagNumber,
boolean pYesNo)
HIR0 内の setFlagpFlagNumber - flag identification number.pYesNo - true or false to be set to the flag.public boolean flagsAreAllFalse()
public FlagBox getFlagBox()
HIR0 の記述:
HIR0 内の getFlagBox
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
java.lang.Object 内の clonejava.lang.CloneNotSupportedException
public IR getClone()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedExceptionpublic HIR hirClone()
HIR0 の記述:
HIR0 内の hirClonepublic HIR hirNodeClone()
HIR の記述:
HIR 内の hirNodeClonepublic HIR copyWithOperands()
HIR0 の記述: Make a subtree that is the same to this subtree. (Labels are not renamed.) In general, a subtree represents the computation of an operation and also the computation of its operands. Flow information is invalid as for copied subtree and should be computed again if required. If the subtree contains labels, it is recommended to use copyWithOperandsChangingLabels. Note that, IfStmt, LoopStmt (for, while, until, etc.), SwitchStmt contain internal labels and it is recommended to use copyWithOperandsChangingLabels to the subtree that may contain these statements. "this" should be the root node of a subtree contained in a subprogram body. Subprogram body itself should not be copied.
HIR0 内の copyWithOperandspublic HIR copyWithOperandsChangingLabels(IrList pLabelCorrespondence)
HIR0 内の copyWithOperandsChangingLabelspLabelCorrespondence - null if this method is called
from outside HIR access methods. If it is null, it is
computed in this method and passed to subclasses
after copyWithOperands (without changing label).
protected boolean isTree(java.util.Set pVisitedNodes,
int pErrorCounter,
java.util.Set pSetOfLabels)
pVisitedNodes - Give null in usual case;
Set of visited nodes is given when isTree is
invoked recursively by isTree.
public boolean isTree()
HIR の記述:
HIR 内の isTreepublic boolean isSameAs(HIR pTree)
HIR0 内の isSameAspTree - HIR tree to be compared.
public void checkLinkage(java.lang.String pHeader)
HIR の記述:
HIR 内の checkLinkagepHeader - name of HIR modification operation.public java.util.Iterator subpIterator()
HIR の記述:
HIR 内の subpIteratorpublic HirIterator hirIterator(IR pSubtree)
HIR0 の記述:
Get an iterator to traverse all nodes or statements under
pSubtree. YOu can traverse the subtree by following methods
of HirIterator
next(): traverse all nodes.
getNextStmt(): traverse all statements.
getNextExecutableNode(): traverse executable nodes only.
See HirIterator interface.
HIR0 内の hirIteratorpSubtree - root of the subtree to be traversed.
public void accept(HirVisitor pVisitor)
HIR0 の記述:
HIR0 内の acceptpVisitor - HirVisitor
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||