LLVM

abi-alignment-of-type

external

(Fn [LLVMTargetData, LLVMType] Int)

ABI alignment of ty in bytes.

abi-size-of-type

external

(Fn [LLVMTargetData, LLVMType] Long)

ABI size of ty in bytes.

add-attribute

external

(Fn [LLVMValue, Int, LLVMAttribute] ())

Attach an attribute to a function/callsite at idx (see attr-*-index).

add-case

external

(Fn [LLVMValue, LLVMValue, LLVMBasicBlock] ())

Add a (on-val -> dest) case to a switch instruction.

add-function

external

(Fn [LLVMModule, (Ptr CChar), LLVMType] LLVMValue)

Declare a function name of type ty in mod.

add-global

external

(Fn [LLVMModule, LLVMType, (Ptr CChar)] LLVMValue)

Declare a global variable name of type ty in mod.

add-incoming

defn

(Fn [LLVMValue, (Ref (Array LLVMValue) a), (Ref (Array LLVMBasicBlock) b)] ())

                        (add-incoming phi vals blocks)
                    

Add incoming vals/blocks (parallel arrays) to a phi node.

add-module-flag

instantiate

(Fn [LLVMModule, Int, (Ptr CChar), LLVMMetadata] ())

Add a module flag (key -> metadata) with a merge behavior.

add-named-metadata

external

(Fn [LLVMModule, (Ptr CChar), LLVMValue] ())

Append a value to a named metadata node (e.g. "llvm.ident").

append-block

external

(Fn [LLVMContext, LLVMValue, (Ptr CChar)] LLVMBasicBlock)

Append a basic block named name to function fn.

array-type

external

(Fn [LLVMType, Int] LLVMType)

An array of count elements of type elem.

attr-function-index

def

Int

Attribute index for the function itself.

attr-return-index

def

Int

Attribute index for the return value.

behavior-error

external

Int

Module-flag merge behavior: error on conflict.

behavior-warning

external

Int

Module-flag merge behavior: warn on conflict.

build-add

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs + rhs (integer).

build-alloca

external

(Fn [LLVMBuilder, LLVMType, (Ptr CChar)] LLVMValue)

Stack-allocate a slot of type ty.

build-and

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs & rhs.

build-ashr

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit arithmetic lhs >> rhs.

build-bit-cast

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Reinterpret a value as another type of the same size.

build-br

external

(Fn [LLVMBuilder, LLVMBasicBlock] LLVMValue)

Emit an unconditional branch to dest.

build-call

defn

(Fn [LLVMBuilder, LLVMType, LLVMValue, (Ref (Array LLVMValue) a), (Ptr CChar)] LLVMValue)

                        (build-call b fnty fn args name)
                    

Emit a call to fn (of type fnty) with args.

build-cond-br

external

(Fn [LLVMBuilder, LLVMValue, LLVMBasicBlock, LLVMBasicBlock] LLVMValue)

Branch to then if cond else else.

build-extract-element

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Extract the element at idx (a value) from a vector.

build-extract-value

external

(Fn [LLVMBuilder, LLVMValue, Int, (Ptr CChar)] LLVMValue)

Extract field idx from an aggregate value.

build-fadd

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs + rhs (floating point).

build-fcmp

external

