summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-05-18 23:53:21 +0000
committerJim Grosbach <grosbach@apple.com>2011-05-18 23:53:21 +0000
commitb0984715381cb5418737f6968e5a7f6f2b69097d (patch)
tree65d3f04536ce05d79d9a6ee68fbf70e7c67011c1 /llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
parentd1b0f0f1b80cf5e516995aa1517d687130217418 (diff)
downloadbcm5719-llvm-b0984715381cb5418737f6968e5a7f6f2b69097d.tar.gz
bcm5719-llvm-b0984715381cb5418737f6968e5a7f6f2b69097d.zip
Objective C functions may use a magic '\1' on the name. Handle that when
dealing with them in the MCJIT. llvm-svn: 131601
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index 8adebf3932f..96e5c6803a6 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -102,7 +102,12 @@ void *MCJIT::getPointerToFunction(Function *F) {
return Addr;
}
- Twine Name = TM->getMCAsmInfo()->getGlobalPrefix() + F->getName();
+ // FIXME: Should we be using the mangler for this? Probably.
+ StringRef BaseName = F->getName();
+ if (BaseName[0] == '\1')
+ BaseName = BaseName.substr(1);
+ else
+ Twine Name = TM->getMCAsmInfo()->getGlobalPrefix() + BaseName;
return (void*)Dyld.getSymbolAddress(Name.str());
}
OpenPOWER on IntegriCloud