public static JimpleType getArrayType(GimplePrimitiveType type) {
if (type instanceof GimpleRealType) {
if (((GimpleRealType) type).getPrecision() == 64) {
return new RealJimpleType(double[].class);
} else if (((GimpleRealType) type).getPrecision() == 32) {
return new RealJimpleType(float[].class);
}
} else if (type instanceof GimpleIntegerType) {
int precision = ((GimpleIntegerType) type).getPrecision();
switch(precision) {
case 8:
return new RealJimpleType(char[].class);
case 32:
return new RealJimpleType(int[].class);
case 64:
return new RealJimpleType(long[].class);
}
} else if (type instanceof GimpleBooleanType) {
return new RealJimpleType(boolean[].class);
}
throw new UnsupportedOperationException(type.toString());
}