Package com.tonic.analysis.pdg.edge
Enum PDGDependenceType
- java.lang.Object
-
- java.lang.Enum<PDGDependenceType>
-
- com.tonic.analysis.pdg.edge.PDGDependenceType
-
- All Implemented Interfaces:
Serializable,Comparable<PDGDependenceType>
public enum PDGDependenceType extends Enum<PDGDependenceType>
Kind of dependence a PDG edge carries - control, data, or interprocedural.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CALLLinks a call site to the entry of the method it invokes.CONTROL_EXCEPTIONThe dependent node runs only when the protected region throws and control reaches a handler.CONTROL_FALSEThe dependent node runs only when the governing branch takes its false side.CONTROL_SWITCHThe dependent node runs only when a switch selects the case that guards it.CONTROL_TRUEThe dependent node runs only when the governing branch takes its true side.CONTROL_UNCONDITIONALThe dependent node runs whenever the governing node does, with no condition to satisfy.DATA_ANTIA write must stay ordered after an earlier read of the same location, so reordering would not clobber a value still in use.DATA_DEF_USEA read depends on the write that supplies the value it observes.DATA_OUTPUTTwo writes to the same location must keep their relative order, so the last one still wins.DATA_PHIA read depends on a phi that merges definitions arriving from several predecessors.PARAMETER_INBinds an argument at a call site to the callee's matching formal parameter; counted as neither control nor data dependence.PARAMETER_OUTBinds the callee's returned value back to the call site that receives it.RETURNLinks a method exit back to the point in the caller where execution resumes.SUMMARYCondenses a callee's parameter-to-return effect so a slice can cross the call without descending into the body.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PDGDependenceTypeforBranchCondition(boolean condition)Picks the control edge type for one side of a branch.StringgetDescription()StringgetShortName()booleanisControlDependence()booleanisControlDependency()booleanisDataDependence()booleanisDataDependency()booleanisInterproceduralEdge()static PDGDependenceTypevalueOf(String name)Returns the enum constant of this type with the specified name.static PDGDependenceType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CONTROL_TRUE
public static final PDGDependenceType CONTROL_TRUE
The dependent node runs only when the governing branch takes its true side.
-
CONTROL_FALSE
public static final PDGDependenceType CONTROL_FALSE
The dependent node runs only when the governing branch takes its false side.
-
CONTROL_EXCEPTION
public static final PDGDependenceType CONTROL_EXCEPTION
The dependent node runs only when the protected region throws and control reaches a handler.
-
CONTROL_UNCONDITIONAL
public static final PDGDependenceType CONTROL_UNCONDITIONAL
The dependent node runs whenever the governing node does, with no condition to satisfy.
-
CONTROL_SWITCH
public static final PDGDependenceType CONTROL_SWITCH
The dependent node runs only when a switch selects the case that guards it.
-
DATA_DEF_USE
public static final PDGDependenceType DATA_DEF_USE
A read depends on the write that supplies the value it observes.
-
DATA_PHI
public static final PDGDependenceType DATA_PHI
A read depends on a phi that merges definitions arriving from several predecessors.
-
DATA_ANTI
public static final PDGDependenceType DATA_ANTI
A write must stay ordered after an earlier read of the same location, so reordering would not clobber a value still in use.
-
DATA_OUTPUT
public static final PDGDependenceType DATA_OUTPUT
Two writes to the same location must keep their relative order, so the last one still wins.
-
PARAMETER_IN
public static final PDGDependenceType PARAMETER_IN
Binds an argument at a call site to the callee's matching formal parameter; counted as neither control nor data dependence.
-
PARAMETER_OUT
public static final PDGDependenceType PARAMETER_OUT
Binds the callee's returned value back to the call site that receives it.
-
CALL
public static final PDGDependenceType CALL
Links a call site to the entry of the method it invokes.
-
RETURN
public static final PDGDependenceType RETURN
Links a method exit back to the point in the caller where execution resumes.
-
SUMMARY
public static final PDGDependenceType SUMMARY
Condenses a callee's parameter-to-return effect so a slice can cross the call without descending into the body.
-
-
Method Detail
-
values
public static PDGDependenceType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PDGDependenceType c : PDGDependenceType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PDGDependenceType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getShortName
public String getShortName()
- Returns:
- the short name
-
getDescription
public String getDescription()
- Returns:
- the description
-
isControlDependence
public boolean isControlDependence()
- Returns:
- whether control dependence
-
isDataDependence
public boolean isDataDependence()
- Returns:
- whether data dependence
-
isInterproceduralEdge
public boolean isInterproceduralEdge()
- Returns:
- true for the parameter, call, return and summary edge types that cross method boundaries
-
isControlDependency
public boolean isControlDependency()
- Returns:
- whether control dependency
-
isDataDependency
public boolean isDataDependency()
- Returns:
- whether data dependency
-
forBranchCondition
public static PDGDependenceType forBranchCondition(boolean condition)
Picks the control edge type for one side of a branch.- Parameters:
condition- true for the taken branch, false for the fall-through- Returns:
- CONTROL_TRUE or CONTROL_FALSE
-
-