(Fn [LLVMBuilder, Int, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit a floating-point comparison with one of the real-* predicates.

build-fdiv

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs / rhs (floating point).

build-fmul

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs * rhs (floating point).

build-fneg

external

(Fn [LLVMBuilder, LLVMValue, (Ptr CChar)] LLVMValue)

Emit -val (floating point).

build-fp-ext

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Extend a float to a wider float type.

build-fp-to-si

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Convert a float to a signed integer.

build-fp-to-ui

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Convert a float to an unsigned integer.

build-fp-trunc

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Truncate a float to a narrower float type.

build-frem

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs % rhs (floating point).

build-fsub

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs - rhs (floating point).

build-gep

defn

(Fn [LLVMBuilder, LLVMType, LLVMValue, (Ref (Array LLVMValue) a), (Ptr CChar)] LLVMValue)

                        (build-gep b ty ptr indices name)
                    

Emit a getelementptr into ptr (of pointee type ty) with indices.

build-global-string-ptr

external

(Fn [LLVMBuilder, (Ptr CChar), (Ptr CChar)] LLVMValue)

Intern str as a private global and yield an i8* to it.

build-icmp

external

(Fn [LLVMBuilder, Int, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit an integer comparison with one of the int-* predicates.

build-insert-element

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Insert elt at idx (a value) into a vector.

build-insert-value

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, Int, (Ptr CChar)] LLVMValue)

Insert elt into field idx of an aggregate value.

build-int-to-ptr

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Cast an integer to a pointer.

build-load

external

(Fn [LLVMBuilder, LLVMType, LLVMValue, (Ptr CChar)] LLVMValue)

Load a ty value from pointer ptr.

build-lshr

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit logical lhs >> rhs.

build-mul

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs * rhs (integer).

build-neg

external

(Fn [LLVMBuilder, LLVMValue, (Ptr CChar)] LLVMValue)

Emit -val (integer).

build-not

external

(Fn [LLVMBuilder, LLVMValue, (Ptr CChar)] LLVMValue)

Emit ~val.

build-or

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs | rhs.

build-phi

external

(Fn [LLVMBuilder, LLVMType, (Ptr CChar)] LLVMValue)

Emit a phi node of type ty.

build-ptr-to-int

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Cast a pointer to an integer.

build-ret

external

(Fn [LLVMBuilder, LLVMValue] LLVMValue)

Emit ret val.

build-ret-void

external

(Fn [LLVMBuilder] LLVMValue)

Emit ret void.

build-sdiv

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit signed lhs / rhs.

build-select

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit cond ? then : else.

build-sext

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Sign-extend an integer to a wider type.

build-shl

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs << rhs.

build-shuffle-vector

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Shuffle two vectors v1/v2 by the constant mask.

build-si-to-fp

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Convert a signed integer to a float.

build-srem

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit signed lhs % rhs.

build-store

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue] LLVMValue)

Store val into pointer ptr.

build-struct-gep

external

(Fn [LLVMBuilder, LLVMType, LLVMValue, Int, (Ptr CChar)] LLVMValue)

Emit a getelementptr to field idx of the struct ty behind ptr.

build-sub

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs - rhs (integer).

build-switch

external

(Fn [LLVMBuilder, LLVMValue, LLVMBasicBlock, Int] LLVMValue)

Emit a switch on val with else as default, reserving num-cases slots. Add cases with add-case.

build-trunc

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Truncate an integer to a narrower type.

build-udiv

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit unsigned lhs / rhs.

build-ui-to-fp

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Convert an unsigned integer to a float.

build-unreachable

external

(Fn [LLVMBuilder] LLVMValue)

Emit an unreachable terminator.

build-urem

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit unsigned lhs % rhs.

build-xor

external

(Fn [LLVMBuilder, LLVMValue, LLVMValue, (Ptr CChar)] LLVMValue)

Emit lhs ^ rhs.

build-zext

external

(Fn [LLVMBuilder, LLVMValue, LLVMType, (Ptr CChar)] LLVMValue)

Zero-extend an integer to a wider type.

builder-create

external

(Fn [LLVMContext] LLVMBuilder)

Create an IR builder bound to ctx.

builder-dispose

external

(Fn [LLVMBuilder] ())

Free a builder.

call-f32-f32

instantiate

(Fn [Long, Float] Float)

Call a JIT'd (float)->float function at addr with a.

call-i32

instantiate

(Fn [Long] Int)

Call a JIT'd ()->i32 function at addr.

call-i32-i32

instantiate

(Fn [Long, Int] Int)

Call a JIT'd (i32)->i32 function at addr with a.

call-i32-i32-i32

instantiate

(Fn [Long, Int, Int] Int)

Call a JIT'd (i32,i32)->i32 function at addr with a and b.

call-i32-i32-i32-i32

instantiate

(Fn [Long, Int, Int, Int] Int)

Call a JIT'd (i32,i32,i32)->i32 function at addr with a, b, and c.

clear-debug-location

instantiate

(Fn [LLVMBuilder] ())

Clear the builder's current debug location.

codegen-level-aggressive

external

Int

Optimization level: -O3.

codegen-level-default

external

Int

Optimization level: -O2.

codegen-level-less

external

Int

Optimization level: -O1.

codegen-level-none

external

Int

