This function is used to create and initialize a global variable in an LLVM module.
createGlobalVariable(id, mod, type = getType(val), val = NULL,
constant = FALSE, linkage = ExternalLinkage,
threadLocal = FALSE)
the name of the variable, a character string
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
.
the module in which the variable is being defined
the type of the variable
a logical value indicatingwhether the variable is constant or can be changed.
the linkage model for the variable, typically ExternalLinkage
.
a logical value indicating whether the variable is thread-specific or truly global
An object of class GlobalVariable
.
LLVM Documentation http://llvm.org/docs/