Idris2Doc : Data.LLVM.IR.Builders.Core

Data.LLVM.IR.Builders.Core

Definitions

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: export
emptySymbolInfo : 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: export
withType : LType->LExpr->WithTypeLExpr
  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 export
mkBool : 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: export
mkString : 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: export
mkNull : 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: export
mkUndefined : 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: export
mkFloat : 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: export
mkArray : List (WithTypeLExpr) ->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: export
mkStruct : List (WithTypeLExpr) ->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: export
mkVector : List (WithTypeLExpr) ->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: export
constExpr : 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: export
local : 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: export
ptrExpr : 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: export
localPtr : 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: export
globalPtr : 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 10
block : {default"entry"_ : String} -> {default [] _ : ListLStatement} ->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 0
assign : 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: export
discard : 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: export
symbolInfo : {defaultNothing_ : MaybeLinkage} -> {defaultNothing_ : MaybePreemption} -> {defaultNothing_ : MaybeVisibility} -> {defaultNothing_ : MaybeDLLStorage} ->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: export
mkPoison : LExpr
  Create a poison constant.

Visibility: export
mkZero : LExpr
  Create a zero constant.

Visibility: export
mkToken : LExpr
  Create a token constant.

Visibility: export
mkMetadata : Metadata->LExpr
  Create a metadata constant.

Visibility: export
metadataTuple : ListMetadata->Metadata
  Create a metadata tuple.

Visibility: export
varExpr : Name->LExpr
  Create a variable expression from a name.

Visibility: export
localVar : String->LExpr
  Create a variable expression from a local name.

Visibility: export
globalVar : String->LExpr
  Create a variable expression from a global name.

Visibility: export
metadataString : String->Metadata
  Create a metadata string.

Visibility: export
metadataValue : WithTypeLExpr->Metadata
  Create a metadata value.

Visibility: export
metadataCustom : String->Metadata
  Create custom metadata.

Visibility: export
vectorType : Int->LType->LType
  Create a vector type.

Visibility: export
scalableVectorType : Int->LType->LType
  Create a scalable vector type.

Visibility: export
arrayType : Int->LType->LType
  Create an array type.

Visibility: export
structType : ListLType->LType
  Create a struct type.

Visibility: export
packedStructType : ListLType->LType
  Create a packed struct type.

Visibility: export
functionType : LType->ListLType->LType
  Create a function type.

Visibility: export
varArgFunctionType : LType->ListLType->LType->LType
  Create a variadic function type.

Visibility: export
metadataNode : String->Metadata
  Create a metadata node.

Visibility: export