summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/MCJIT
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h b/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
index 0108ecca84f..e3c6fda63b4 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
+++ b/llvm/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);
OpenPOWER on IntegriCloud