This function and class creates a template Function object which we can use to build a native, compiled function.
This is not to be confused with the R reserved
word function
.
Function(name, retType, paramTypes = list(), module = Module(), varArgs = FALSE, ...)
a string giving the name of the function
the return type of the new function. This should be of
class Type-class
.
a list giving the types of the parameters of the function. These can be named or not.
the module in which the function is to be defined
a logical value that indicates whether the routine has variadic arguments, i.e. passed to it via … (not the … in this function)
additional inputs for this call (not for calling the routine)
An object of class Function
LLVM Documentation http://llvm.org/docs/
# NOT RUN { # This shows how we can use LLVM to call an existing routine. m = Module() ee = ExecutionEngine(m) Rf_PrintValue = declareFunction(list(VoidType, SEXPType), "Rf_PrintValue", m) llvmAddSymbol("Rf_PrintValue") .llvm(Rf_PrintValue, 1:10) # }