aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-04-08 17:31:24 +0000
committerJim Grosbach <grosbach@apple.com>2011-04-08 17:31:24 +0000
commitb027105fa50c864d44873dc78daafb3db3ec9c14 (patch)
tree921424701f964bbe027bef5b1b698d8945c1698d /lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
parent084b5df5aedc83af0588ae8c2145e4f98faf1d8f (diff)
Refactor MCJIT 32-bit section loading.
Teach 32-bit section loading to use the Memory Manager interface, just like the 64-bit loading does. Tidy up a few other things here and there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h')
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h b/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
index 0108ecca84..e3c6fda63b 100644
--- a/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
+++ b/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
@@ -32,6 +32,9 @@ public:
// a pointer to the allocated memory and update Size to reflect how much
// memory was acutally allocated.
uint8_t *startFunctionBody(const char *Name, uintptr_t &Size) {
+ // FIXME: This should really reference the MCAsmInfo to get the global
+ // prefix.
+ if (Name[0] == '_') ++Name;
Function *F = M->getFunction(Name);
assert(F && "No matching function in JIT IR Module!");
return JMM->startFunctionBody(F, Size);
@@ -41,6 +44,9 @@ public:
// memory was actually used.
void endFunctionBody(const char *Name, uint8_t *FunctionStart,
uint8_t *FunctionEnd) {
+ // FIXME: This should really reference the MCAsmInfo to get the global
+ // prefix.
+ if (Name[0] == '_') ++Name;
Function *F = M->getFunction(Name);
assert(F && "No matching function in JIT IR Module!");
JMM->endFunctionBody(F, FunctionStart, FunctionEnd);