createGlobalVariable: Define a native global variable

View source: R/globalVar.R

createGlobalVariableR Documentation

Define a native global variable

Description

This function is used to create and initialize a global variable in an LLVM module.

Usage

createGlobalVariable(id, mod, type = getType(val), val = NULL,
                     constant = FALSE, linkage = ExternalLinkage,
                      threadLocal = FALSE)

Arguments

id

the name of the variable, a character string

val

the initial value of the variable which can be NULL. If it is NULL, then the type must be provided. It is also important to initialize the global variable with setInitializer.

mod

the module in which the variable is being defined

type

the type of the variable

constant

a logical value indicatingwhether the variable is constant or can be changed.

linkage

the linkage model for the variable, typically ExternalLinkage.

threadLocal

a logical value indicating whether the variable is thread-specific or truly global

Value

An object of class GlobalVariable.

Author(s)

Duncan Temple Lang

References

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


duncantl/Rllvm documentation built on Nov. 23, 2023, 4:24 p.m.