Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
 public Value BuildReturn(IEnumerable <Value> returnValues)
 {
     IntPtr[] retVals = LLVMHelper.MarshallPointerArray(returnValues);
     return(new Value(Native.BuildAggregateRet(m_builder, retVals, (uint)retVals.Length)));
 }
Esempio n. 3
0
        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)));
        }
Esempio n. 4
0
 public IntPtr[] GetBlockPointers()
 {
     return(LLVMHelper.MarshallPointerArray(m_incomingBlocks));
 }
Esempio n. 5
0
 public IntPtr[] GetValuePointers()
 {
     return(LLVMHelper.MarshallPointerArray(m_incomingVals));
 }