This file defines bindings for LLVM. The main mechanisms are to:
- Mirror the values of C enumerations.
- Create opaque values for LLVM's pointer based API
- Write bindings that are
IO
based, which mutate the underlying in-memory data structures to build IR.
instance
LLVM.instNonemptyBasicBlock
{Context✝ : Sort u_1}
{ctx : Context✝}
:
Nonempty (BasicBlock ctx)
Check if the value is a null pointer. -
Equations
Instances For
@[extern lean_llvm_void_type_in_context]
@[extern lean_llvm_float_type_in_context]
@[extern lean_llvm_double_type_in_context]
@[extern lean_llvm_create_builder_in_context]
@[extern lean_llvm_append_basic_block_in_context]
opaque
LLVM.appendBasicBlockInContext
(ctx : Context)
(fn : Value ctx)
(name : String)
:
BaseIO (BasicBlock ctx)
@[extern lean_llvm_get_entry_basic_block]
@[extern lean_llvm_get_first_instruction]
@[extern lean_llvm_position_builder_at_end]
opaque
LLVM.positionBuilderAtEnd
{Context✝ : Sort u_1}
{ctx : Context✝}
(builder : Builder ctx)
(bb : BasicBlock ctx)
:
@[extern lean_llvm_build_cond_br]
opaque
LLVM.buildCondBr
{ctx : Context}
(builder : Builder ctx)
(if_ : Value ctx)
(thenbb elsebb : BasicBlock ctx)
:
@[extern lean_llvm_build_br]
@[extern lean_llvm_build_switch]
opaque
LLVM.buildSwitch
{ctx : Context}
(builder : Builder ctx)
(val : Value ctx)
(elseBB : BasicBlock ctx)
(numCasesHint : UInt64)
:
@[extern lean_llvm_build_icmp]
opaque
LLVM.buildICmp
{ctx : Context}
(builder : Builder ctx)
(predicate : IntPredicate)
(x y : Value ctx)
(name : String := "")
:
@[extern lean_llvm_add_case]
@[extern lean_llvm_get_insert_block]
opaque
LLVM.getInsertBlock
{Context✝ : Sort u_1}
{ctx : Context✝}
(builder : Builder ctx)
:
BaseIO (BasicBlock ctx)
@[extern lean_llvm_get_basic_block_parent]
@[extern lean_llvm_create_memory_buffer_with_contents_of_file]
opaque
LLVM.createMemoryBufferWithContentsOfFile
{ctx : Context}
(path : String)
:
BaseIO (MemoryBuffer ctx)
@[extern lean_llvm_parse_bitcode]
@[extern lean_llvm_get_default_target_triple]
@[extern lean_llvm_create_target_machine]
opaque
LLVM.createTargetMachine
{ctx : Context}
(target : Target ctx)
(tripleStr cpu features : String)
:
BaseIO (TargetMachine ctx)
@[extern lean_llvm_target_machine_emit_to_file]
opaque
LLVM.targetMachineEmitToFile
{ctx : Context}
(targetMachine : TargetMachine ctx)
(module : Module ctx)
(filepath : String)
(codegenType : CodegenFileType)
:
@[extern lean_llvm_dispose_target_machine]
@[extern lean_llvm_add_attribute_at_index]
opaque
LLVM.addAttributeAtIndex
{ctx : Context}
(fn : Value ctx)
(idx : AttributeIndex)
(attr : Attribute ctx)
:
@[extern lean_llvm_set_visibility]
@[extern lean_llvm_set_dll_storage_class]
opaque
LLVM.setDLLStorageClass
{ctx : Context}
(value : Value ctx)
(dllStorageClass : DLLStorageClass)
:
Keep one copy of function when linking (inline)
Equations
Instances For
Same, but only replaced by something equivalent
Equations
Instances For
Keep one copy of function when linking (weak)
Equations
Instances For
Same, but only replaced by something equivalent
Equations
Instances For
Special purpose, only applies to global arrays
Equations
Instances For
Rename collisions when linking (static functions)
Equations
Instances For
Like Internal, but omit from symbol table
Equations
Instances For
Like Private, but linker removes.
Equations
Instances For
Like LinkerPrivate, but is weak.