我想使用 c++ api 将 ac 回调函数转换为 llvm 函数。我的示例 C++ 函数如下所示。
extern "C" void bindMe(int(*compare)(const int a))
{
llvm::LLVMContext& context = llvm::getGlobalContext();
llvm::Module *module = new llvm::Module("top", context);
llvm::IRBuilder<> builder(context);
//I want to create the corresponding llvm function here which is called compareLLVM
llvm::BasicBlock *entry = llvm::BasicBlock::Create(context, "entrypoint", compareLLVM);
builder.SetInsertPoint(entry);
module->dump();
}
基本上我想将bindMe函数的参数(ac回调函数)转换为相应的llvm函数。使用 API 可以实现这样的事情吗?
我真的很感激任何想法。
谢谢