Optimization level: -O0.

codemodel-default

external

Int

Code model: target default.

codemodel-small

external

Int

Code model: small.

const-int

external

(Fn [LLVMType, Long, Int] LLVMValue)

An integer constant of type ty. sign-extend? sign-extends n.

const-null

external

(Fn [LLVMType] LLVMValue)

The all-zero/null constant of type ty (good for initializers).

const-real

external

(Fn [LLVMType, Double] LLVMValue)

A floating-point constant of type ty.

const-vector

defn

(Fn [(Ref (Array LLVMValue) a)] LLVMValue)

                        (const-vector elems)
                    

A constant vector from the scalar constants elems.

context-create

external

(Fn [] LLVMContext)

Create a fresh LLVM context. Dispose with context-dispose.

context-dispose

external

(Fn [LLVMContext] ())

Free a context and everything it owns.

create-enum-attribute

external

(Fn [LLVMContext, Int, Long] LLVMAttribute)

Create an enum attribute of the given kind (see enum-attribute-kind).

create-execution-engine

instantiate

(Fn [LLVMModule] LLVMEngine)

Create an MCJIT engine that takes ownership of mod. Returns a null handle on failure (check with engine-null?).

create-string-attribute

instantiate

(Fn [LLVMContext, (Ptr CChar), (Ptr CChar)] LLVMAttribute)

Create a string (key=value) attribute.

create-target-data-layout

external

(Fn [LLVMTargetMachine] LLVMTargetData)

The data layout of a target machine. Dispose with dispose-target-data; independent of the machine's lifetime.

create-target-machine

external

(Fn [LLVMTarget, (Ptr CChar), (Ptr CChar), (Ptr CChar), Int, Int, Int] LLVMTargetMachine)

Create a target machine. cpu/features may be empty C strings; level/reloc/codemodel take the codegen-level-*/reloc-*/codemodel-* values.

debug-location

instantiate

(Fn [LLVMContext, Int, Int, LLVMMetadata] LLVMMetadata)

A source location (line, col) within scope.

default-target-triple

instantiate

(Fn [] String)

The host target triple (e.g. "arm64-apple-darwin24.6.0").

di-basic-type

instantiate

(Fn [LLVMDIBuilder, (Ptr CChar), Long, Int] LLVMMetadata)

A DWARF base type (name, size-in-bits, a dwarf-* encoding).

di-builder-create

external

(Fn [LLVMModule] LLVMDIBuilder)

Create a debug-info builder for mod. Call di-finalize then di-builder-dispose when done.

di-builder-dispose

external

(Fn [LLVMDIBuilder] ())

Free a debug-info builder.

di-compile-unit

instantiate

(Fn [LLVMDIBuilder, LLVMMetadata, (Ptr CChar)] LLVMMetadata)

A C-language DWARF compile unit for file (defaults: unoptimized, full emission).

di-file

instantiate

(Fn [LLVMDIBuilder, (Ptr CChar), (Ptr CChar)] LLVMMetadata)

A debug-info file entry (name, dir).

di-finalize

external

(Fn [LLVMDIBuilder] ())

Resolve all deferred debug-info nodes. Call before disposing.

di-function

instantiate

(Fn [LLVMDIBuilder, LLVMMetadata, (Ptr CChar), LLVMMetadata, Int, LLVMMetadata] LLVMMetadata)

A DWARF subprogram for a function (defaults: definition, not-local, unoptimized).

di-lexical-block-file

external

(Fn [LLVMDIBuilder, LLVMMetadata, LLVMMetadata, Int] LLVMMetadata)

A file-specific scope nested under a function scope, for synthesized functions whose instructions originate in many files.

di-subroutine-type

defn

(Fn [LLVMDIBuilder, LLVMMetadata, (Ref (Array LLVMMetadata) a)] LLVMMetadata)

                        (di-subroutine-type b file param-types)
                    

A function-type descriptor. param-types is [return-type, arg-types...].

dispose-target-data

external

(Fn [LLVMTargetData] ())

Free a target data layout.

dispose-target-machine

external

(Fn [LLVMTargetMachine] ())

Free a target machine.

double-type

external

(Fn [LLVMContext] LLVMType)

The double type.

dup

template

(Fn [(Ref a b)] a)

