xo-jit: need global initialization as per kaleidoscope4
This commit is contained in:
parent
066c135629
commit
e8a2297ac0
2 changed files with 17 additions and 0 deletions
|
|
@ -97,6 +97,9 @@ namespace xo {
|
|||
#endif
|
||||
);
|
||||
|
||||
/* iniitialize native builder (i.e. for platform we're running on) */
|
||||
static void init_once();
|
||||
|
||||
private:
|
||||
// ----- this part adapted from LLVM 19.0 KaleidoscopeJIT.hpp [wip] -----
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,18 @@ namespace xo {
|
|||
using std::endl;
|
||||
|
||||
namespace jit {
|
||||
void
|
||||
Jit::init_once() {
|
||||
static bool s_init_once = false;
|
||||
|
||||
if (!s_init_once) {
|
||||
s_init_once = true;
|
||||
|
||||
llvm::InitializeNativeTarget();
|
||||
llvm::InitializeNativeTargetAsmPrinter();
|
||||
llvm::InitializeNativeTargetAsmParser();
|
||||
}
|
||||
} /*init_once*/
|
||||
|
||||
/* tracking KaleidoscopeJIT::Create() here..
|
||||
*
|
||||
|
|
@ -29,6 +41,8 @@ namespace xo {
|
|||
llvm::Expected<std::unique_ptr<Jit>>
|
||||
Jit::make_aux()
|
||||
{
|
||||
Jit::init_once();
|
||||
|
||||
#ifdef NOT_USING
|
||||
/* 'executor process control' */
|
||||
auto epc = llvm::orc::SelfExecutorProcessControl::Create();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue