use of org.robovm.compiler.llvm.Variable in project robovm by robovm.
the class BroMethodCompiler method marshalFloatToMachineSizedFloat.
protected Value marshalFloatToMachineSizedFloat(Function fn, Value value) {
if (!config.getArch().is32Bit()) {
Variable result = fn.newVariable(DOUBLE);
fn.add(new Fpext(result, value, DOUBLE));
return result.ref();
} else {
return value;
}
}
use of org.robovm.compiler.llvm.Variable in project robovm by robovm.
the class ClassCompiler method getClassFieldPtr.
static Value getClassFieldPtr(Function f, SootField field, List<SootField> classFields, StructureType classType) {
Value info = getInfoStruct(f, field.getDeclaringClass());
Variable base = f.newVariable(I8_PTR);
f.add(new Load(base, info));
return getFieldPtr(f, new VariableRef(base), offsetof(classType, 1, classFields.indexOf(field), 1), getType(field.getType()));
}
use of org.robovm.compiler.llvm.Variable in project robovm by robovm.
the class BroMethodCompiler method marshalMachineSizedUIntToLong.
protected Value marshalMachineSizedUIntToLong(Function fn, Value value) {
if (config.getArch().is32Bit()) {
Variable result = fn.newVariable(I64);
fn.add(new Zext(result, value, I64));
return result.ref();
} else {
return value;
}
}
use of org.robovm.compiler.llvm.Variable in project robovm by robovm.
the class BroMethodCompiler method marshalLongToMachineSizedInt.
protected Value marshalLongToMachineSizedInt(Function fn, Value value) {
if (config.getArch().is32Bit()) {
Variable result = fn.newVariable(I32);
fn.add(new Trunc(result, value, I32));
return result.ref();
} else {
return value;
}
}
use of org.robovm.compiler.llvm.Variable in project robovm by robovm.
the class BroMethodCompiler method marshalArrayToNative.
protected void marshalArrayToNative(Function fn, MarshalerMethod marshalerMethod, Value env, Value object, Value destPtr, long flags, int[] dimensions) {
Invokestatic invokestatic = marshalerMethod.getInvokeStatic(sootMethod.getDeclaringClass());
trampolines.add(invokestatic);
Variable handle = fn.newVariable(I64);
fn.add(new Ptrtoint(handle, destPtr, I64));
List<Value> args = new ArrayList<>();
args.add(env);
args.add(object);
args.add(handle.ref());
args.add(new IntegerConstant(flags));
args.addAll(arrayDimensionsValues(dimensions));
call(fn, invokestatic.getFunctionRef(), args);
}
Aggregations