use of org.robovm.compiler.llvm.Variable in project robovm by robovm.
the class BroMethodCompiler method marshalMachineSizedSIntToLong.
protected Value marshalMachineSizedSIntToLong(Function fn, Value value) {
if (config.getArch().is32Bit()) {
Variable result = fn.newVariable(I64);
fn.add(new Sext(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 marshalNativeToObject.
protected Value marshalNativeToObject(Function fn, MarshalerMethod marshalerMethod, MarshaledArg marshaledArg, Value env, String valueClassName, Value nativeValue, long flags) {
if (nativeValue.getType() instanceof StructureType) {
nativeValue = createStackCopy(fn, nativeValue);
}
Invokestatic invokestatic = marshalerMethod.getInvokeStatic(sootMethod.getDeclaringClass());
trampolines.add(invokestatic);
Value valueClass = ldcClass(fn, valueClassName, env);
Variable handle = fn.newVariable(I64);
fn.add(new Ptrtoint(handle, nativeValue, I64));
Value object = call(fn, invokestatic.getFunctionRef(), env, valueClass, handle.ref(), new IntegerConstant(flags));
if (marshaledArg != null) {
marshaledArg.handle = handle.ref();
marshaledArg.object = object;
}
return object;
}
use of org.robovm.compiler.llvm.Variable in project robovm by robovm.
the class BroMethodCompiler method marshalMachineSizedFloatToDouble.
protected Value marshalMachineSizedFloatToDouble(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;
}
}
Aggregations