summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorDavid Tweed <david.tweed@arm.com>2013-05-17 10:01:46 +0000
committerDavid Tweed <david.tweed@arm.com>2013-05-17 10:01:46 +0000
commitabb38fe8dec11b1ea7535f84fac8ad0f0af70add (patch)
tree14d65d4e61acb9acb731e953ae5ff714ca1a9c7f /lib/ExecutionEngine
parente91967820879b79f95b0378124c5f40d9e6d54ee (diff)
downloadllvm-abb38fe8dec11b1ea7535f84fac8ad0f0af70add.tar.gz
llvm-abb38fe8dec11b1ea7535f84fac8ad0f0af70add.tar.bz2
llvm-abb38fe8dec11b1ea7535f84fac8ad0f0af70add.tar.xz
Minor changes to the MCJITTest unittests to use the correct API for finalizing
the JIT object (including XFAIL an ARM test that now needs fixing). Also renames internal function for consistency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/JIT/JITMemoryManager.cpp2
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJIT.cpp2
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJIT.h7
-rw-r--r--lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp2
4 files changed, 10 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
index bf5680d832..6a1db16a6a 100644
--- a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
+++ b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
@@ -509,7 +509,7 @@ namespace {
return (uint8_t*)DataAllocator.Allocate(Size, Alignment);
}
- bool applyPermissions(std::string *ErrMsg) {
+ bool finalizeMemory(std::string *ErrMsg) {
return false;
}
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index ced567205a..e861938563 100644
--- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -178,7 +178,7 @@ void MCJIT::finalizeObject() {
MemMgr->registerEHFrames(EHData);
// Set page permissions.
- MemMgr->applyPermissions();
+ MemMgr->finalizeMemory();
}
void *MCJIT::getPointerToBasicBlock(BasicBlock *BB) {
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.h b/lib/ExecutionEngine/MCJIT/MCJIT.h
index 7f247e2dee..a899d4f408 100644
--- a/lib/ExecutionEngine/MCJIT/MCJIT.h
+++ b/lib/ExecutionEngine/MCJIT/MCJIT.h
@@ -52,6 +52,13 @@ public:
/// Sets the object manager that MCJIT should use to avoid compilation.
virtual void setObjectCache(ObjectCache *manager);
+ /// finalizeObject - ensure the module is fully processed and is usable.
+ ///
+ /// It is the user-level function for completing the process of making the
+ /// object usable for execution. It should be called after sections within an
+ /// object have been relocated using mapSectionAddress. When this method is
+ /// called the MCJIT execution engine will reapply relocations for a loaded
+ /// object.
virtual void finalizeObject();
virtual void *getPointerToBasicBlock(BasicBlock *BB);
diff --git a/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp b/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp
index bac77ce75f..1bb0103f08 100644
--- a/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp
+++ b/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp
@@ -111,7 +111,7 @@ uint8_t *SectionMemoryManager::allocateSection(MemoryGroup &MemGroup,
return (uint8_t*)Addr;
}
-bool SectionMemoryManager::applyPermissions(std::string *ErrMsg)
+bool SectionMemoryManager::finalizeMemory(std::string *ErrMsg)
{
// FIXME: Should in-progress permissions be reverted if an error occurs?
error_code ec;