summaryrefslogtreecommitdiff
path: root/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
commit3ec2c7c3e48f1fbab749870c51a74920f91c82c1 (patch)
tree35453cf2c65f0270f8bd8c2bca81fc7a866fda60 /lib/ExecutionEngine/MCJIT/MCJIT.cpp
parent49fcf571da21c6763776f00c814a5ee50bd8a923 (diff)
downloadllvm-3ec2c7c3e48f1fbab749870c51a74920f91c82c1.tar.gz
llvm-3ec2c7c3e48f1fbab749870c51a74920f91c82c1.tar.bz2
llvm-3ec2c7c3e48f1fbab749870c51a74920f91c82c1.tar.xz
Objective C functions may use a magic '\1' on the name. Handle that when
dealing with them in the MCJIT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/MCJIT/MCJIT.cpp')
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJIT.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index 8adebf3932..96e5c6803a 100644
--- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/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());
}