示例#1
0
        public static Function AddFunction(this Module module, Type returnType, string name, Type[] parameterTypes, Action <Function, IRBuilder> action)
        {
            var type    = FunctionType.Create(returnType, parameterTypes);
            var func    = module.AddFunction(name, type);
            var block   = func.AppendBasicBlock(string.Empty);
            var builder = IRBuilder.Create(module.Context);

            builder.PositionBuilderAtEnd(block);
            action(func, builder);
            return(func);
        }
示例#2
0
 Type IHandle <Type> .ToWrapperType() => Type.Create(this);