Пример #1
0
        public FunctionSignature(IABI abi, Type returnType, Type[] parameterTypes, MethodCallingConvention callingConvention, PInvokeInfo pinvoke)
        {
            ReturnType = new FunctionParameterType(abi, returnType);
            ParameterTypes = new FunctionParameterType[parameterTypes.Length];
            for (int index = 0; index < parameterTypes.Length; index++)
                ParameterTypes[index] = new FunctionParameterType(abi, parameterTypes[index]);

            CallingConvention = callingConvention;
            PInvokeInfo = pinvoke;
        }
Пример #2
0
        public FunctionSignature(IABI abi, Type returnType, Type[] parameterTypes, MethodCallingConvention callingConvention, PInvokeInfo pinvoke)
        {
            ReturnType     = new FunctionParameterType(abi, returnType);
            ParameterTypes = new FunctionParameterType[parameterTypes.Length];
            for (int index = 0; index < parameterTypes.Length; index++)
            {
                ParameterTypes[index] = new FunctionParameterType(abi, parameterTypes[index]);
            }

            CallingConvention = callingConvention;
            PInvokeInfo       = pinvoke;
        }
Пример #3
0
 private TypeRef GetFunctionInputParameterTypeLLVM(FunctionParameterType parameterType)
 {
     switch (parameterType.ABIParameterInfo.Kind)
     {
         case ABIParameterInfoKind.Indirect:
             return LLVM.PointerType(parameterType.Type.DefaultTypeLLVM, 0);
         case ABIParameterInfoKind.Coerced:
             return parameterType.ABIParameterInfo.CoerceType;
         case ABIParameterInfoKind.Direct:
             return parameterType.Type.DefaultTypeLLVM;
         default:
             throw new ArgumentOutOfRangeException();
     }
 }