diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-05-18 23:53:21 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-05-18 23:53:21 +0000 |
commit | 3ec2c7c3e48f1fbab749870c51a74920f91c82c1 (patch) | |
tree | 35453cf2c65f0270f8bd8c2bca81fc7a866fda60 /lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h | |
parent | 49fcf571da21c6763776f00c814a5ee50bd8a923 (diff) |
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/MCJITMemoryManager.h')
-rw-r--r-- | lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h b/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h index 6cc89e057a..40bc031a07 100644 --- a/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h +++ b/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h @@ -36,6 +36,11 @@ public: // prefix. 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 "-"), try + // prepending a \01 and see if we can find it that way. + if (!F && Name[0] == '-') + F = M->getFunction((Twine("\1") + Name).str()); assert(F && "No matching function in JIT IR Module!"); return JMM->startFunctionBody(F, Size); } @@ -48,6 +53,11 @@ public: // prefix. 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 "-"), try + // prepending a \01 and see if we can find it that way. + if (!F && Name[0] == '-') + F = M->getFunction((Twine("\1") + Name).str()); assert(F && "No matching function in JIT IR Module!"); JMM->endFunctionBody(F, FunctionStart, FunctionEnd); } |