#include "io.hpp" #include extern "C" std::unique_ptr lib_io() { auto mod = std::make_unique("io"); std::vector params; auto* ret = llvm::Type::getInt32Ty(mod->context()); auto* ftype = llvm::FunctionType::get(ret, params, false); llvm::Function::Create(ftype, llvm::Function::ExternalLinkage, "hello", mod->mod()); return mod; } extern "C" int hello(int x) { return 2 * x + 1; }