createProxy: Create an R function to call a native routine

Description Usage Arguments Value Author(s) See Also

Description

This is a simple function that generates a compiled routine that we can call to invoke the native routine. We can already do this with rdyncall or Rffi. However, this is another approach that uses LLVM.

It is not clear we actually need this. We can call existing routines directly (except with ...) via .llvm. See the example on the Function page.

Usage

1
2
3
createProxy(name, returnType, types = list(), id = sprintf("r%s", name),
             mod = Module(name), ee = ExecutionEngine(mod),
              env = globalenv(), sym = getNativeSymbolInfo(name)$address, ...)

Arguments

name

the name of the routine to which we are interfacing

returnType

the return type of the routine to which we are interfacing

types

the parameter types of the target routine

id

the name of the R routine

mod

the LLVM module in which to create the routine

ee

the LLVM execution engine

env

the environment for the R function

sym

the address of the routine to which we are interfacing

...

additional arguments

Value

The compiled routine that calls the native routine.

Author(s)

Duncan Temple Lang

See Also

.llvm


duncantl/RLLVMCompile documentation built on May 15, 2019, 5:31 p.m.