summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
diff options
context:
space:
mode:
authorDanil Malyshev <dmalyshev@accesssoftek.com>2012-03-28 21:46:36 +0000
committerDanil Malyshev <dmalyshev@accesssoftek.com>2012-03-28 21:46:36 +0000
commitbfee542ccedd364accd6746ff6e04a2bfb29a9ad (patch)
tree618563752ad0e8101be92e6ec8740261f324ff6f /llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
parent5054ee82cc3bbdab9813b1e1b6b96b5c1c7a9e67 (diff)
downloadbcm5719-llvm-bfee542ccedd364accd6746ff6e04a2bfb29a9ad.tar.gz
bcm5719-llvm-bfee542ccedd364accd6746ff6e04a2bfb29a9ad.zip
Move getPointerToNamedFunction() from JIT/MCJIT to JITMemoryManager.
llvm-svn: 153607
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h b/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
index ac8c15579ef..118b0d42ee8 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
@@ -27,7 +27,8 @@ class MCJITMemoryManager : public RTDyldMemoryManager {
// FIXME: Multiple modules.
Module *M;
public:
- MCJITMemoryManager(JITMemoryManager *jmm, Module *m) : JMM(jmm), M(m) {}
+ MCJITMemoryManager(JITMemoryManager *jmm, Module *m) :
+ JMM(jmm?jmm:JITMemoryManager::CreateDefaultMemManager()), M(m) {}
// We own the JMM, so make sure to delete it.
~MCJITMemoryManager() { delete JMM; }
@@ -41,6 +42,11 @@ public:
return JMM->allocateCodeSection(Size, Alignment, SectionID);
}
+ virtual void *getPointerToNamedFunction(const std::string &Name,
+ bool AbortOnFailure = true) {
+ return JMM->getPointerToNamedFunction(Name, AbortOnFailure);
+ }
+
// Allocate ActualSize bytes, or more, for the named function. Return
// a pointer to the allocated memory and update Size to reflect how much
// memory was acutally allocated.
@@ -50,7 +56,7 @@ public:
if (Name[0] == '_') ++Name;
Function *F = M->getFunction(Name);
// Some ObjC names have a prefixed \01 in the IR. If we failed to find
- // the symbol and it's of the ObjC conventions (starts with "-" or
+ // the symbol and it's of the ObjC conventions (starts with "-" or
// "+"), try prepending a \01 and see if we can find it that way.
if (!F && (Name[0] == '-' || Name[0] == '+'))
F = M->getFunction((Twine("\1") + Name).str());
OpenPOWER on IntegriCloud