예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
예제 #5
0
        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));
        }