Class InstructionBuilder
- Namespace
- Ubiquity.NET.Llvm.Instructions
- Assembly
- Ubiquity.NET.Llvm.dll
LLVM Instruction builder allowing managed code to generate IR instructions
public sealed class InstructionBuilder : IDisposable
- Inheritance
-
InstructionBuilder
- Implements
- Inherited Members
Remarks
important
Unlike the underlying LLVM APIs these methods do NOT accept a name parameter. Instead, the name is added only when needed via the RegisterName<T>(T, string) extension method. That method supports a Fluent style pattern to allow mutating additional properties and handles the possibility of a Constant folded value, which does NOT have a register name.
Constructors
- InstructionBuilder(IContext)
Initializes a new instance of the InstructionBuilder class for a given Ubiquity.NET.Llvm.ContextAlias
- InstructionBuilder(BasicBlock)
Initializes a new instance of the InstructionBuilder class for a BasicBlock
Properties
- Context
Gets the context this builder is creating instructions for
- CurrentDebugLocation
Gets or sets the current Debug Location for this InstructionBuilder
- InsertBlock
Gets the BasicBlock this builder is building instructions for
- InsertFunction
Gets the function this builder currently inserts into
Methods
- Add(Value, Value)
Creates an integer add operator
- AddWithOverflow(Value, Value, bool)
Generates a call to the llvm.[s|u]add.with.overflow intrinsic
- Alloca(ITypeRef)
Creates an alloca instruction
- Alloca(ITypeRef, ConstantInt)
Creates an alloca instruction
- And(Value, Value)
Creates an integer bitwise and operator
- AppendBasicBlock(BasicBlock)
Appends a basic block after the InsertBlock of this InstructionBuilder
- ArithmeticShiftRight(Value, Value)
Creates an integer arithmetic shift right operator
- AtomicAdd(Value, Value)
Creates an atomic add instruction
- AtomicAnd(Value, Value)
Creates an atomic AND instruction
- AtomicCmpXchg(Value, Value, Value)
Creates an atomic Compare exchange instruction
- AtomicFSub(Value, Value)
Creates an atomic FSub instruction
- AtomicFadd(Value, Value)
Creates an atomic FAdd instruction
- AtomicMax(Value, Value)
Creates an atomic ADD instruction
- AtomicMin(Value, Value)
Creates an atomic MIN instruction
- AtomicNand(Value, Value)
Creates an atomic NAND instruction
- AtomicOr(Value, Value)
Creates an atomic or instruction
- AtomicSub(Value, Value)
Creates an atomic subtraction instruction
- AtomicUMax(Value, Value)
Creates an atomic UMax instruction
- AtomicUMin(Value, Value)
Creates an atomic UMin instruction
- AtomicXchg(Value, Value)
Creates an atomic exchange (Read, Modify, Write) instruction
- AtomicXor(Value, Value)
Creates an atomic XOR instruction
- BitCast(Value, ITypeRef)
Creates a bitcast instruction
- Branch(BasicBlock)
Create an unconditional branch
- Branch(Value, BasicBlock, BasicBlock)
Creates a conditional branch instruction
- Call(IFunctionType, Value, params IEnumerable<Value>)
Creates a call instruction
- Call(IFunctionType, Value, IReadOnlyList<Value>)
Creates a call instruction
- Call(Function, params IEnumerable<Value>)
Creates a call function
- Call(Function, IReadOnlyList<Value>)
Creates a call function
- Compare(IntPredicate, Value, Value)
Builds an Integer compare instruction
- Compare(Predicate, Value, Value)
Builds a compare instruction
- Compare(RealPredicate, Value, Value)
Builds a Floating point compare instruction
- ConstGetElementPtrInBounds(Value, params Value[])
Creates a Value that accesses an element of a type referenced by a pointer
- DebugTrap()
Creates a llvm.debugtrap call
- Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- DoNothing()
Creates a call to the llvm.donothing intrinsic
- ExtractValue(Value, uint)
Creates an extractvalue instruction
- FAdd(Value, Value)
Creates a floating point add operator
- FDiv(Value, Value)
Creates a floating point division operator
- FMul(Value, Value)
Creates a floating point multiple operator
- FNeg(Value)
Creates a floating point negation operator
- FPExt(Value, ITypeRef)
Creates a floating point extend instruction
- FPToSICast(Value, ITypeRef)
Creates a floating point to signed integer cast instruction
- FPToUICast(Value, ITypeRef)
Creates a Floating point to unsigned integer cast instruction
- FPTrunc(Value, ITypeRef)
Creates a floating point truncate instruction
- FRem(Value, Value)
Creates a floating point remainder operator
- FSub(Value, Value)
Creates a floating point subtraction operator
- Freeze(Value)
Creates a Freeze instruction
- GetElementPtr(ITypeRef, Value, IEnumerable<Value>)
Creates a Value that accesses an element of a type referenced by a pointer
- GetElementPtr(Value, IEnumerable<Value>)
Creates a Value that accesses an element of a type referenced by a pointer
- GetElementPtr(Value, params Value[])
Creates a Value that accesses an element of a type referenced by a pointer
- GetElementPtrInBounds(ITypeRef, Value, IEnumerable<Value>)
Creates a Value that accesses an element of a type referenced by a pointer
- GetElementPtrInBounds(ITypeRef, Value, params Value[])
Creates a Value that accesses an element of a type referenced by a pointer
- GetElementPtrInBounds(Value, IEnumerable<Value>)
Creates a Value that accesses an element of a type referenced by a pointer
- GetElementPtrInBounds(Value, params Value[])
Creates a Value that accesses an element of a type referenced by a pointer
- GetStructElementPointer(ITypeRef, Value, uint)
Creates a Value that accesses an element (field) of a structure
- InsertValue(Value, Value, uint)
Builds an InsertValue instruction
- IntCast(Value, ITypeRef, bool)
Creates an integer cast instruction
- IntToPointer(Value, IPointerType)
Builds a cast from an integer to a pointer
- Invoke(Function, IReadOnlyList<Value>, BasicBlock, BasicBlock)
Creates an Invoke instruction
- LandingPad(ITypeRef)
Creates a LandingPad instruction
- Load(ITypeRef, Value)
Creates a load instruction
- LogicalShiftRight(Value, Value)
Creates an integer logical shift right operator
- Malloc(ITypeRef)
Inserts a call to malloc
- MemCpy(Value, Value, Value, bool)
Builds a memcpy intrinsic call
- MemMove(Value, Value, Value, bool)
Builds a memmove intrinsic call
- MemSet(Value, Value, Value, bool)
Builds a memset intrinsic call
- Mul(Value, Value)
Creates an integer multiplication operator
- MulWithOverflow(Value, Value, bool)
Generates a call to the llvm.[s|u]mul.with.overflow intrinsic
- Neg(Value)
Creates an integer negation operator
- Not(Value)
Creates an integer logical not operator
- Or(Value, Value)
Creates an integer bitwise or operator
- PhiNode(ITypeRef)
Creates a Phi instruction
- PointerToInt(Value, ITypeRef)
Builds a cast from a pointer to an integer type
- PositionAtEnd(BasicBlock)
Positions the builder at the end of a given BasicBlock
- PositionBefore(Instruction)
Positions the builder before the given instruction
- Resume(Value)
Creates a ResumeInstruction
- Return()
Creates a return instruction for a function that has no return value
- Return(Value)
Creates a return instruction with the return value for a function
- SDiv(Value, Value)
Creates an integer signed division operator
- SIToFPCast(Value, ITypeRef)
Creates a signed integer to floating point cast instruction
- SRem(Value, Value)
Creates an integer signed remainder operator
- Select(Value, Value, Value)
Builds a SelectInstruction instruction
- SetDebugLocation(uint, uint, DILocalScope, DILocation?)
Set the current debug location for this InstructionBuilder
- SetDebugLocation(DILocation?)
Set the current debug location for this InstructionBuilder
- ShiftLeft(Value, Value)
Creates an integer shift left operator
- SignExtend(Value, ITypeRef)
Creates a Sign Extend instruction
- SignExtendOrBitCast(Value, ITypeRef)
Creates a sign extend or bit cast instruction
- Store(Value, Value)
Builds an LLVM Store instruction
- Sub(Value, Value)
Creates an integer subtraction operator
- SubWithOverflow(Value, Value, bool)
Generates a call to the llvm.[s|u]sub.with.overflow intrinsic
- Switch(Value, BasicBlock, uint)
Creates a switch instruction
- Trap()
Creates a llvm.trap call
- Trunc(Value, ITypeRef)
Creates a trunc instruction
- TruncOrBitCast(Value, ITypeRef)
Creates a trunc or bit cast instruction
- UDiv(Value, Value)
Creates an integer unsigned division operator
- UIToFPCast(Value, ITypeRef)
Creates an unsigned integer to floating point cast instruction
- URem(Value, Value)
Creates an integer unsigned remainder operator
- Unreachable()
Creates an Unreachable instruction
- Xor(Value, Value)
Creates an integer bitwise exclusive or operator
- ZeroExtend(Value, ITypeRef)
Creates a Zero Extend instruction
- ZeroExtendOrBitCast(Value, ITypeRef)
Creates a zero extend or bit cast instruction