|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.BasicBlockInterfVisitor
harpoon.Analysis.DataFlow.DataFlowBasicBlockVisitor
harpoon.Analysis.DataFlow.ForwardDataFlowBasicBlockVisitor
harpoon.Analysis.DataFlow.ReachingHCodeElements
public class ReachingHCodeElements
ReachingHCodeElements
is an extension of
ReachingDefs
for performing reaching definitions analysis on
HCodeElements
s.
Nested Class Summary | |
---|---|
protected static class |
ReachingDefs.BBVisitor.ReachingDefInfo
|
Constructor Summary | |
---|---|
ReachingHCodeElements(BasicBlock.Factory bbfactory)
Constructs a new ReachingHCodeElements for
the basic blocks in the supplied BasicBlock.Factory . |
|
ReachingHCodeElements(BasicBlock.Factory bbfactory,
SetFactory setFact)
Constructs a new ReachingHCodeElements for
the basic blocks in the supplied BasicBlock.Factory . |
Method Summary | |
---|---|
String |
dump()
|
protected Set |
findUniverse(Iterator blocks)
Constructs a Set of all of the HCodeElement s
in blocks which have non-empty def sets. |
Set |
getReachingAfter(HCodeElement hce)
Returns the Set of HCodeElements s
which represent a definition that reaches the point directly after
hce . |
Set |
getReachingBefore(HCodeElement hce)
Returns the Set of HCodeElements s
which represent a definition that reaches the point directly before
hce . |
Set |
getReachingOnEntry(BasicBlock b)
Returns the Set of definitions that reach the exit of
b . |
Set |
getReachingOnExit(BasicBlock b)
Returns the Set of definitions that reach the exit of
b . |
protected void |
initializeBBtoRDI(Iterator blocks,
SetFactory setFact)
Initializes an internal mapping of BasicBlock s to
ReachingDefInfo s. |
protected void |
initializeGenPrsv(Iterator blocks,
SetFactory sf)
Initializes a mapping of temps to the Set of HCodeElement s
which do not define them. |
protected ReachingDefs.BBVisitor.ReachingDefInfo |
makeGenPrsv(BasicBlock bb,
SetFactory sf)
Initializes the GEN/PRSV information for 'bb' and stores in in the returned ReachingDefInfo . |
boolean |
merge(BasicBlockInterf from,
BasicBlockInterf to)
Merge (Confluence) operator. |
void |
visit(BasicBlock b)
Visit (Transfer) function. |
Methods inherited from class harpoon.Analysis.DataFlow.ForwardDataFlowBasicBlockVisitor |
---|
addSuccessors |
Methods inherited from class harpoon.Analysis.DataFlow.DataFlowBasicBlockVisitor |
---|
db, visit |
Methods inherited from class harpoon.Analysis.BasicBlockInterfVisitor |
---|
visit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReachingHCodeElements(BasicBlock.Factory bbfactory)
ReachingHCodeElements
for
the basic blocks in the supplied BasicBlock.Factory
.
bbfactory
is a valid
BasicBlock.Factory
.
basicBlocks
implement
UseDefable
,
BasicBlockVisitor
and initializes internal datasets for analysis of the
BasicBlock
s in bbfactory
.
bbfactory
- BasicBlock.Factory
of
BasicBlock
s to be analyzed.public ReachingHCodeElements(BasicBlock.Factory bbfactory, SetFactory setFact)
ReachingHCodeElements
for
the basic blocks in the supplied BasicBlock.Factory
.
Allows the user to specify their own SetFactory
for
constructing sets of HCodeElements
in the analysis.
bbfactory
is a valid
BasicBlock.Factory
.
basicBlocks
implement
UseDefable
,
HCodeElements
in basicBlocks
which have non-empty def sets are members of the universe of
setFact
.
BasicBlockVisitor
and initializes internal datasets for analysis of the
BasicBlock
s in bbfactory
.
bbfactory
- BasicBlock.Factory
of
BasicBlock
s to be analyzed.setFact
- the SetFactory
to be used in
the construction of sets of
HCodeElements
.Method Detail |
---|
protected Set findUniverse(Iterator blocks)
Set
of all of the HCodeElement
s
in blocks
which have non-empty def sets.
blocks
is an Iterator
of
BasicBlock
s.
blocks
implement UseDefable
.
blocks
blocks
, adding each instruction which has a non-empty
def set to a universe of values, returning the universe after all of
the instructions have been visited. Internally maintains a reference
to this computed dataset.
protected void initializeGenPrsv(Iterator blocks, SetFactory sf)
HCodeElement
s
which do not define them.
blocks
is an Iterator
of
BasicBlock
s.
blocks
implement UseDefable
.
HCodeElements
in basicBlocks
which have non-empty def sets are members of the universe of
setFact
.
protected ReachingDefs.BBVisitor.ReachingDefInfo makeGenPrsv(BasicBlock bb, SetFactory sf)
ReachingDefInfo
.
initializeGenPrsv
has already been called on this
ReachingHCodeElements
object, and bb
was
one of the blocks in the Iterator
parameter to the last
such invocation.
public Set getReachingBefore(HCodeElement hce)
Set
of HCodeElements
s
which represent a definition that reaches the point directly before
hce
. If hce
represents more than one
definition, all definitions which it represents must reach this point.
Because of this, the ReachingHCodeElements
class is
most useful for intermediate representations in which each
HCodeElement
can represent only 1 definition.
BasicBlock
s containing some block that contains
hce
, with this
as the
DataFlowBasicBlockVisitor
.
Set
of Temp
s that are live on
entry to hce
.
public Set getReachingAfter(HCodeElement hce)
Set
of HCodeElements
s
which represent a definition that reaches the point directly after
hce
. If hce
represents more than one
definition, all definitions which it represents must reach this point.
Because of this, the ReachingHCodeElements
class is
most useful for intermediate representations in which each
HCodeElement
can represent only 1 definition.
BasicBlock
s containing some block that contains
hce
, with this
as the
DataFlowBasicBlockVisitor
.
Set
of Temp
s that are live on
entry to hce
.
protected void initializeBBtoRDI(Iterator blocks, SetFactory setFact)
BasicBlock
s to
ReachingDefInfo
s.
public boolean merge(BasicBlockInterf from, BasicBlockInterf to)
from
corresponds to a member of Pred('bb'). It
is the responsibility of the DataFlow Equation Solver to run
merge
on all of the Pred('bb')
harpoon.Analysis.DataFlow
package.
child
and parent
are contained in
this
to
to
include information associated with from
.
merge
in class DataFlowBasicBlockVisitor
public void visit(BasicBlock b)
visit
in class DataFlowBasicBlockVisitor
public Set getReachingOnEntry(BasicBlock b)
Set
of definitions that reach the exit of
b
.
BasicBlock
s containing
b
with this
as the
DataFlowBasicBlockVisitor
.
public Set getReachingOnExit(BasicBlock b)
Set
of definitions that reach the exit of
b
.
BasicBlock
s containing
b
with this
as the
DataFlowBasicBlockVisitor
.
public String dump()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |