2015-10-28 10:40:04 +08:00
|
|
|
//===-------- OrcCBindingsStack.cpp - Orc JIT stack for C bindings --------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "OrcCBindingsStack.h"
|
|
|
|
|
|
|
|
#include "llvm/ExecutionEngine/Orc/OrcTargetSupport.h"
|
|
|
|
#include "llvm/Support/Debug.h"
|
|
|
|
#include "llvm/Support/DynamicLibrary.h"
|
|
|
|
#include <cstdio>
|
|
|
|
#include <system_error>
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2015-11-04 00:40:37 +08:00
|
|
|
std::unique_ptr<OrcCBindingsStack::CompileCallbackMgr>
|
|
|
|
OrcCBindingsStack::createCompileCallbackMgr(Triple T) {
|
2015-10-28 10:40:04 +08:00
|
|
|
switch (T.getArch()) {
|
|
|
|
default: return nullptr;
|
|
|
|
|
|
|
|
case Triple::x86_64: {
|
2015-12-04 10:15:39 +08:00
|
|
|
typedef orc::LocalJITCompileCallbackManager<orc::OrcX86_64> CCMgrT;
|
2015-11-04 00:40:37 +08:00
|
|
|
return llvm::make_unique<CCMgrT>(0);
|
2015-10-28 10:40:04 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
OrcCBindingsStack::IndirectStubsManagerBuilder
|
|
|
|
OrcCBindingsStack::createIndirectStubsMgrBuilder(Triple T) {
|
|
|
|
switch (T.getArch()) {
|
|
|
|
default: return nullptr;
|
|
|
|
|
|
|
|
case Triple::x86_64:
|
|
|
|
return [](){
|
2015-12-07 03:44:45 +08:00
|
|
|
return llvm::make_unique<
|
|
|
|
orc::LocalIndirectStubsManager<orc::OrcX86_64>>();
|
2015-10-28 10:40:04 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|