summaryrefslogtreecommitdiff
path: root/tools/llvm-rtdyld
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-03-22 05:44:06 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-03-22 05:44:06 +0000
commit3e29671cca14f8fce1ea6b602175880cb3df7199 (patch)
treee288bd135f9f6d086a608315cf816660502b76b7 /tools/llvm-rtdyld
parentf2f6182f6a88cf4b8d8cb95686d68aa14ddb6857 (diff)
downloadllvm-3e29671cca14f8fce1ea6b602175880cb3df7199.tar.gz
llvm-3e29671cca14f8fce1ea6b602175880cb3df7199.tar.bz2
llvm-3e29671cca14f8fce1ea6b602175880cb3df7199.tar.xz
Revert a series of commits to MCJIT to get the build working in CMake
(and hopefully on Windows). The bots have been down most of the day because of this, and it's not clear to me what all will be required to fix it. The commits started with r153205, then r153207, r153208, and r153221. The first commit seems to be the real culprit, but I couldn't revert a smaller number of patches. When resubmitting, r153207 and r153208 should be folded into r153205, they were simple build fixes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-rtdyld')
-rw-r--r--tools/llvm-rtdyld/llvm-rtdyld.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/tools/llvm-rtdyld/llvm-rtdyld.cpp b/tools/llvm-rtdyld/llvm-rtdyld.cpp
index 01a7d15807..990582d7f4 100644
--- a/tools/llvm-rtdyld/llvm-rtdyld.cpp
+++ b/tools/llvm-rtdyld/llvm-rtdyld.cpp
@@ -58,11 +58,9 @@ public:
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::allocateCodeSection(uintptr_t Size,
@@ -77,6 +75,18 @@ uint8_t *TrivialMemoryManager::allocateDataSection(uintptr_t Size,
return (uint8_t*)sys::Memory::AllocateRWX(Size, 0, 0).base();
}
+uint8_t *TrivialMemoryManager::startFunctionBody(const char *Name,
+ uintptr_t &Size) {
+ 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));
+}
+
static const char *ProgramName;
static void Message(const char *Type, const Twine &Msg) {