nitc :: PhiFunction
it is placed at the beginning of a BasicBlock with many incoming blocks
nitc :: PhiFunction :: _block
The position in the AST of the phi-functionnitc :: PhiFunction :: _dependences
The dependences of this variable for SSA-Algorithmnitc :: PhiFunction :: add_dependences
Set the dependences for the phi-functionnitc :: PhiFunction :: block=
The position in the AST of the phi-functionnitc :: PhiFunction :: defaultinit
nitc :: PhiFunction :: dependences
The dependences of this variable for SSA-Algorithmnitc :: PhiFunction :: dependences=
The dependences of this variable for SSA-Algorithmnitc $ PhiFunction :: SELF
Type of this instance, automatically specialized in every classnitc :: Variable :: _assignment_blocks
The blocks in which this variable is assignednitc :: PhiFunction :: _block
The position in the AST of the phi-functionnitc :: Variable :: _declared_type
The declared type of the variablenitc :: Variable :: _dep_exprs
The expressions of AST of this variable dependsnitc :: PhiFunction :: _dependences
The dependences of this variable for SSA-Algorithmnitc :: Variable :: _original_variable
The original Variable in case of renamingnitc :: Variable :: _parameter
If true, this variable is a parameter of a methodnitc :: Variable :: _read_blocks
Part of the program where this variable is readnitc :: Variable :: _warn_unread
Is the local variable not read and need a warning?nitc :: PhiFunction :: add_dependences
Set the dependences for the phi-functionnitc :: Variable :: assignment_blocks
The blocks in which this variable is assignednitc :: Variable :: assignment_blocks=
The blocks in which this variable is assignednitc :: PhiFunction :: block=
The position in the AST of the phi-functioncore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: Variable :: declared_type
The declared type of the variablenitc :: Variable :: declared_type=
The declared type of the variablecore :: Object :: defaultinit
nitc :: PhiFunction :: defaultinit
nitc :: Variable :: defaultinit
nitc :: HInfoBoxable :: defaultinit
nitc :: Variable :: dep_exprs=
The expressions of AST of this variable dependsnitc :: PhiFunction :: dependences
The dependences of this variable for SSA-Algorithmnitc :: PhiFunction :: dependences=
The dependences of this variable for SSA-Algorithmnitc :: HInfoBoxable :: infobox
An new infobox documenting the entitynitc :: Variable :: is_adapted=
Was the variable type-adapted?core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.nitc :: Variable :: original_variable
The original Variable in case of renamingnitc :: Variable :: original_variable=
The original Variable in case of renamingcore :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: Variable :: parameter=
If true, this variable is a parameter of a methodnitc :: Variable :: read_blocks
Part of the program where this variable is readnitc :: Variable :: read_blocks=
Part of the program where this variable is readnitc :: Variable :: warn_unread
Is the local variable not read and need a warning?nitc :: Variable :: warn_unread=
Is the local variable not read and need a warning?
# A PhiFunction is a kind of Variable used in SSA-construction,
# it is placed at the beginning of a BasicBlock with many incoming blocks
class PhiFunction
super Variable
# The dependences of this variable for SSA-Algorithm
var dependences = new Array[Couple[Variable, BasicBlock]]
# The position in the AST of the phi-function
var block: BasicBlock
# Set the dependences for the phi-function
# *`block` BasicBlock in which we go through the dominance-frontier
# *`v` The variable to looking for
fun add_dependences(block: BasicBlock, v: Variable)
do
# Look in which blocks of DF(block) `v` has been assigned
for b in block.predecessors do
if v.assignment_blocks.has(b) then
var dep = new Couple[Variable, BasicBlock](v, b)
dependences.add(dep)
end
end
end
# Print the PhiFunction with all its dependences
redef fun to_s: String
do
var s = ""
s += " dependences = [ "
for d in dependences do
s += d.first.to_s + " "
end
s += "]"
return s
end
end
src/ssa.nit:159,1--196,3