Duplicate a handle out of a reference (e.g. from an array or accessor). Handles are trivially copyable pointers, but the @ operator needs a copy implementation they can't have, so use this instead.

dwarf-boolean

def

Int

DWARF base-type encoding: boolean.

dwarf-float

def

Int

DWARF base-type encoding: floating point.

dwarf-signed

def

Int

DWARF base-type encoding: signed integer.

dwarf-unsigned

def

Int

DWARF base-type encoding: unsigned integer.

emit-to-file

instantiate

(Fn [LLVMTargetMachine, LLVMModule, (Ptr CChar), Int] String)

Emit mod to path as filetype-object/filetype-assembly. Returns "" on success or an error String.

engine-dispose

external

(Fn [LLVMEngine] ())

Free an execution engine (and the module it owns).

engine-null?

instantiate

(Fn [LLVMEngine] Bool)

Whether engine creation failed.

enum-attribute-kind

instantiate

(Fn [(Ptr CChar)] Int)

The numeric kind id for a named enum attribute (e.g. "noinline").

filetype-assembly

external

Int

Emit a textual assembly file.

filetype-object

external

Int

Emit an object file.

float-type

external

(Fn [LLVMContext] LLVMType)

The float type.

function-address

external

(Fn [LLVMEngine, (Ptr CChar)] Long)

Address of JIT-compiled function name as a Long, or 0 if absent.

function-type

defn

(Fn [LLVMType, (Ref (Array LLVMType) a), Bool] LLVMType)

                        (function-type ret params vararg?)
                    

Function type returning ret with parameter types params. vararg? marks a C-style variadic function.

get-insert-block

external

(Fn [LLVMBuilder] LLVMBasicBlock)

