soot.shimple.internal
Class SValueUnitPair

java.lang.Object
  extended by soot.tagkit.AbstractHost
      extended by soot.AbstractValueBox
          extended by soot.toolkits.scalar.ValueUnitPair
              extended by soot.shimple.internal.SValueUnitPair
All Implemented Interfaces:
Serializable, EquivTo, SUnitBox, Host, UnitBox, ValueBox

public class SValueUnitPair
extends ValueUnitPair
implements SUnitBox

Extension of ValueUnitPair that implements SUnitBox. Needed by SPatchingChain. Equality is no longer dependent on the value.

Author:
Navindra Umanee
See Also:
Serialized Form

Field Summary
protected  boolean unitChanged
           
 
Fields inherited from class soot.toolkits.scalar.ValueUnitPair
unit
 
Constructor Summary
SValueUnitPair(Value value, Unit unit)
           
 
Method Summary
 boolean isBranchTarget()
          Returns true if the UnitBox is holding a Unit that is the target of a branch (ie a Unit at the beginning of a CFG block).
 boolean isUnitChanged()
          Indicates whether the contents of the UnitBox may have been changed.
 void setUnit(Unit u)
          Sets this box to contain the given unit.
 void setUnitChanged(boolean unitChanged)
          Updates the value of the flag used to indicate whether the contents of the UnitBox may have changed.
 
Methods inherited from class soot.toolkits.scalar.ValueUnitPair
canContainUnit, canContainValue, clone, equals, equivHashCode, equivTo, getUnit, hashCode, toString, toString
 
Methods inherited from class soot.AbstractValueBox
getValue, setValue
 
Methods inherited from class soot.tagkit.AbstractHost
addAllTagsOf, addTag, getTag, getTags, hasTag, removeAllTags, removeTag
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface soot.UnitBox
canContainUnit, getUnit, toString
 
Methods inherited from interface soot.tagkit.Host
addAllTagsOf, addTag, getTag, getTags, hasTag, removeAllTags, removeTag
 

Field Detail

unitChanged

protected boolean unitChanged
Constructor Detail

SValueUnitPair

public SValueUnitPair(Value value,
                      Unit unit)
Method Detail

isBranchTarget

public boolean isBranchTarget()
Description copied from interface: UnitBox
Returns true if the UnitBox is holding a Unit that is the target of a branch (ie a Unit at the beginning of a CFG block). This is the default case.

Returns false if the UnitBox is holding a Unit that indicates the end of a CFG block and may require specialised processing for SSA.

Specified by:
isBranchTarget in interface UnitBox
Overrides:
isBranchTarget in class ValueUnitPair
See Also:
UnitBox.isBranchTarget()

setUnit

public void setUnit(Unit u)
Description copied from interface: UnitBox
Sets this box to contain the given unit. Subject to canContainValue() checks.

Specified by:
setUnit in interface UnitBox
Overrides:
setUnit in class ValueUnitPair
See Also:
UnitBox.setUnit(Unit)

isUnitChanged

public boolean isUnitChanged()
Description copied from interface: SUnitBox
Indicates whether the contents of the UnitBox may have been changed. Returns true if setUnit(Unit) has been called recently and was not followed by setUnitChanged(false).

Needed for Shimple internal Unit chain patching.

Specified by:
isUnitChanged in interface SUnitBox
See Also:
SUnitBox.isUnitChanged()

setUnitChanged

public void setUnitChanged(boolean unitChanged)
Description copied from interface: SUnitBox
Updates the value of the flag used to indicate whether the contents of the UnitBox may have changed.

Needed for Shimple internal Unit chain patching.

Specified by:
setUnitChanged in interface SUnitBox
See Also:
SUnitBox.setUnitChanged(boolean)