Search in sources :

Example 1 with TailCall

use of org.robovm.compiler.llvm.TailCall in project robovm by robovm.

the class Functions method tailcall.

public static Value tailcall(Function currentFunction, Value fn, Value... args) {
    Variable result = null;
    Type returnType = ((FunctionType) fn.getType()).getReturnType();
    if (returnType != VOID) {
        result = currentFunction.newVariable(returnType);
    }
    currentFunction.add(new TailCall(result, fn, args));
    return result == null ? null : result.ref();
}
Also used : PointerType(org.robovm.compiler.llvm.PointerType) Type(org.robovm.compiler.llvm.Type) FunctionType(org.robovm.compiler.llvm.FunctionType) Variable(org.robovm.compiler.llvm.Variable) TailCall(org.robovm.compiler.llvm.TailCall) FunctionType(org.robovm.compiler.llvm.FunctionType)

Aggregations

FunctionType (org.robovm.compiler.llvm.FunctionType)1 PointerType (org.robovm.compiler.llvm.PointerType)1 TailCall (org.robovm.compiler.llvm.TailCall)1 Type (org.robovm.compiler.llvm.Type)1 Variable (org.robovm.compiler.llvm.Variable)1