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

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

public class UnconditionalDerefAnalysis
extends BackwardDataflowAnalysis<UnconditionalDerefSet>

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
UnconditionalDerefAnalysis(ReverseDepthFirstSearch rdfs, CFG cfg, org.apache.bcel.generic.MethodGen methodGen, ValueNumberDataflow vnaDataflow, TypeDataflow typeDataflow)
           
 
Method Summary
 void copy(UnconditionalDerefSet source, UnconditionalDerefSet dest)
          Copy dataflow facts.
 UnconditionalDerefSet createFact()
          Create empty (uninitialized) dataflow facts for one program point.
 void initEntryFact(UnconditionalDerefSet result)
          Initialize the "entry" fact for the graph.
 void initResultFact(UnconditionalDerefSet result)
          Initialize result fact for block.
 boolean isFactValid(UnconditionalDerefSet fact)
          Determine whether the given fact is valid (neither top nor bottom).
static void main(java.lang.String[] argv)
           
 void makeFactTop(UnconditionalDerefSet fact)
          Make given fact the top value.
 void meetInto(UnconditionalDerefSet fact, Edge edge, UnconditionalDerefSet result)
          Meet a dataflow fact associated with an incoming edge into another fact.
 boolean same(UnconditionalDerefSet fact1, UnconditionalDerefSet fact2)
          Are given dataflow facts the same?
 void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, UnconditionalDerefSet 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

UnconditionalDerefAnalysis

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

copy

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


createFact

public UnconditionalDerefSet 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(UnconditionalDerefSet result)
                   throws DataflowAnalysisException
Description copied from interface: DataflowAnalysis
Initialize the "entry" fact for the graph.

Throws:
DataflowAnalysisException

initResultFact

public void initResultFact(UnconditionalDerefSet 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(UnconditionalDerefSet fact)
Description copied from interface: DataflowAnalysis
Make given fact the top value.


meetInto

public void meetInto(UnconditionalDerefSet fact,
                     Edge edge,
                     UnconditionalDerefSet 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(UnconditionalDerefSet fact1,
                    UnconditionalDerefSet fact2)
Description copied from interface: DataflowAnalysis
Are given dataflow facts the same?


isFactValid

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

Specified by:
isFactValid in class AbstractDataflowAnalysis<UnconditionalDerefSet>

transferInstruction

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

Specified by:
transferInstruction in class AbstractDataflowAnalysis<UnconditionalDerefSet>
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

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Throws:
java.lang.Exception