/// <summary> /// Create a function with arguments and a return type. /// </summary> /// <param name="module"></param> /// <param name="name"></param> /// <param name="returnType"></param> /// <param name="paramTypes"></param> public Function(Module module, string name, TypeRef returnType, TypeRef[] paramTypes) { m_name = name; m_returnType = returnType; m_paramTypes = paramTypes; IntPtr[] paramArray = LLVMHelper.MarshallPointerArray(paramTypes); m_funcType = Native.FunctionType(returnType.Handle, paramArray, (uint)paramArray.Length, 0); m_handle = Native.AddFunction(module.Handle, name, m_funcType); }
public Value BuildReturn(IEnumerable <Value> returnValues) { IntPtr[] retVals = LLVMHelper.MarshallPointerArray(returnValues); return(new Value(Native.BuildAggregateRet(m_builder, retVals, (uint)retVals.Length))); }
public Value BuildCall(Function func, IEnumerable <Value> args, string varName = tmpvarname) { IntPtr[] argVals = LLVMHelper.MarshallPointerArray(args); return(new Value(Native.BuildCall(m_builder, func.Handle, argVals, (uint)argVals.Length, varName))); }
public IntPtr[] GetBlockPointers() { return(LLVMHelper.MarshallPointerArray(m_incomingBlocks)); }
public IntPtr[] GetValuePointers() { return(LLVMHelper.MarshallPointerArray(m_incomingVals)); }