just format
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1505 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
f05e79871d
commit
bee4e6aa96
|
@ -39,7 +39,7 @@ public class SymbolTable {
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param numberOfParameters
|
* @param numberOfParameters
|
||||||
* in the IR .. should be ir.getNumberOfParameters()
|
* in the IR .. should be ir.getNumberOfParameters()
|
||||||
*/
|
*/
|
||||||
public SymbolTable(int numberOfParameters) {
|
public SymbolTable(int numberOfParameters) {
|
||||||
parameters = new int[numberOfParameters];
|
parameters = new int[numberOfParameters];
|
||||||
|
@ -69,7 +69,7 @@ public class SymbolTable {
|
||||||
* Common part of getConstant functions.
|
* Common part of getConstant functions.
|
||||||
*
|
*
|
||||||
* @param o
|
* @param o
|
||||||
* instance of a Java 'boxed-primitive' class, String or NULL.
|
* instance of a Java 'boxed-primitive' class, String or NULL.
|
||||||
* @return value number for constant.
|
* @return value number for constant.
|
||||||
*/
|
*/
|
||||||
int findOrCreateConstant(Object o) {
|
int findOrCreateConstant(Object o) {
|
||||||
|
@ -95,12 +95,16 @@ public class SymbolTable {
|
||||||
Trace.println("setting default for " + vn + " to " + defaultValue);
|
Trace.println("setting default for " + vn + " to " + defaultValue);
|
||||||
|
|
||||||
values[vn] = new Value() {
|
values[vn] = new Value() {
|
||||||
public boolean isStringConstant() { return false; }
|
public boolean isStringConstant() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isNullConstant() { return false; }
|
public boolean isNullConstant() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public int getDefaultValue(SymbolTable symtab) {
|
public int getDefaultValue(SymbolTable symtab) {
|
||||||
return findOrCreateConstant( defaultValue );
|
return findOrCreateConstant(defaultValue);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -153,7 +157,6 @@ public class SymbolTable {
|
||||||
return parameters[i];
|
return parameters[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void expandForNewValueNumber(int vn) {
|
private void expandForNewValueNumber(int vn) {
|
||||||
if (vn >= values.length) {
|
if (vn >= values.length) {
|
||||||
Value[] temp = values;
|
Value[] temp = values;
|
||||||
|
@ -173,7 +176,7 @@ public class SymbolTable {
|
||||||
* number
|
* number
|
||||||
*
|
*
|
||||||
* @param i
|
* @param i
|
||||||
* a value number
|
* a value number
|
||||||
*/
|
*/
|
||||||
public void ensureSymbol(int i) {
|
public void ensureSymbol(int i) {
|
||||||
if (i != -1) {
|
if (i != -1) {
|
||||||
|
@ -259,7 +262,8 @@ public class SymbolTable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws IllegalArgumentException if rhs is null
|
* @throws IllegalArgumentException
|
||||||
|
* if rhs is null
|
||||||
*/
|
*/
|
||||||
public int newPhi(int[] rhs) throws IllegalArgumentException {
|
public int newPhi(int[] rhs) throws IllegalArgumentException {
|
||||||
if (rhs == null) {
|
if (rhs == null) {
|
||||||
|
@ -305,14 +309,14 @@ public class SymbolTable {
|
||||||
}
|
}
|
||||||
return ((Number) ((ConstantValue) values[v]).getValue()).floatValue();
|
return ((Number) ((ConstantValue) values[v]).getValue()).floatValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getDoubleValue(int v) throws IllegalArgumentException {
|
public double getDoubleValue(int v) throws IllegalArgumentException {
|
||||||
if (!isNumberConstant(v)) {
|
if (!isNumberConstant(v)) {
|
||||||
throw new IllegalArgumentException("value number " + v + " is not a numeric constant.");
|
throw new IllegalArgumentException("value number " + v + " is not a numeric constant.");
|
||||||
}
|
}
|
||||||
return ((Number) ((ConstantValue) values[v]).getValue()).doubleValue();
|
return ((Number) ((ConstantValue) values[v]).getValue()).doubleValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getIntValue(int v) throws IllegalArgumentException {
|
public int getIntValue(int v) throws IllegalArgumentException {
|
||||||
if (!isNumberConstant(v)) {
|
if (!isNumberConstant(v)) {
|
||||||
throw new IllegalArgumentException("value number " + v + " is not a numeric constant.");
|
throw new IllegalArgumentException("value number " + v + " is not a numeric constant.");
|
||||||
|
@ -327,7 +331,7 @@ public class SymbolTable {
|
||||||
return ((Number) ((ConstantValue) values[v]).getValue()).longValue();
|
return ((Number) ((ConstantValue) values[v]).getValue()).longValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getConstantValue(int v) throws IllegalArgumentException{
|
public Object getConstantValue(int v) throws IllegalArgumentException {
|
||||||
if (!isConstant(v)) {
|
if (!isConstant(v)) {
|
||||||
throw new IllegalArgumentException("value number " + v + " is not a constant.");
|
throw new IllegalArgumentException("value number " + v + " is not a constant.");
|
||||||
}
|
}
|
||||||
|
@ -356,7 +360,7 @@ public class SymbolTable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param valueNumber
|
* @param valueNumber
|
||||||
* @return true iff this valueNumber is a paramter
|
* @return true iff this valueNumber is a parameter
|
||||||
*/
|
*/
|
||||||
public boolean isParameter(int valueNumber) {
|
public boolean isParameter(int valueNumber) {
|
||||||
return valueNumber <= getNumberOfParameters();
|
return valueNumber <= getNumberOfParameters();
|
||||||
|
|
Loading…
Reference in New Issue