This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/JIT/JIT_interface.cpp
Vítor Santos Costa ba978d8275 just in time native code: now compiles by doing cmake; make.
no workie in this version, though :)
2015-02-06 18:11:52 +00:00

39 lines
780 B
C++

#if YAP_JIT
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
typedef void *(*call_jitc_t)(struct JIT_Compiler*, yamop *);
void *call_JIT_Compiler(struct JIT_Compiler*, yamop *);
static void
initJit(void)
{
extern void shutdown_llvm(void);
extern call_jitc_t Yap_JITCall;
Yap_InitJitAnalysisPreds();
Yap_InitJitTransformPreds();
Yap_InitJitCodegenPreds();
Yap_InitJitConfigPreds();
#if YAP_STAT_PREDS
Yap_InitJitStatisticPreds();
#endif
#if YAP_DBG_PREDS
Yap_InitJitDebugPreds();
#endif
GLOBAL_JIT_finalizer = shutdown_llvm;
Yap_JITCall = call_JIT_Compiler;
Yap_llvmShutdown = llvm_shutdown;
}
// export JIT as DLL
void
init_jit(void) {
initJit();
}
#pragma GCC diagnostic pop
#endif /* YAP_JIT */