record GVarDef : Type
Global variable definition.
Models LLVM IR global variable definitions like:
```llvm
@myGlobal = private constant i32 42, align 4
@threadVar = thread_local(localdynamic) global i32 0
@externInit = external externally_initialized global i32
```
Totality: total
Visibility: public export
Constructor: MkGVarDef : String -> SymbolInfo -> Maybe ThreadLocality -> Maybe AddressInfo -> Maybe AddressSpace -> Maybe Bool -> Bool -> LType -> Maybe LExpr -> List LTag -> GVarDef
Projections:
.addressInfo : GVarDef -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
.addressSpace : GVarDef -> Maybe AddressSpace
Address space specification (addrspace(N))
.externallyInitialized : GVarDef -> Maybe Bool
Whether the variable is externally initialized
.gtpe : GVarDef -> LType
The type of the global variable
.initializer : GVarDef -> Maybe LExpr
Optional initializer value
.isConst : GVarDef -> Bool
Whether this is a constant (true) or global variable (false)
.name : GVarDef -> String
Variable name (without @ prefix)
.symbolInfo : GVarDef -> SymbolInfo
Symbol information (linkage, visibility, etc.)
.tags : GVarDef -> List LTag
Metadata tags
.threadLocality : GVarDef -> Maybe ThreadLocality
Thread-local storage model (thread_local(...))
Hints:
Encode FCM GVarDef CPtr
Encode ATM GVarDef VString
Walk GVarDef LClause
.name : GVarDef -> String
Variable name (without @ prefix)
Visibility: public exportname : GVarDef -> String
Variable name (without @ prefix)
Visibility: public export.symbolInfo : GVarDef -> SymbolInfo
Symbol information (linkage, visibility, etc.)
Visibility: public exportsymbolInfo : GVarDef -> SymbolInfo
Symbol information (linkage, visibility, etc.)
Visibility: public export.threadLocality : GVarDef -> Maybe ThreadLocality
Thread-local storage model (thread_local(...))
Visibility: public exportthreadLocality : GVarDef -> Maybe ThreadLocality
Thread-local storage model (thread_local(...))
Visibility: public export.addressInfo : GVarDef -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
Visibility: public exportaddressInfo : GVarDef -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
Visibility: public export.addressSpace : GVarDef -> Maybe AddressSpace
Address space specification (addrspace(N))
Visibility: public exportaddressSpace : GVarDef -> Maybe AddressSpace
Address space specification (addrspace(N))
Visibility: public export.externallyInitialized : GVarDef -> Maybe Bool
Whether the variable is externally initialized
Visibility: public exportexternallyInitialized : GVarDef -> Maybe Bool
Whether the variable is externally initialized
Visibility: public export.isConst : GVarDef -> Bool
Whether this is a constant (true) or global variable (false)
Visibility: public exportisConst : GVarDef -> Bool
Whether this is a constant (true) or global variable (false)
Visibility: public export.gtpe : GVarDef -> LType
The type of the global variable
Visibility: public exportgtpe : GVarDef -> LType
The type of the global variable
Visibility: public export.initializer : GVarDef -> Maybe LExpr
Optional initializer value
Visibility: public exportinitializer : GVarDef -> Maybe LExpr
Optional initializer value
Visibility: public export.tags : GVarDef -> List LTag
Metadata tags
Visibility: public exporttags : GVarDef -> List LTag
Metadata tags
Visibility: public exportrecord AttributeGroupDef : Type
Attribute group definition.
Models LLVM IR attribute group definitions like:
```llvm
attributes #0 = { nounwind readnone }
attributes #1 = { "no-frame-pointer-elim"="true" }
```
Totality: total
Visibility: public export
Constructor: MkAttributeGroupDef : Nat -> List Attribute -> AttributeGroupDef
Projections:
.attrs : AttributeGroupDef -> List Attribute
List of attributes in this group
.name : AttributeGroupDef -> Nat
Group number (the N in attributes #N)
Hints:
Encode FCM AttributeGroupDef CPtr
Encode ATM AttributeGroupDef VString
Walk AttributeGroupDef LClause
.name : AttributeGroupDef -> Nat
Group number (the N in attributes #N)
Visibility: public exportname : AttributeGroupDef -> Nat
Group number (the N in attributes #N)
Visibility: public export.attrs : AttributeGroupDef -> List Attribute
List of attributes in this group
Visibility: public exportattrs : AttributeGroupDef -> List Attribute
List of attributes in this group
Visibility: public exportrecord FunctionDef : Type
Function definition with implementation.
Models LLVM IR function definitions like:
```llvm
define dso_local i32 @main(i32 %argc, i8** %argv) #0 {
entry:
| %retval = alloca i32, align 4
| ret i32 0
}
```
Or with more attributes:
```llvm
define private fastcc nounwind i32 @helper(i32 %x)
unnamed_addr section ".text" align 16 gc "shadow-stack" {
entry:
| ret i32 %x
}
```
Totality: total
Visibility: public export
Constructor: MkFunctionDef : String -> SymbolInfo -> Maybe CallingConvention -> List Attribute -> LType -> List FunctionArgSpec -> Maybe AddressInfo -> Maybe AddressSpace -> List Attribute -> Maybe String -> Maybe String -> Maybe Name -> Maybe Int -> Maybe String -> Maybe LExpr -> Maybe LExpr -> Maybe LExpr -> List Metadata -> List Block -> List LTag -> FunctionDef
Projections:
.addressInfo : FunctionDef -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
.addressSpace : FunctionDef -> Maybe AddressSpace
Address space (addrspace(N))
.alignment : FunctionDef -> Maybe Int
Function alignment (align N)
.args : FunctionDef -> List FunctionArgSpec
Function parameters with their types and attributes
.body : FunctionDef -> List Block
Function body with basic blocks and instructions
.callingConvention : FunctionDef -> Maybe CallingConvention
Calling convention (fastcc, coldcc, etc.)
.comdat : FunctionDef -> Maybe Name
Comdat group (comdat [($name)])
.fnAttributes : FunctionDef -> List Attribute
Function attributes (nounwind, readnone, etc.)
.fprefix : FunctionDef -> Maybe LExpr
Prefix data (prefix Constant)
.gc : FunctionDef -> Maybe String
Garbage collector name (gc "name")
.metadata : FunctionDef -> List Metadata
Attached metadata (!name !N)*
.name : FunctionDef -> String
Function name (without @ prefix)
.partition : FunctionDef -> Maybe String
Partition name (partition "name")
.personality : FunctionDef -> Maybe LExpr
Personality function (personality Constant)
.prologue : FunctionDef -> Maybe LExpr
Prologue data (prologue Constant)
.returnAttrs : FunctionDef -> List Attribute
Return value attributes
.returnType : FunctionDef -> LType
Return type
.section : FunctionDef -> Maybe String
Section name (section "name")
.symbolInfo : FunctionDef -> SymbolInfo
Symbol information (linkage, preemption, visibility, DLL storage)
.tags : FunctionDef -> List LTag
Additional metadata tags
Hints:
Encode FCM FunctionDef CPtr
Encode ATM FunctionDef VString
Walk FunctionDef LClause
.name : FunctionDef -> String
Function name (without @ prefix)
Visibility: public exportname : FunctionDef -> String
Function name (without @ prefix)
Visibility: public export.symbolInfo : FunctionDef -> SymbolInfo
Symbol information (linkage, preemption, visibility, DLL storage)
Visibility: public exportsymbolInfo : FunctionDef -> SymbolInfo
Symbol information (linkage, preemption, visibility, DLL storage)
Visibility: public export.callingConvention : FunctionDef -> Maybe CallingConvention
Calling convention (fastcc, coldcc, etc.)
Visibility: public exportcallingConvention : FunctionDef -> Maybe CallingConvention
Calling convention (fastcc, coldcc, etc.)
Visibility: public export.returnAttrs : FunctionDef -> List Attribute
Return value attributes
Visibility: public exportreturnAttrs : FunctionDef -> List Attribute
Return value attributes
Visibility: public export.returnType : FunctionDef -> LType
Return type
Visibility: public exportreturnType : FunctionDef -> LType
Return type
Visibility: public export.args : FunctionDef -> List FunctionArgSpec
Function parameters with their types and attributes
Visibility: public exportargs : FunctionDef -> List FunctionArgSpec
Function parameters with their types and attributes
Visibility: public export.addressInfo : FunctionDef -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
Visibility: public exportaddressInfo : FunctionDef -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
Visibility: public export.addressSpace : FunctionDef -> Maybe AddressSpace
Address space (addrspace(N))
Visibility: public exportaddressSpace : FunctionDef -> Maybe AddressSpace
Address space (addrspace(N))
Visibility: public export.fnAttributes : FunctionDef -> List Attribute
Function attributes (nounwind, readnone, etc.)
Visibility: public exportfnAttributes : FunctionDef -> List Attribute
Function attributes (nounwind, readnone, etc.)
Visibility: public export.section : FunctionDef -> Maybe String
Section name (section "name")
Visibility: public exportsection : FunctionDef -> Maybe String
Section name (section "name")
Visibility: public export.partition : FunctionDef -> Maybe String
Partition name (partition "name")
Visibility: public exportpartition : FunctionDef -> Maybe String
Partition name (partition "name")
Visibility: public export.comdat : FunctionDef -> Maybe Name
Comdat group (comdat [($name)])
Visibility: public exportcomdat : FunctionDef -> Maybe Name
Comdat group (comdat [($name)])
Visibility: public export.alignment : FunctionDef -> Maybe Int
Function alignment (align N)
Visibility: public exportalignment : FunctionDef -> Maybe Int
Function alignment (align N)
Visibility: public export.gc : FunctionDef -> Maybe String
Garbage collector name (gc "name")
Visibility: public exportgc : FunctionDef -> Maybe String
Garbage collector name (gc "name")
Visibility: public export.fprefix : FunctionDef -> Maybe LExpr
Prefix data (prefix Constant)
Visibility: public exportfprefix : FunctionDef -> Maybe LExpr
Prefix data (prefix Constant)
Visibility: public export.prologue : FunctionDef -> Maybe LExpr
Prologue data (prologue Constant)
Visibility: public exportprologue : FunctionDef -> Maybe LExpr
Prologue data (prologue Constant)
Visibility: public export.personality : FunctionDef -> Maybe LExpr
Personality function (personality Constant)
Visibility: public exportpersonality : FunctionDef -> Maybe LExpr
Personality function (personality Constant)
Visibility: public export.metadata : FunctionDef -> List Metadata
Attached metadata (!name !N)*
Visibility: public exportmetadata : FunctionDef -> List Metadata
Attached metadata (!name !N)*
Visibility: public export.body : FunctionDef -> List Block
Function body with basic blocks and instructions
Visibility: public exportbody : FunctionDef -> List Block
Function body with basic blocks and instructions
Visibility: public export.tags : FunctionDef -> List LTag
Additional metadata tags
Visibility: public exporttags : FunctionDef -> List LTag
Additional metadata tags
Visibility: public exportrecord FunctionDec : Type
Function declaration without implementation.
Models LLVM IR function declarations like:
```llvm
declare i32 @printf(i8*, ...)
declare dso_local void @exit(i32) #1
declare external fastcc i32 @external_func(i32, i32)
```
Totality: total
Visibility: public export
Constructor: MkFunctionDec : String -> SymbolInfo -> Maybe CallingConvention -> List Attribute -> LType -> List FunctionArgSpec -> Maybe AddressInfo -> Maybe Int -> Maybe String -> Maybe LExpr -> Maybe LExpr -> List LTag -> FunctionDec
Projections:
.addressInfo : FunctionDec -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
.alignment : FunctionDec -> Maybe Int
Function alignment (align N)
.args : FunctionDec -> List FunctionArgSpec
Function parameters with their types and attributes
.callingConvention : FunctionDec -> Maybe CallingConvention
Calling convention (fastcc, coldcc, etc.)
.fprefix : FunctionDec -> Maybe LExpr
Prefix data (prefix Constant)
.gc : FunctionDec -> Maybe String
Garbage collector name (gc "name")
.name : FunctionDec -> String
Function name (without @ prefix)
.prologue : FunctionDec -> Maybe LExpr
Prologue data (prologue Constant)
.returnAttrs : FunctionDec -> List Attribute
Return value attributes
.returnType : FunctionDec -> LType
Return type
.symbolInfo : FunctionDec -> SymbolInfo
Symbol information (linkage, preemption, visibility, DLL storage)
.tags : FunctionDec -> List LTag
Additional metadata tags
Hints:
Encode FCM FunctionDec CPtr
Encode ATM FunctionDec VString
Walk FunctionDec LClause
.name : FunctionDec -> String
Function name (without @ prefix)
Visibility: public exportname : FunctionDec -> String
Function name (without @ prefix)
Visibility: public export.symbolInfo : FunctionDec -> SymbolInfo
Symbol information (linkage, preemption, visibility, DLL storage)
Visibility: public exportsymbolInfo : FunctionDec -> SymbolInfo
Symbol information (linkage, preemption, visibility, DLL storage)
Visibility: public export.callingConvention : FunctionDec -> Maybe CallingConvention
Calling convention (fastcc, coldcc, etc.)
Visibility: public exportcallingConvention : FunctionDec -> Maybe CallingConvention
Calling convention (fastcc, coldcc, etc.)
Visibility: public export.returnAttrs : FunctionDec -> List Attribute
Return value attributes
Visibility: public exportreturnAttrs : FunctionDec -> List Attribute
Return value attributes
Visibility: public export.returnType : FunctionDec -> LType
Return type
Visibility: public exportreturnType : FunctionDec -> LType
Return type
Visibility: public export.args : FunctionDec -> List FunctionArgSpec
Function parameters with their types and attributes
Visibility: public exportargs : FunctionDec -> List FunctionArgSpec
Function parameters with their types and attributes
Visibility: public export.addressInfo : FunctionDec -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
Visibility: public exportaddressInfo : FunctionDec -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
Visibility: public export.alignment : FunctionDec -> Maybe Int
Function alignment (align N)
Visibility: public exportalignment : FunctionDec -> Maybe Int
Function alignment (align N)
Visibility: public export.gc : FunctionDec -> Maybe String
Garbage collector name (gc "name")
Visibility: public exportgc : FunctionDec -> Maybe String
Garbage collector name (gc "name")
Visibility: public export.fprefix : FunctionDec -> Maybe LExpr
Prefix data (prefix Constant)
Visibility: public exportfprefix : FunctionDec -> Maybe LExpr
Prefix data (prefix Constant)
Visibility: public export.prologue : FunctionDec -> Maybe LExpr
Prologue data (prologue Constant)
Visibility: public exportprologue : FunctionDec -> Maybe LExpr
Prologue data (prologue Constant)
Visibility: public export.tags : FunctionDec -> List LTag
Additional metadata tags
Visibility: public exporttags : FunctionDec -> List LTag
Additional metadata tags
Visibility: public exportrecord Alias : Type
Alias definition.
Models LLVM IR alias definitions like:
```llvm
@alias = alias i32, i32* @original
@weak_alias = weak alias i8, i8* @target
@thread_alias = thread_local alias i32, i32* @tls_var
```
Totality: total
Visibility: public export
Constructor: MkAlias : String -> SymbolInfo -> Maybe ThreadLocality -> Maybe AddressInfo -> LType -> String -> List LTag -> Alias
Projections:
.addressInfo : Alias -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
.aliasTpe : Alias -> LType
Type of the alias
.aliasee : Alias -> String
Name of the aliasee (the target being aliased)
.name : Alias -> String
Alias name (without @ prefix)
.symbolInfo : Alias -> SymbolInfo
Symbol information (linkage, preemption, visibility, DLL storage)
.tags : Alias -> List LTag
Additional metadata tags
.threadLocality : Alias -> Maybe ThreadLocality
Thread-local storage model
Hints:
Encode FCM Alias CPtr
Encode ATM Alias VString
Walk Alias LClause
.name : Alias -> String
Alias name (without @ prefix)
Visibility: public exportname : Alias -> String
Alias name (without @ prefix)
Visibility: public export.symbolInfo : Alias -> SymbolInfo
Symbol information (linkage, preemption, visibility, DLL storage)
Visibility: public exportsymbolInfo : Alias -> SymbolInfo
Symbol information (linkage, preemption, visibility, DLL storage)
Visibility: public export.threadLocality : Alias -> Maybe ThreadLocality
Thread-local storage model
Visibility: public exportthreadLocality : Alias -> Maybe ThreadLocality
Thread-local storage model
Visibility: public export.addressInfo : Alias -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
Visibility: public exportaddressInfo : Alias -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
Visibility: public export.aliasTpe : Alias -> LType
Type of the alias
Visibility: public exportaliasTpe : Alias -> LType
Type of the alias
Visibility: public export.aliasee : Alias -> String
Name of the aliasee (the target being aliased)
Visibility: public exportaliasee : Alias -> String
Name of the aliasee (the target being aliased)
Visibility: public export.tags : Alias -> List LTag
Additional metadata tags
Visibility: public exporttags : Alias -> List LTag
Additional metadata tags
Visibility: public exportrecord IFunc : Type
Indirect function (IFunc) definition.
Models LLVM IR IFunc definitions like:
```llvm
@ifunc = ifunc i32 (i32), i32 (i32)* @resolver
@weak_ifunc = weak ifunc void (), void ()* @my_resolver
```
Totality: total
Visibility: public export
Constructor: MkIFunc : String -> SymbolInfo -> Maybe ThreadLocality -> Maybe AddressInfo -> LType -> LType -> String -> List LTag -> IFunc
Projections:
.addressInfo : IFunc -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
.funTpe : IFunc -> LType
Function type
.name : IFunc -> String
IFunc name (without @ prefix)
.resTpe : IFunc -> LType
Resolver function type
.resolver : IFunc -> String
Name of the resolver function
.symbolInfo : IFunc -> SymbolInfo
Symbol information (linkage, preemption, visibility)
.tags : IFunc -> List LTag
Additional metadata tags
.threadLocality : IFunc -> Maybe ThreadLocality
Thread-local storage model
Hints:
Encode FCM IFunc CPtr
Encode ATM IFunc VString
Walk IFunc LClause
.name : IFunc -> String
IFunc name (without @ prefix)
Visibility: public exportname : IFunc -> String
IFunc name (without @ prefix)
Visibility: public export.symbolInfo : IFunc -> SymbolInfo
Symbol information (linkage, preemption, visibility)
Visibility: public exportsymbolInfo : IFunc -> SymbolInfo
Symbol information (linkage, preemption, visibility)
Visibility: public export.threadLocality : IFunc -> Maybe ThreadLocality
Thread-local storage model
Visibility: public exportthreadLocality : IFunc -> Maybe ThreadLocality
Thread-local storage model
Visibility: public export.addressInfo : IFunc -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
Visibility: public exportaddressInfo : IFunc -> Maybe AddressInfo
Address significance (unnamed_addr, local_unnamed_addr)
Visibility: public export.funTpe : IFunc -> LType
Function type
Visibility: public exportfunTpe : IFunc -> LType
Function type
Visibility: public export.resTpe : IFunc -> LType
Resolver function type
Visibility: public exportresTpe : IFunc -> LType
Resolver function type
Visibility: public export.resolver : IFunc -> String
Name of the resolver function
Visibility: public exportresolver : IFunc -> String
Name of the resolver function
Visibility: public export.tags : IFunc -> List LTag
Additional metadata tags
Visibility: public exporttags : IFunc -> List LTag
Additional metadata tags
Visibility: public exportdata LClause : Type
Top-level clauses that can appear in an LLVM module.
Each clause represents a different kind of top-level declaration.
Totality: total
Visibility: public export
Constructors:
GlobalDefC : GVarDef -> LClause
Global variable definition (@var = ...)
FunctionDefC : FunctionDef -> LClause
Function definition with body (define ...)
FunctionDecC : FunctionDec -> LClause
Function declaration without body (declare ...)
AliasC : Alias -> LClause
Alias definition (@alias = alias ...)
IFuncC : IFunc -> LClause
IFunc definition (@ifunc = ifunc ...)
MetadataC : String -> Metadata -> LClause
Named metadata (!name = !{...})
AttributeGroupC : AttributeGroupDef -> LClause
Attribute group definition (attributes #N = {...})
OtherC : String -> LClause
Other top-level constructs (e.g., inline assembly, target info)
Hints:
Encode FCM LClause CPtr
Encode ATM LClause VString
Endable LModule LClause
Startable LModule LClause
Walk GVarDef LClause
Walk FunctionDef LClause
Walk FunctionDec LClause
Walk Alias LClause
Walk IFunc LClause
Walk AttributeGroupDef LClause
record LModule : Type
LLVM Module structure.
Models a complete LLVM IR module like:
```llvm
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64..."
target triple = "x86_64-pc-linux-gnu"
@global_var = global i32 42
define i32 @main() {
| ret i32 0
}
```
Totality: total
Visibility: public export
Constructor: MkLModule : Maybe String -> Maybe String -> List LClause -> Maybe (List LTag) -> LModule
Projections:
.dataLayout : LModule -> Maybe String
Target data layout string (target datalayout = "...")
.tags : LModule -> Maybe (List LTag)
Module-level metadata tags
.target : LModule -> Maybe String
Target triple string (target triple = "...")
.text : LModule -> List LClause
List of top-level declarations and definitions
Hints:
Encode FCM LModule CPtr
Encode ATM LModule VString
Endable LModule LClause
Startable LModule LClause
.dataLayout : LModule -> Maybe String
Target data layout string (target datalayout = "...")
Visibility: public exportdataLayout : LModule -> Maybe String
Target data layout string (target datalayout = "...")
Visibility: public export.target : LModule -> Maybe String
Target triple string (target triple = "...")
Visibility: public exporttarget : LModule -> Maybe String
Target triple string (target triple = "...")
Visibility: public export.text : LModule -> List LClause
List of top-level declarations and definitions
Visibility: public exporttext : LModule -> List LClause
List of top-level declarations and definitions
Visibility: public export.tags : LModule -> Maybe (List LTag)
Module-level metadata tags
Visibility: public exporttags : LModule -> Maybe (List LTag)
Module-level metadata tags
Visibility: public exportrecord Bytecode : Type
LLVM Bytecode container.
Represents a collection of LLVM modules, typically used for
multi-module compilation units or linked programs.
Totality: total
Visibility: public export
Constructor: MkBytecode : Maybe String -> List (String, LModule) -> Bytecode
Projections:
.mainMod : Bytecode -> Maybe String
.modules : Bytecode -> List (String, LModule)
List of LLVM modules in this bytecode unit
.mainMod : Bytecode -> Maybe String
- Visibility: public export
mainMod : Bytecode -> Maybe String
- Visibility: public export
.modules : Bytecode -> List (String, LModule)
List of LLVM modules in this bytecode unit
Visibility: public exportmodules : Bytecode -> List (String, LModule)
List of LLVM modules in this bytecode unit
Visibility: public export