Basic blocks
LLVM.BasicBlock — TypeBasicBlockA basic block in the IR. A basic block is a sequence of instructions that always ends in a terminator instruction.
LLVM.BasicBlock — MethodBasicBlock(name::String)Create a new, empty basic block with the given name.
LLVM.BasicBlock — MethodBasicBlock(f::LLVM.Function, name::String)Create a new, empty basic block with the given name, and insert it at the end of the given function.
LLVM.BasicBlock — MethodBasicBlock(bb::BasicBlock, name::String)Create a new, empty basic block with the given name, and insert it before the given basic block.
Properties and operations
LLVM.remove! — Methodremove!(bb::BasicBlock)Remove the given basic block from its parent function, but do not free the object.
LLVM.erase! — Methoderase!(fun::Function, bb::BasicBlock)Remove the given basic block from its parent function and free the object.
This function is unsafe because it does not check if the basic block is used elsewhere.
LLVM.parent — Methodparent(bb::BasicBlock) -> LLVM.FunctionGet the function that contains the given basic block, or nothing if the block is not part of a function.
LLVM.terminator — Methodterminator(bb::BasicBlock) -> LLVM.InstructionGet the terminator instruction of the given basic block.
LLVM.name — Methodname(bb::BasicBlock) -> StringGet the name of the given basic block.
LLVM.move_before — Functionmove_before(bb::BasicBlock, pos::BasicBlock)Move the given basic block before the given position.
LLVM.move_after — Functionmove_after(bb::BasicBlock, pos::BasicBlock)Move the given basic block after the given position.
Control flow
LLVM.predecessors — Methodpredecessors(bb::BasicBlock)Get the predecessors of the given basic block.
LLVM.successors — Methodsuccessors(bb::BasicBlock)Get the successors of the given basic block.
Instructions
LLVM.instructions — Functioninstructions(bb::BasicBlock)Get an iterator over the instructions in the given basic block.
LLVM.previnst — Functionprevinst(inst::Instruction)Get the instruction before the given instruction in the basic block, or nothing if there is none.
LLVM.nextinst — Functionnextinst(inst::Instruction)Get the instruction after the given instruction in the basic block, or nothing if there is none.