Basic block

A sequence of instructions inside a function. A basic block always starts with a Label and ends with a terminator. No other instruction inside the basic block can transfer control out of the block.

Function declaration

The specification of a function’s prototype without an associated implementation. A declaration includes the argument types, return types and other information such as the calling convention. This is like an extern function declaration in C.

Function definition

A function’s prototype, as in a Function declaration, plus a body implementing the function.


An LLVM Instruction that lets you get the address of a subelement of an aggregate data structure.

See 'getelementptr' Instruction in the official LLVM documentation.

Global value

A named value accessible to all members of a module.

Global variable

A variable whose value is accessible to all members of a module. It is a constant pointer to a module-allocated slot of the given type.

All global variables are global values. However, the opposite is not true—function declarations and function definitions are not global variables, they are only global values.


The fundamental element used in implementing an LLVM function. LLVM instructions define a procedural, assembly-like language.

Intermediate representation (IR)

High-level assembly-language code describing to LLVM the program to be compiled to native code.


A branch target inside a function. A label always denotes the start of a Basic block.


Optional information associated with LLVM instructions, functions and other code. Metadata provides information that is not critical to the compiling of an LLVM intermediate representation, such as the likelihood of a condition branch or the source code location corresponding to a given instruction.


A compilation unit for LLVM intermediate representation. A module can contain any number of function declarations and definitions, global variables and metadata.

Terminator, terminator instruction

A kind of Instruction that explicitly transfers control to another part of the program instead of going to the next instruction after it is executed. Examples are branches and function returns.