store thunk func ptr in jit metadata

This commit is contained in:
Ivan 2018-04-05 00:54:45 +03:00
parent bdc5f65070
commit a27d6492c3
2 changed files with 4 additions and 0 deletions

View file

@ -457,12 +457,14 @@ llvm::StructType *getSymListElemType(llvm::LLVMContext &context) {
// {
// i8* name;
// i8* func;
// i8* originalFunc;
// };
llvm::StructType *getFuncListElemType(llvm::LLVMContext &context) {
llvm::Type *elements[] = {
llvm::IntegerType::getInt8PtrTy(context),
llvm::IntegerType::getInt8PtrTy(context),
llvm::IntegerType::getInt8PtrTy(context),
};
return llvm::StructType::create(context, elements, /*"RtCompileFuncList"*/ "",
true);
@ -534,6 +536,7 @@ generateFuncList(IRState *irs, const Types &types) {
llvm::Constant *fields[] = {
createStringInitializer(irs->module, name),
getI8Ptr(it.second.thunkVar),
getI8Ptr(it.second.thunkFunc),
};
elements.push_back(
llvm::ConstantStruct::get(types.funcListElemType, fields));

View file

@ -39,6 +39,7 @@ namespace {
struct RtCompileFuncList {
const char *name;
void **func;
void *originalFunc;
};
struct RtCompileSymList {