diff options
Diffstat (limited to 'contrib/llvm/tools/llvm-rtdyld')
-rw-r--r-- | contrib/llvm/tools/llvm-rtdyld/CMakeLists.txt | 5 | ||||
-rw-r--r-- | contrib/llvm/tools/llvm-rtdyld/Makefile | 23 | ||||
-rw-r--r-- | contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp | 31 |
3 files changed, 18 insertions, 41 deletions
diff --git a/contrib/llvm/tools/llvm-rtdyld/CMakeLists.txt b/contrib/llvm/tools/llvm-rtdyld/CMakeLists.txt deleted file mode 100644 index 17e2c3e..0000000 --- a/contrib/llvm/tools/llvm-rtdyld/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} support MC object RuntimeDyld JIT) - -add_llvm_tool(llvm-rtdyld - llvm-rtdyld.cpp - ) diff --git a/contrib/llvm/tools/llvm-rtdyld/Makefile b/contrib/llvm/tools/llvm-rtdyld/Makefile deleted file mode 100644 index 0d57277..0000000 --- a/contrib/llvm/tools/llvm-rtdyld/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -##===- tools/llvm-rtdyld/Makefile --------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -TOOLNAME = llvm-rtdyld - -# This tool has no plugins, optimize startup time. -TOOL_NO_EXPORTS = 1 - -# Include this here so we can get the configuration of the targets -# that have been configured for construction. We have to do this -# early so we can set up LINK_COMPONENTS before including Makefile.rules -include $(LEVEL)/Makefile.config - -LINK_COMPONENTS := $(TARGETS_TO_BUILD) support MC object RuntimeDyld JIT - -include $(LLVM_SRC_ROOT)/Makefile.rules diff --git a/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp index ec9d652..01a7d15 100644 --- a/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -51,22 +51,30 @@ EntryPoint("entry", class TrivialMemoryManager : public RTDyldMemoryManager { public: SmallVector<sys::MemoryBlock, 16> FunctionMemory; + SmallVector<sys::MemoryBlock, 16> DataMemory; + + uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, + unsigned SectionID); + uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, + unsigned SectionID); + + virtual void *getPointerToNamedFunction(const std::string &Name, + bool AbortOnFailure = true) { + return 0; + } - uint8_t *startFunctionBody(const char *Name, uintptr_t &Size); - void endFunctionBody(const char *Name, uint8_t *FunctionStart, - uint8_t *FunctionEnd); }; -uint8_t *TrivialMemoryManager::startFunctionBody(const char *Name, - uintptr_t &Size) { +uint8_t *TrivialMemoryManager::allocateCodeSection(uintptr_t Size, + unsigned Alignment, + unsigned SectionID) { return (uint8_t*)sys::Memory::AllocateRWX(Size, 0, 0).base(); } -void TrivialMemoryManager::endFunctionBody(const char *Name, - uint8_t *FunctionStart, - uint8_t *FunctionEnd) { - uintptr_t Size = FunctionEnd - FunctionStart + 1; - FunctionMemory.push_back(sys::MemoryBlock(FunctionStart, Size)); +uint8_t *TrivialMemoryManager::allocateDataSection(uintptr_t Size, + unsigned Alignment, + unsigned SectionID) { + return (uint8_t*)sys::Memory::AllocateRWX(Size, 0, 0).base(); } static const char *ProgramName; @@ -142,10 +150,7 @@ int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv, "llvm MC-JIT tool\n"); switch (Action) { - default: case AC_Execute: return executeInput(); } - - return 0; } |