im using code from the clang interpreter example.
what code do I need to add so I can call functions in my main application?
Thanks.
Paul.
im using code from the clang interpreter example.
what code do I need to add so I can call functions in my main application?
Thanks.
Paul.
Ive tried the following code, but does not work.
What am I doing wrong?
// function I would like to call using JIT
extern "C"
void yipee(double val)
{
fprintf(stderr, "yipee!");
}
std::vector<const llvm::Type*> Double(1,
llvm::Type::getDoubleTy(llvm::getGlobalContext()));
llvm::FunctionType *FT =
llvm::FunctionType::get(llvm::Type::getVoidTy(llvm::getGlobalContext()),
Double, false);
llvm::Function *F = llvm::Function::Create(FT,
llvm::Function::ExternalLinkage);
EE->addGlobalMapping(F, yipee);
gafferuk wrote:
You’ll get a better response on the correct mailing list, try cfe-dev Clang list :-
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Aaron