|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcoins.casttohir.ToHir
ToHir Offer cooperation with other packages to all classes included in this package, for example, I/O files, compile option information, etc.
| Field Summary | |
(package private) Debug |
debug
debug Used to access debugging fields. |
protected java.util.HashSet |
fAssignsForInitiation
|
int |
fDbgLevel
|
protected java.util.Map |
fHirOptMap
|
(package private) HIR |
hir
hir HIR instance (used to create HIR objects). |
(package private) HirRoot |
hirRoot
hirRoot Used to access HIR root fields. |
(package private) IoRoot |
ioRoot
ioRoot Used to access I/O root fields. |
(package private) MachineParam |
machineParam
Define target machine parameters. |
(package private) java.lang.String |
nowFile
nowFile Now procesing file name. |
(package private) int |
nowLine
nowLine Now procesing line number. |
(package private) boolean |
optHirFromC
optHirFromC Optimize HIR-C (temporary switch for development). |
(package private) boolean |
safeArrayAll
|
(package private) Sym |
sym
sym Sym instance (used to create Sym objects). |
(package private) SymRoot |
symRoot
symRoot Used to access symbol root fields. |
(package private) Type |
typeVoidPtr
typeVoidPtr Type of void pointer. |
(package private) boolean |
useArrayParameterSize
useArrayParameterSize Use array parameter size (decided by compiler option). |
(package private) boolean |
useOldLir
useOldLir Use old LIR generator (temporary switch for development). |
(package private) boolean |
useSubsForPtr
useSubsForPtr Use subscripted expression for pointer (decided by compiler option). |
| Constructor Summary | |
ToHir(HirRoot pHirRoot,
boolean oldlir,
boolean fromc)
ToHirUtil Constructor to record hirRoot, ioRoot, symRoot to make them available in methods of this class and subclasses. |
|
| Method Summary | |
(package private) Exp |
addrExp(Exp e)
addrExp Create OP_ADDR (= &e) expression node. |
(package private) Type |
compositeType(Type t1,
Type t2,
boolean checkqualifier)
compositeType: Create the composite type that is the resultant type of an expression with t1 and t2 as its operand types. |
(package private) Sym |
createBlockSym()
createBlockSym Create block symbol which has unique name. |
(package private) Label |
createLabel()
createLabel Create label with name which does not overlap. |
(package private) Label |
createLabel(java.lang.String name)
createLabel Create label. |
(package private) Type |
daPromotedType(Type t)
Return the default argument promoted type. |
(package private) Exp |
decayExp(Exp e)
decayExp Create OP_DECAY (convert array to pointer) expression node. |
(package private) void |
error(java.lang.String mes)
error Output error message. |
(package private) void |
error(Sym s,
java.lang.String mes)
|
(package private) void |
fatal(java.lang.String mes)
fatal Throws fatal error. |
(package private) java.lang.String |
getOp(HIR h)
getOp Get operation name of HIR. |
(package private) SymTable |
getSubpTable()
getSubpTable Get symbol table which current subprogram has. |
(package private) Type |
iPromotedType(Type t)
Get the resultant type of integral promotion. |
(package private) boolean |
isArithmetic(Type t)
isArithmetic Is arithmetic type ? |
(package private) boolean |
isCompatible(Type t1,
Type t2,
boolean checkqualifier)
isCompatible Is compatible types ? |
(package private) boolean |
isIntegral(Type t)
isIntegral Is integral type ? |
(package private) boolean |
isModifierIncluded(Type t1,
Type t2)
isModifierIncluded Is type modifier included ? |
(package private) boolean |
isScalar(Type t)
isScalar Is scalar type ? |
(package private) void |
message(int level,
java.lang.String mes)
message Output debug message. |
(package private) ConstNode |
new0Node()
new0Node Create constant 0 node. |
(package private) ConstNode |
new1Node()
new1Node Create constant 1 node. |
(package private) AssignStmt |
newAssignStmt(Exp e1,
Exp e2)
newAssignStmt create assign statement. |
(package private) BlockStmt |
newBlockStmt(Stmt stmt)
newBlockStmt Create block statement with statement stmt. |
(package private) ExpStmt |
newExpStmt(Exp exp)
newExpStmt Create expression statement, and set position. |
(package private) Exp |
newFalseNode()
newFalseNode Create false node. |
(package private) IfStmt |
newIfStmt(Exp condexp,
Stmt thenstmt,
Stmt elsestmt)
newIfStmt Create if statement, and set position. |
(package private) LabeledStmt |
newLabeledStmt(Stmt stmt)
newLabeledStmt create labeled statement which has statement stmt. |
(package private) VarNode |
newTempVarNode(Type t)
newTempVarNode Create temporary variable node, with new variable bymbol. |
(package private) Exp |
newTrueNode()
newTrueNode Create true node. |
(package private) Sym |
searchGlobalOrdinaryId(java.lang.String name)
searchGlobalOrdinaryId Search ordinary identifier (=KIND_VAR,KIND_PARAM,KIND_SUBP,KIND_TYPE) from symTableRoot. |
(package private) Sym |
searchLocalOrdinaryId(java.lang.String name)
searchLocalOrdinaryId Search ordinary identifier (=KIND_VAR,KIND_PARAM,KIND_SUBP,KIND_TYPE) from symTableCurrent. |
(package private) Sym |
searchOrdinaryId(java.lang.String name)
searchOrdinaryId Search ordinary identifier (=KIND_VAR,KIND_PARAM,KIND_SUBP,KIND_TYPE) from symTableCurrent and it's parents. |
(package private) void |
setFlagAddressTaken(Exp e)
setFlagAddressTaken Set FLAG_ADDRESS_TAKEN flag. |
(package private) void |
setFlagPointerOperation(Exp e)
setFlagPointerOperation Set FLAG_POINTER_OPERATION flag. |
(package private) void |
setFlagValueIsAssigned(Exp e)
setFlagValueIsAssigned Set FLAG_VALUE_IS_ASSIGNED flag. |
(package private) Exp |
subsExp(Exp e1,
Exp e2)
subsExp Create OP_SUBS (= e1[e2]) expression node. |
(package private) VectorType |
vectorType(Type t,
long n)
vectorType Create vector type. |
(package private) void |
warning(java.lang.String mes)
warning Output warning message. |
(package private) void |
warning(Sym s,
java.lang.String mes)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
final HirRoot hirRoot
final SymRoot symRoot
final IoRoot ioRoot
final Debug debug
final HIR hir
final Sym sym
final Type typeVoidPtr
final MachineParam machineParam
java.lang.String nowFile
int nowLine
final boolean useSubsForPtr
final boolean useArrayParameterSize
final boolean useOldLir
final boolean optHirFromC
protected java.util.Map fHirOptMap
final boolean safeArrayAll
protected java.util.HashSet fAssignsForInitiation
public final int fDbgLevel
| Constructor Detail |
public ToHir(HirRoot pHirRoot,
boolean oldlir,
boolean fromc)
| Method Detail |
void message(int level,
java.lang.String mes)
level - Debug levelmes - Debug messagevoid warning(java.lang.String mes)
mes - Message.
void warning(Sym s,
java.lang.String mes)
void error(java.lang.String mes)
mes - Message.
void error(Sym s,
java.lang.String mes)
void fatal(java.lang.String mes)
mes - Message.java.lang.String getOp(HIR h)
h - HIR node.
Sym createBlockSym()
Label createLabel(java.lang.String name)
name - Label name.
Label createLabel()
SymTable getSubpTable()
Sym searchGlobalOrdinaryId(java.lang.String name)
Sym searchLocalOrdinaryId(java.lang.String name)
Sym searchOrdinaryId(java.lang.String name)
VectorType vectorType(Type t,
long n)
t - Element type.n - Element count.
boolean isCompatible(Type t1,
Type t2,
boolean checkqualifier)
t1 - Type.t2 - Type.checkqualifier - true:Check qualifier completely.
false:Disregard qualifier.
Type compositeType(Type t1,
Type t2,
boolean checkqualifier)
t1 - Type to be synthesized.t2 - Type to be synthesized.
Type daPromotedType(Type t)
t - type.
Type iPromotedType(Type t)
If the rank of t < the rank of int then {
If (precision of t >= precision of int) and (t is unsigned)
then resultant type is unsigned int
else resultant type is int.
}else
do not do integral promotion.
t - Type
boolean isIntegral(Type t)
t - Type.
boolean isArithmetic(Type t)
t - Type.
boolean isScalar(Type t)
t - Type.
boolean isModifierIncluded(Type t1,
Type t2)
t1 - Type.t2 - Type.
void setFlagPointerOperation(Exp e)
e - Expression which has a variable.void setFlagAddressTaken(Exp e)
e - Expression which has a variable.void setFlagValueIsAssigned(Exp e)
e - Expression which has a variable.Exp decayExp(Exp e)
e - Expression whose type is array.
Exp addrExp(Exp e)
e - Adress taken expression.
Exp subsExp(Exp e1,
Exp e2)
e1 - Array expression.e2 - Index expression.
VarNode newTempVarNode(Type t)
t - New symbol type.
ConstNode new0Node()
ConstNode new1Node()
Exp newTrueNode()
Exp newFalseNode()
BlockStmt newBlockStmt(Stmt stmt)
stmt - Stmt
IfStmt newIfStmt(Exp condexp,
Stmt thenstmt,
Stmt elsestmt)
condexp - Condition expression.thenstmt - Then statement.elsestmt - Else statement.
ExpStmt newExpStmt(Exp exp)
exp - Exp
AssignStmt newAssignStmt(Exp e1,
Exp e2)
e1 - Expe2 - Exp
LabeledStmt newLabeledStmt(Stmt stmt)
stmt - Stmt
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||