17 std::array<llvm::Type *, 1> plot_function_args = {
18 llvm::Type::getDoubleTy(ctx),
20 llvm::FunctionType *plot_function_type = llvm::FunctionType::get(llvm::Type::getDoubleTy(ctx), plot_function_args,
false);
22 std::array<llvm::Type *, 3> args = {
23 llvm::PointerType::getUnqual(ctx),
24 llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(ctx)),
25 llvm::PointerType::getUnqual(plot_function_type),
27 llvm::Type *ret = llvm::Type::getVoidTy(ctx);
29 llvm::FunctionType *fn = llvm::FunctionType::get(ret, args,
false);
30 llvm::Function::Create(fn, llvm::GlobalValue::ExternalLinkage,
"unlogic_scene_add_plot", mod);
void unlogic_scene_add_plot(Scene *scene, char const *name, Plot2dFunctionType function)
LibrarySymbol scene_add_plot(runtime, "unlogic_scene_add_plot",(void *) unlogic_scene_add_plot, [](llvm::LLVMContext &ctx, llvm::Module &mod) { std::array< llvm::Type *, 1 > plot_function_args={ llvm::Type::getDoubleTy(ctx), };llvm::FunctionType *plot_function_type=llvm::FunctionType::get(llvm::Type::getDoubleTy(ctx), plot_function_args, false);std::array< llvm::Type *, 3 > args={ llvm::PointerType::getUnqual(ctx), llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(ctx)), llvm::PointerType::getUnqual(plot_function_type), };llvm::Type *ret=llvm::Type::getVoidTy(ctx);llvm::FunctionType *fn=llvm::FunctionType::get(ret, args, false);llvm::Function::Create(fn, llvm::GlobalValue::ExternalLinkage, "unlogic_scene_add_plot", mod);})
double(*)(double) Plot2dFunctionType
void AddPlot(char const *name, Plot2dFunctionType function)