public InvokeInst CreateInvoke(Value Callee, BasicBlock NormalDest, BasicBlock UnwindDest, ReadOnlySpan <Value> Args, ReadOnlySpan <char> Name) { using var argHandles = new MarshaledArray <Value, LLVMValueRef>(Args, (value) => value.Handle); var handle = Handle.BuildInvoke(Callee.Handle, argHandles, NormalDest.Handle, UnwindDest.Handle, Name); return(Context.GetOrCreate <InvokeInst>(handle)); }
public ReturnInst CreateAggregateRet(ReadOnlySpan <Value> retVals) { using var retValHandles = new MarshaledArray <Value, LLVMValueRef>(retVals, (value) => value.Handle); var handle = Handle.BuildAggregateRet(retValHandles); return(Context.GetOrCreate <ReturnInst>(handle)); }
public CallInst CreateCall(Value Callee, ReadOnlySpan <Value> Args, ReadOnlySpan <char> Name) { using var argHandles = new MarshaledArray <Value, LLVMValueRef>(Args, (value) => value.Handle); var handle = Handle.BuildCall(Callee.Handle, argHandles, Name); return(Context.GetOrCreate <CallInst>(handle)); }
public Value CreateInBoundsGEP(Value Ptr, ReadOnlySpan <Value> IdxList, ReadOnlySpan <char> Name) { using var idxListHandles = new MarshaledArray <Value, LLVMValueRef>(IdxList, (value) => value.Handle); var handle = Handle.BuildInBoundsGEP(Ptr.Handle, idxListHandles, Name); return(Context.GetOrCreate(handle)); }
public static Constant GetAnon(LLVMContext Ctx, ReadOnlySpan <Constant> V, bool Packed) { using var marshaledV = new MarshaledArray <Constant, LLVMValueRef>(V, (value) => value.Handle); var handle = Ctx.Handle.GetConstStruct(marshaledV, Packed); return(Ctx.GetOrCreate <Constant>(handle)); }