layout: page title: GlobalValue (llvm.core)

The class llvm.core.GlobalValue represents module-scope aliases, variables and functions. Global variables are represented by the sub-class llvm.core.GlobalVariable and functions by llvm.core.Function.

Global values have the read-write properties linkage, section, visibility and alignment. Use one of the following constants (from llvm.core) as values for linkage (see LLVM documentaion for details on each):

The section property can be assigned strings (like ”.rodata”), which will be used if the target supports it. Visibility property can be set to one of thse constants (from llvm.core, see also LLVM docs):

Value | Equivalent LLVM Assembly Keyword | ——|———————————-| VISIBILITY_DEFAULT | default | VISIBILITY_HIDDEN | hidden | VISIBILITY_PROTECTED | protected |

The alignment property can be 0 (default), or can be set to a power of 2. The read-only property is_declaration can be used to check if the global is a declaration or not. The module to which the global belongs to can be retrieved using the module property (read-only).

# llvm.core.GlobalValue¶

## Properties¶

### section¶

A string like ”.rodata”, indicating the section into which the global is placed into.

### visibility¶

The visibility type, takes one of the constants listed above (VISIBILITY_*).

### alignment¶

A power-of-2 integer indicating the boundary to align to.

### is_declaration¶

True if the global is a declaration, False otherwise.

### module¶

The module object to which this global belongs to.

## Automatically Generated Documentation¶

class llvm.core.GlobalValue(builder, ptr)
alignment
is_declaration