public class SSAValue extends Object
TypeSafeInstructionFactory
,
com.ibm.wala.util.ParameterAccessor
Modifier and Type | Class and Description |
---|---|
static class |
SSAValue.NamedKey
Identify variables by a string and type.
|
static class |
SSAValue.TypeKey
A key that matches variables by their type - does not compare to NamedKey.
|
static class |
SSAValue.UniqueKey
A key that cannot be recreated.
|
static interface |
SSAValue.VariableKey
All variables with the same name in the source code.
|
static class |
SSAValue.WeaklyNamedKey
This NamedKey also equals to TypeKeys.
|
Modifier and Type | Field and Description |
---|---|
SSAValue.VariableKey |
key
All variables with the same name in the source code share a key.
|
protected MethodReference |
mRef
Method the variable is valid in
|
protected int |
number
The SSA Value itself
|
protected TypeReference |
type
The type of this variable
|
Constructor and Description |
---|
SSAValue(int number,
SSAValue copyFrom)
Create a new instance of the same type, validity and name.
|
SSAValue(int number,
TypeReference type,
MethodReference validIn)
Generates a SSAValue with a UniqueKey.
|
SSAValue(int number,
TypeReference type,
MethodReference validIn,
SSAValue.VariableKey key)
Makes a SSAValue with number and type valid in the specified Method.
|
SSAValue(int number,
TypeReference type,
MethodReference validIn,
String variableName)
Generates a SSAValue with a NamedKey (or TypeKey if name==null).
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getNumber()
The SSA-Value to use with SSAInstructions.
|
TypeReference |
getType()
The type this SSA-Value represents.
|
MethodReference |
getValidIn()
Return the MethodReference this Variable was set valid in.
|
String |
getVariableName()
Return the optional variable name.
|
int |
hashCode() |
boolean |
isAssigned()
If setAssigned() was called on this variable.
|
void |
setAssigned()
Mark this variable as assigned.
|
String |
toString() |
protected final int number
protected final TypeReference type
public final SSAValue.VariableKey key
protected final MethodReference mRef
public SSAValue(int number, TypeReference type, MethodReference validIn, SSAValue.VariableKey key)
number
- access the value using this numbervalidIn
- optionally assign this value to a methodvariableName
- optional name of the variableIllegalArgumentException
- on negative parameter numberpublic SSAValue(int number, TypeReference type, MethodReference validIn, String variableName)
public SSAValue(int number, TypeReference type, MethodReference validIn)
public SSAValue(int number, SSAValue copyFrom)
number
- the new number to usecopyFrom
- where to get the rest of the attributespublic int getNumber()
public TypeReference getType()
public boolean isAssigned()
public void setAssigned()
IllegalStateException
- if the variable was already assigned topublic MethodReference getValidIn()
public String getVariableName()