Displaying 1 result from an estimated 1 matches for "utilityfunctiontype".
2008 Jan 16
0
[LLVMdev] Cross-module function calls (code included)
...getPointerToFunction(utilityFunction);
printf("%d\n", fp());
fp = (int (*)()) executionEngine->getPointerToFunction(mainFunction);
printf("%d\n", fp());
return 0;
}
void SetupModules()
{
BasicBlock* entry;
std::vector<const Type *> params;
llvm::FunctionType * utilityFunctionType;
utilityFunctionType = llvm::FunctionType::get(llvm::Type::Int32Ty,
params, false);
mainModule = new Module("Main Module");
utilityFunctionPrototype = new llvm::Function(utilityFunctionType,
llvm::Function::ExternalLinkage, "Utility Function", mainModule);
mainFuncti...