Function

0th

Percentile

Create an LLVM function/routine

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.

Keywords
programming
Usage
Function(name, retType, paramTypes = list(), module = Module(), varArgs = FALSE, ...)
Arguments
name

a string giving the name of the function

retType

the return type of the new function. This should be of class Type-class.

paramTypes

a list giving the types of the parameters of the function. These can be named or not.

module

the module in which the function is to be defined

varArgs

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)

Value

An object of class Function

References

LLVM Documentation http://llvm.org/docs/

See Also

Block, IRBuilder

Aliases
  • Function
  • Routine
  • Function-class
  • names<-,Function,character-method
  • names<-,ParameterList,character-method
  • names,Function-method
  • [,Function,numeric,missing-method
  • [[,Function,character,ANY-method
  • coerce,Function,Module-method
  • getParameters
  • $,Function-method
  • setLinkage
  • ExternalLinkage
  • AvailableExternallyLinkage
  • LinkOnceAnyLinkage
  • LinkOnceODRLinkage
  • WeakAnyLinkage
  • WeakODRLinkage
  • AppendingLinkage
  • InternalLinkage
  • PrivateLinkage
  • LinkerPrivateLinkage
  • DLLImportLinkage
  • DLLExportLinkage
  • ExternalWeakLinkage
  • CommonLinkage
  • coerce,Function,function-method
  • getFunctionArgs
  • setFuncAttributes
  • getFuncAttributes
  • setParamAttributes
  • makeRFunction
  • getBlocks
  • getModule,Function-method
  • coerce,Function,function-method
  • [[,Function,numeric,ANY-method
  • getParent,Function-method
  • LLVMAttributes
  • isVarArg
Examples


# 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)
Documentation reproduced from package Rllvm, version 0.7-0, License: GPL-2

Community examples

Looks like there are no examples yet.