From 5fc6406e3924021b53e0b5f246a5cb604c1c3624 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Wed, 28 Oct 2015 00:28:26 +0000 Subject: [Orc] Add experimental C bindings for Orc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251472 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/Orc/OrcCBindingsStack.cpp | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 lib/ExecutionEngine/Orc/OrcCBindingsStack.cpp (limited to 'lib/ExecutionEngine/Orc/OrcCBindingsStack.cpp') diff --git a/lib/ExecutionEngine/Orc/OrcCBindingsStack.cpp b/lib/ExecutionEngine/Orc/OrcCBindingsStack.cpp new file mode 100644 index 00000000000..93c698da104 --- /dev/null +++ b/lib/ExecutionEngine/Orc/OrcCBindingsStack.cpp @@ -0,0 +1,47 @@ +//===-------- 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 +#include + +using namespace llvm; + +OrcCBindingsStack::CallbackManagerBuilder +OrcCBindingsStack::createCallbackManagerBuilder(Triple T) { + switch (T.getArch()) { + default: return nullptr; + + case Triple::x86_64: { + typedef orc::JITCompileCallbackManager CCMgrT; + return [](CompileLayerT &CompileLayer, RuntimeDyld::MemoryManager &MemMgr, + LLVMContext &Context) { + return llvm::make_unique(CompileLayer, MemMgr, Context, 0, + 64); + }; + } + } +} + +OrcCBindingsStack::IndirectStubsManagerBuilder +OrcCBindingsStack::createIndirectStubsMgrBuilder(Triple T) { + switch (T.getArch()) { + default: return nullptr; + + case Triple::x86_64: + return [](){ + return llvm::make_unique>(); + }; + } +} -- cgit v1.2.3