Package edu.umd.cs.findbugs.ba
Class BetterCFGBuilder2
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.BetterCFGBuilder2
-
- All Implemented Interfaces:
CFGBuilder,Debug,EdgeTypes
public class BetterCFGBuilder2 extends java.lang.Object implements CFGBuilder, EdgeTypes, Debug
A CFGBuilder that really tries to construct accurate control flow graphs. The CFGs it creates have accurate exception edges, and have accurately inlined JSR subroutines.- Author:
- David Hovemeyer
- See Also:
CFG
-
-
Field Summary
-
Fields inherited from interface edu.umd.cs.findbugs.ba.Debug
VERIFY_INTEGRITY
-
Fields inherited from interface edu.umd.cs.findbugs.ba.EdgeTypes
BACKEDGE_SOURCE_EDGE, BACKEDGE_TARGET_EDGE, CHECKED_EXCEPTIONS_FLAG, EXIT_EDGE, EXPLICIT_EXCEPTIONS_FLAG, FALL_THROUGH_EDGE, GOTO_EDGE, HANDLED_EXCEPTION_EDGE, IFCMP_EDGE, JSR_EDGE, RET_EDGE, RETURN_EDGE, START_EDGE, SWITCH_DEFAULT_EDGE, SWITCH_EDGE, UNHANDLED_EXCEPTION_EDGE, UNKNOWN_EDGE
-
-
Constructor Summary
Constructors Constructor Description BetterCFGBuilder2(MethodDescriptor descriptor, org.apache.bcel.generic.MethodGen methodGen)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuild()Build the CFG.CFGgetCFG()Get the CFG built by this object.intgetIndex(FieldDescriptor f)voidinline(edu.umd.cs.findbugs.ba.BetterCFGBuilder2.Context context)Inline a subroutine into a calling context.static voidmain(java.lang.String[] argv)Test driver.voidoptimize(org.apache.bcel.generic.InstructionList instructionList)
-
-
-
Constructor Detail
-
BetterCFGBuilder2
public BetterCFGBuilder2(@Nonnull MethodDescriptor descriptor, @Nonnull org.apache.bcel.generic.MethodGen methodGen)Constructor.- Parameters:
methodGen- the method to build a CFG for
-
-
Method Detail
-
getIndex
public int getIndex(FieldDescriptor f)
-
optimize
public void optimize(org.apache.bcel.generic.InstructionList instructionList)
-
build
public void build() throws CFGBuilderExceptionDescription copied from interface:CFGBuilderBuild the CFG.- Specified by:
buildin interfaceCFGBuilder- Throws:
CFGBuilderException
-
getCFG
public CFG getCFG()
Description copied from interface:CFGBuilderGet the CFG built by this object. Assumes that the build() method has already been called.- Specified by:
getCFGin interfaceCFGBuilder- Returns:
- the CFG
-
inline
public void inline(edu.umd.cs.findbugs.ba.BetterCFGBuilder2.Context context) throws CFGBuilderExceptionInline a subroutine into a calling context.- Parameters:
context- the Context- Throws:
CFGBuilderException
-
main
public static void main(java.lang.String[] argv) throws java.lang.ExceptionTest driver.- Throws:
java.lang.Exception
-
-