emptyModule : LModule
Create an empty LLVM module with no data layout, target, clauses, or tags.
Returns a minimal LModule that can be used as a starting point for
building LLVM modules or as a default module.
Visibility: exportemptySymbolInfo : SymbolInfo
Create empty symbol information with no linkage, preemption, visibility, or storage.
Returns a default SymbolInfo with all optional fields set to Nothing,
suitable as a default for symbols that don't need special attributes.
Visibility: exportwithType : LType -> LExpr -> WithType LExpr
Associate a type with an expression to create a typed value.
Creates a WithType wrapper that pairs an LLVM type with an expression,
providing type information that LLVM requires for many operations.
This is essential for type safety in LLVM IR.
@ ty The LLVM type of the expression
@ expr The expression to be typed
Visibility: public exportmkBool : Bool -> LExpr
Create a boolean constant.
Creates an LLVM boolean constant from a Bool value.
In LLVM IR, booleans are represented as i1 (1-bit integers).
@ b The boolean value (True or False)
Visibility: exportmkString : String -> LExpr
Create a string constant.
Creates an LLVM string constant from a String value.
The string will be null-terminated in the generated LLVM IR.
@ s The string value to create as a constant
Visibility: exportmkNull : LExpr
Create a null pointer constant.
Creates an LLVM null pointer constant, representing a pointer
with value zero (null). Used for pointer initialization and
null pointer checks.
Visibility: exportmkUndefined : LExpr
Create an undefined constant.
Creates an LLVM undefined value constant, representing an
unspecified value. Useful for optimization and when the
specific value doesn't matter.
Visibility: exportmkFloat : String -> LExpr
Create a floating point constant.
Creates an LLVM floating point constant from a string representation.
The string should contain a valid floating point literal that LLVM
can parse.
@ f The string representation of the floating point value
Visibility: exportmkArray : List (WithType LExpr) -> LExpr
Create an array constant.
Creates an LLVM array constant from a list of typed constant elements.
All elements must have compatible types for the array type.
@ elems List of typed constant elements for the array
Visibility: exportmkStruct : List (WithType LExpr) -> LExpr
Create a struct constant.
Creates an LLVM struct constant from a list of typed constant fields.
The fields are ordered and their types must match the struct definition.
@ fields List of typed constant fields for the struct
Visibility: exportmkVector : List (WithType LExpr) -> LExpr
Create a vector constant.
Creates an LLVM vector constant from a list of typed constant elements.
All elements must have the same type and the count must match the vector type.
@ elems List of typed constant elements for the vector
Visibility: exportconstExpr : LExpr -> LExpr
Create an expression from a constant.
Converts an LLVM constant into an expression that can be used
in operations and instructions. This is necessary because LLVM
distinguishes between constants and expressions syntactically.
@ c The constant to convert to an expression
Visibility: exportlocal : String -> Name
Create a local variable reference.
Creates a Name representing a local variable or temporary.
Local variables are scoped to the current function and are
prefixed with '%' in LLVM IR.
@ name The string name of the local variable
Visibility: export($@) : String -> LExpr
- Visibility: public export
Fixity Declaration: prefix operator, level 10 global : String -> Name
Create a global variable reference.
Creates a Name representing a global variable or function.
Global variables are visible across the entire module and are
prefixed with '@' in LLVM IR.
@ name The string name of the global variable
Visibility: exportptrExpr : Name -> LExpr
Create a pointer expression from a name.
Creates an expression representing a pointer to the named entity.
This is useful for taking addresses of variables and functions.
@ name The name of the entity to create a pointer to
Visibility: exportlocalPtr : String -> LExpr
Create a local variable pointer expression.
Creates a pointer expression to a local variable by name.
This is a convenience function that combines local name creation
with pointer expression generation.
@ name The string name of the local variable to point to
Visibility: exportglobalPtr : String -> LExpr
Create a global variable pointer expression.
Creates a pointer expression to a global variable by name.
This is a convenience function that combines global name creation
with pointer expression generation.
@ name The string name of the global variable to point to
Visibility: export($*) : Name -> LExpr
Convenient operator to create a pointer expression from a name.
Creates a pointer expression from a Name. This is a shorthand
for `ptrExpr name` that makes pointer operations more readable.
@ name The name to create a pointer expression for
Visibility: public export
Fixity Declaration: prefix operator, level 10block : {default "entry" _ : String} -> {default [] _ : List LStatement} -> Terminator -> Block
Create a labeled statement.
Creates a label statement that can serve as a target for branches,
jumps, and other control flow instructions. Labels mark specific
points in the code that can be referenced.
@ name The string name of the label
Visibility: export($<-) : Name -> LOperation -> LStatement
Convenient operator to create a targeted statement (assignment).
Creates a statement that assigns the result of an operation to a
target variable. This is a shorthand for `Operation target op` that
makes assignment operations more readable.
@ target The target variable name to assign to
@ op The operation whose result to assign
Visibility: public export
Fixity Declaration: infix operator, level 0assign : Name -> LOperation -> LStatement
Create a targeted statement (assignment).
Creates a statement that assigns the result of an operation to a
target variable. The target can be a local or global variable name.
@ target The target variable name to assign to
@ op The operation whose result to assign
Visibility: exportdiscard : LOperation -> LStatement
Create a discarded statement (no assignment).
Creates a statement that executes an operation but discards its result.
This is used for operations that have side effects but whose return
value is not needed.
@ op The operation to execute and discard
Visibility: exportsymbolInfo : {default Nothing _ : Maybe Linkage} -> {default Nothing _ : Maybe Preemption} -> {default Nothing _ : Maybe Visibility} -> {default Nothing _ : Maybe DLLStorage} -> SymbolInfo
Create symbol information with linkage, preemption, visibility, and storage options.
Creates a SymbolInfo record that specifies how a symbol should be linked,
whether it can be preempted, its visibility scope, and DLL storage class.
All parameters are optional with sensible defaults.
@ lnk Optional linkage type (private, internal, external, etc.)
@ prm Optional preemption specification
@ vis Optional visibility (default, hidden, protected)
@ sto Optional DLL storage class (dllimport, dllexport)
Visibility: exportmkPoison : LExpr
Create a poison constant.
Visibility: exportmkZero : LExpr
Create a zero constant.
Visibility: exportmkToken : LExpr
Create a token constant.
Visibility: exportmkMetadata : Metadata -> LExpr
Create a metadata constant.
Visibility: exportmetadataTuple : List Metadata -> Metadata
Create a metadata tuple.
Visibility: exportvarExpr : Name -> LExpr
Create a variable expression from a name.
Visibility: exportlocalVar : String -> LExpr
Create a variable expression from a local name.
Visibility: exportglobalVar : String -> LExpr
Create a variable expression from a global name.
Visibility: exportmetadataString : String -> Metadata
Create a metadata string.
Visibility: exportmetadataValue : WithType LExpr -> Metadata
Create a metadata value.
Visibility: exportmetadataCustom : String -> Metadata
Create custom metadata.
Visibility: exportvectorType : Int -> LType -> LType
Create a vector type.
Visibility: exportscalableVectorType : Int -> LType -> LType
Create a scalable vector type.
Visibility: exportarrayType : Int -> LType -> LType
Create an array type.
Visibility: exportstructType : List LType -> LType
Create a struct type.
Visibility: exportpackedStructType : List LType -> LType
Create a packed struct type.
Visibility: exportfunctionType : LType -> List LType -> LType
Create a function type.
Visibility: exportvarArgFunctionType : LType -> List LType -> LType -> LType
Create a variadic function type.
Visibility: exportmetadataNode : String -> Metadata
Create a metadata node.
Visibility: export