edu.umd.cs.findbugs.ba.npe
Class WillBeDereferencedAnalysis

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<Fact>
      extended by edu.umd.cs.findbugs.ba.BackwardDataflowAnalysis<WillBeDereferencedInfo>
          extended by edu.umd.cs.findbugs.ba.npe.WillBeDereferencedAnalysis
All Implemented Interfaces:
DataflowAnalysis<WillBeDereferencedInfo>

public class WillBeDereferencedAnalysis
extends BackwardDataflowAnalysis<WillBeDereferencedInfo>

Dataflow analysis to look for parameters dereferenced unconditionally. Flow values are sets of parameters (indexed starting from 0) which are dereferenced on every path past the current location.

Author:
David Hovemeyer

Constructor Summary
WillBeDereferencedAnalysis(ReverseDepthFirstSearch rdfs, CFG cfg, org.apache.bcel.generic.MethodGen methodGen, ValueNumberDataflow vnaDataflow, TypeDataflow typeDataflow)
           
 
Method Summary
 void copy(WillBeDereferencedInfo source, WillBeDereferencedInfo dest)
          Copy dataflow facts.
 WillBeDereferencedInfo createFact()
          Create empty (uninitialized) dataflow facts for one program point.
 void initEntryFact(WillBeDereferencedInfo result)
          Initialize the "entry" fact for the graph.
 void initResultFact(WillBeDereferencedInfo result)
          Initialize result fact for block.
 boolean isFactValid(WillBeDereferencedInfo fact)
          Determine whether the given fact is valid (neither top nor bottom).
 void makeFactTop(WillBeDereferencedInfo fact)
          Make given fact the top value.
 void meetInto(WillBeDereferencedInfo fact, Edge edge, WillBeDereferencedInfo result)
          Meet a dataflow fact associated with an incoming edge into another fact.
 boolean same(WillBeDereferencedInfo fact1, WillBeDereferencedInfo fact2)
          Are given dataflow facts the same?
 void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, WillBeDereferencedInfo fact)
          Transfer function for a single instruction.
 
Methods inherited from class edu.umd.cs.findbugs.ba.BackwardDataflowAnalysis
getBlockOrder, getReverseDepthFirstSearch, isForwards
 
Methods inherited from class edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis
endTransfer, factToString, getFactAfterLocation, getFactAtLocation, getResultFact, getStartFact, resultFactIterator, startTransfer, transfer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WillBeDereferencedAnalysis

public WillBeDereferencedAnalysis(ReverseDepthFirstSearch rdfs,
                                  CFG cfg,
                                  org.apache.bcel.generic.MethodGen methodGen,
                                  ValueNumberDataflow vnaDataflow,
                                  TypeDataflow typeDataflow)
Method Detail

copy

public void copy(WillBeDereferencedInfo source,
                 WillBeDereferencedInfo dest)
Description copied from interface: DataflowAnalysis
Copy dataflow facts.


createFact

public WillBeDereferencedInfo createFact()
Description copied from interface: DataflowAnalysis
Create empty (uninitialized) dataflow facts for one program point. A valid value will be copied into it before it is used.


initEntryFact

public void initEntryFact(WillBeDereferencedInfo result)
                   throws DataflowAnalysisException
Description copied from interface: DataflowAnalysis
Initialize the "entry" fact for the graph.

Throws:
DataflowAnalysisException

initResultFact

public void initResultFact(WillBeDereferencedInfo result)
Description copied from interface: DataflowAnalysis
Initialize result fact for block. The start facts for a block are initialized as the meet of the "logical" predecessor's result facts. Note that a "logical predecessor" is actually a CFG successor if the analysis is backwards.


makeFactTop

public void makeFactTop(WillBeDereferencedInfo fact)
Description copied from interface: DataflowAnalysis
Make given fact the top value.


meetInto

public void meetInto(WillBeDereferencedInfo fact,
                     Edge edge,
                     WillBeDereferencedInfo result)
              throws DataflowAnalysisException
Description copied from interface: DataflowAnalysis
Meet a dataflow fact associated with an incoming edge into another fact. This is used to determine the start fact for a basic block.

Parameters:
fact - the predecessor fact (incoming edge)
edge - the edge from the predecessor
result - the result fact
Throws:
DataflowAnalysisException

same

public boolean same(WillBeDereferencedInfo fact1,
                    WillBeDereferencedInfo fact2)
Description copied from interface: DataflowAnalysis
Are given dataflow facts the same?


isFactValid

public boolean isFactValid(WillBeDereferencedInfo fact)
Description copied from class: AbstractDataflowAnalysis
Determine whether the given fact is valid (neither top nor bottom).

Specified by:
isFactValid in class AbstractDataflowAnalysis<WillBeDereferencedInfo>

transferInstruction

public void transferInstruction(org.apache.bcel.generic.InstructionHandle handle,
                                BasicBlock basicBlock,
                                WillBeDereferencedInfo fact)
                         throws DataflowAnalysisException
Description copied from class: AbstractDataflowAnalysis
Transfer function for a single instruction.

Specified by:
transferInstruction in class AbstractDataflowAnalysis<WillBeDereferencedInfo>
Parameters:
handle - the instruction
basicBlock - the BasicBlock containing the instruction; needed to disambiguate instructions in inlined JSR subroutines
fact - which should be modified based on the instruction
Throws:
DataflowAnalysisException