dot.llvm: Invoke an LLVM Function from R

Description Usage Arguments Value Author(s) References See Also Examples

Description

These functions provide the mechanism to call an LLVM Function, passing it R objects as arguments. This is analogous to the .C interface, but for routines generated via LLVM, either read from existing files or generated in the R session.

Usage

1
2
3
.llvm(.x, ..., .args = list(...),
      .ee = ExecutionEngine(as(.x, "Module")),
      .all = FALSE, .duplicate = .duplicateArgs(.x))

Arguments

.x

the reference to the LLVM Function object

...

arguments for the Function

.args

an alternative way mechanism to pass the arguments for the Function as a single R list.

.ee

the LLVM ExecutionEngine providing the context for the Function. This can be created for each call or an instance can be reused across calls.

.all

a logical value that controls whether all of the arguments are also returned, or just the return value from the Function is returned. When the Function can modify any of the arguments .all = TRUE is typically important.

.duplicate

a logical vector indicating which arguments need to be copied before being passed to the Function. This allows us to avoid copying inputs which are not mutated/modified by the Function.

Value

If .all is FALSE, the return value from Function is returned as an R object.

Author(s)

Duncan Temple Lang

References

http://llvm.org

See Also

The RLLVMCompile package parseIR Module, Function

Examples

1
2
  module = parseIR(system.file("IR", "fib.ll", package = "Rllvm"))
  .llvm(module$fib, 11)

doktorschiwago/Rllvm2 documentation built on May 15, 2019, 9:42 a.m.