The basic block the builder is currently appending to (needed as the incoming block for a phi after emitting a branch's body).

get-named-function

external

(Fn [LLVMModule, (Ptr CChar)] LLVMValue)

Look up a declared function by name (may be a null handle).

get-named-global

external

(Fn [LLVMModule, (Ptr CChar)] LLVMValue)

Look up a global variable by name (may be a null handle).

get-param

external

(Fn [LLVMValue, Int] LLVMValue)

The i-th parameter of function value fn.

initialize-native-asm-printer

instantiate

(Fn [] Int)

Initialize the host asm printer. Returns 0 on success.

initialize-native-target

instantiate

(Fn [] Int)

Initialize codegen for the host target. Returns 0 on success.

instruction?

instantiate

(Fn [LLVMValue] Bool)

Whether an LLVM value is an instruction rather than a constant, function, global, or argument.

int-eq

external

Int

icmp predicate: equal.

int-ne

external

Int

icmp predicate: not equal.

int-sge

external

Int

icmp predicate: signed >=.

int-sgt

external

Int

icmp predicate: signed >.

int-sle

external

Int

icmp predicate: signed <=.

int-slt

external

Int

icmp predicate: signed <.

int-uge

external

Int

icmp predicate: unsigned >=.

int-ugt

external

Int

icmp predicate: unsigned >.

int-ule

external

Int

icmp predicate: unsigned <=.

int-ult

external

Int

icmp predicate: unsigned <.

int1-type

external

(Fn [LLVMContext] LLVMType)

The i1 (boolean) type.

int16-type

external

(Fn [LLVMContext] LLVMType)

The i16 type.

int32-type

external

(Fn [LLVMContext] LLVMType)

The i32 type.

int64-type

external

(Fn [LLVMContext] LLVMType)

The i64 type.

int8-type

external

(Fn [LLVMContext] LLVMType)

The i8 type.

external

(Fn [] ())

Pull the MCJIT engine into the link. Call once before creating an engine.

linkage-external

external

Int

External linkage (the default for defined functions/globals).

linkage-internal

external

Int

Internal linkage (static, module-private).

linkage-private

external

Int

Private linkage (not in the symbol table).

md-kind-id

instantiate

(Fn [LLVMContext, (Ptr CChar)] Int)

Intern a metadata kind name (e.g. "dbg", "tbaa") to an id.

md-node

defn

(Fn [LLVMContext, (Ref (Array LLVMMetadata) a)] LLVMMetadata)

                        (md-node ctx operands)
                    

Create a metadata node (tuple) from operands.

md-string

instantiate

(Fn [LLVMContext, (Ptr CChar)] LLVMMetadata)

Create a metadata string.

memory-buffer-null?

instantiate

(Fn [LLVMMemoryBuffer] Bool)

Whether a memory-buffer read failed.

memory-buffer-of-file

instantiate

(Fn [(Ptr CChar)] LLVMMemoryBuffer)

Read a file into a memory buffer, or a null handle on error.

metadata-as-value

external

(Fn [LLVMContext, LLVMMetadata] LLVMValue)

Wrap metadata as a value (for set-metadata/named metadata).

module-create

external

(Fn [(Ptr CChar), LLVMContext] LLVMModule)

Create a module named name in ctx.

module-dispose

external

(Fn [LLVMModule] ())

Free a module.

module-null?

instantiate

(Fn [LLVMModule] Bool)

Whether a module handle is null (e.g. a failed parse).

offset-of-element

external

(Fn [LLVMTargetData, LLVMType, Int] Long)

Byte offset of struct element idx under a data layout.

orc-add-module

instantiate

(Fn [LLVMOrcLLJIT, LLVMOrcJITDylib, LLVMOrcThreadSafeModule] String)

Add a thread-safe module to the persistent JIT. The JIT takes ownership when called, including on failure. Returns an error string.

orc-add-module-tracked

instantiate

(Fn [LLVMOrcLLJIT, LLVMOrcResourceTracker, LLVMOrcThreadSafeModule] String)

Add a thread-safe module under tracker. ORC takes module ownership when called, including on failure.

orc-clear-dylib

instantiate

(Fn [LLVMOrcJITDylib] String)

Remove every resource published in a JITDylib. Returns an error string; the LLJIT and its shared context remain alive.

orc-create-lljit

instantiate

(Fn [] LLVMOrcLLJIT)

Create a host LLJIT, or a null handle on failure.

orc-dispose-lljit

instantiate

(Fn [LLVMOrcLLJIT] ())

Dispose a persistent LLJIT and all code it owns.

orc-dispose-thread-safe-context

external

(Fn [LLVMOrcThreadSafeContext] ())

Release the caller's shared-context reference.

orc-enable-process-symbols

instantiate

(Fn [LLVMOrcLLJIT] String)

Make symbols from the current process and RTLD_GLOBAL libraries visible to JIT modules. Returns an error string.

orc-lljit-null?

instantiate

(Fn [LLVMOrcLLJIT] Bool)

Whether LLJIT creation failed.

orc-lookup

instantiate

(Fn [LLVMOrcLLJIT, (Ptr CChar)] Long)

Look up a published symbol, returning its address or zero.

orc-main-dylib

external

(Fn [LLVMOrcLLJIT] LLVMOrcJITDylib)

The main JITDylib owned by jit.

orc-release-resource-tracker

external

(Fn [LLVMOrcResourceTracker] ())

Release the caller's resource-tracker reference.

orc-remove-resources

instantiate

(Fn [LLVMOrcResourceTracker] String)

Remove every JIT resource associated with a tracker.

orc-resource-tracker

external

(Fn [LLVMOrcJITDylib] LLVMOrcResourceTracker)

Create a resource tracker for one incremental module. Release the caller's reference after publishing or removing it.

orc-thread-safe-context

external

(Fn [LLVMContext] LLVMOrcThreadSafeContext)

Transfer ctx into a shared ORC context. Do not dispose ctx separately after this call.

orc-thread-safe-module

external

(Fn [LLVMModule, LLVMOrcThreadSafeContext] LLVMOrcThreadSafeModule)

Wrap mod in the shared context and transfer module ownership to the wrapper.

parse-ir

instantiate

(Fn [LLVMContext, LLVMMemoryBuffer] LLVMModule)

Parse textual IR or bitcode in buf into a module (consumes buf). Returns a null-module handle on error; check with module-null?.

pass-options-create

external

(Fn [] LLVMPassBuilderOptions)

Create pass-builder options. Dispose with pass-options-dispose.

pass-options-dispose

external

(Fn [LLVMPassBuilderOptions] ())

Free pass-builder options.

pointer-type

external

(Fn [LLVMType, Int] LLVMType)

A pointer to elem in the given address space.

position-at-end

external

(Fn [LLVMBuilder, LLVMBasicBlock] ())

Point the builder at the end of block.

instantiate

(Fn [LLVMModule] String)

Render a module's textual IR as a Carp String (owns the copy).

real-oeq

external

Int

fcmp predicate: ordered equal.

real-oge

external

Int

fcmp predicate: ordered >=.

real-ogt

external

Int

fcmp predicate: ordered >.

real-ole

external

Int

fcmp predicate: ordered <=.

real-olt

external

Int

fcmp predicate: ordered <.

real-one

external

Int

fcmp predicate: ordered not equal.

real-ueq

external

Int

fcmp predicate: unordered or equal.

real-une

external

Int

fcmp predicate: unordered or not equal.

reloc-default

external

Int

Relocation model: target default.

reloc-pic

external

Int

Relocation model: position-independent.

reloc-static

external

Int

Relocation model: static.

run-passes

instantiate

(Fn [LLVMModule, (Ptr CChar), LLVMTargetMachine, LLVMPassBuilderOptions] String)

Run a pass pipeline (e.g. "default", "instcombine,mem2reg") on mod. Returns "" on success or an error String.

set-debug-location

external

(Fn [LLVMBuilder, LLVMMetadata] ())

Set the builder's current debug location for emitted instructions.

set-global-constant

external

(Fn [LLVMValue, Int] ())

Mark a global variable as constant (1) or mutable (0).

set-initializer

external

(Fn [LLVMValue, LLVMValue] ())

Set the constant initializer of a global variable.

set-instruction-debug-location

external

(Fn [LLVMValue, LLVMMetadata] ())

Attach a debug location directly to an instruction value.

set-linkage

external

(Fn [LLVMValue, Int] ())

Set the linkage of a function or global with a linkage-* value.

set-metadata

external

(Fn [LLVMValue, Int, LLVMValue] ())

Attach metadata node of kind kind-id to an instruction value.

set-module-data-layout

external

(Fn [LLVMModule, LLVMTargetData] ())

Attach a data layout to a module.

set-subprogram

external

(Fn [LLVMValue, LLVMMetadata] ())

Attach a di-function subprogram to a function value.

set-target

external

(Fn [LLVMModule, (Ptr CChar)] ())

Set the module's target triple.

setup

dynamic

Dynamic

                        (setup :rest prefix)
                    

Wire include paths and linking against a Homebrew LLVM keg. prefix defaults to the Homebrew LLVM keg on macOS and the output of llvm-config --prefix elsewhere. Pass another LLVM prefix as the first argument to override it.

struct-create-named

external

(Fn [LLVMContext, (Ptr CChar)] LLVMType)

Create an (initially opaque) named struct type in ctx. Fill it in later with struct-set-body — this is how you build recursive types.

struct-set-body

defn

(Fn [LLVMType, (Ref (Array LLVMType) a), Bool] ())

                        (struct-set-body ty elems packed?)
                    

Set the field types of a named struct.

struct-type

defn

(Fn [LLVMContext, (Ref (Array LLVMType) a), Bool] LLVMType)

                        (struct-type ctx elems packed?)
                    

An anonymous struct type with fields elems. packed? removes padding.

target-from-triple

instantiate

(Fn [(Ptr CChar)] LLVMTarget)

Look up the target for a triple. Null handle on failure (see target-null?).

target-null?

instantiate

(Fn [LLVMTarget] Bool)

Whether a target lookup failed.

value-as-metadata

external

(Fn [LLVMValue] LLVMMetadata)

View a value (e.g. a constant) as metadata.

value-null?

instantiate

(Fn [LLVMValue] Bool)

Whether a value handle is null (e.g. a failed named lookup).

vector-type

external

(Fn [LLVMType, Int] LLVMType)

A fixed-width vector of count elements of type elem.

verify-module

instantiate

(Fn [LLVMModule] String)

Verify a module. Returns "" if valid, else the error String.

void-type

external

(Fn [LLVMContext] LLVMType)

The void type.

write-bitcode-to-file

external

(Fn [LLVMModule, (Ptr CChar)] Int)

Write module bitcode to path. Returns 0 on success.

write-module-to-file

instantiate

(Fn [LLVMModule, (Ptr CChar)] String)

Write textual IR to path. Returns "" on success or an error String.