summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-11-12 02:31:32 +0000
committerSean Callanan <scallanan@apple.com>2011-11-12 02:31:32 +0000
commit0772ae1b53ff7022ae204ab3b9d1ac1ad36e5055 (patch)
tree524ec85fcdaefee539fd21040ce5c04519fc5315 /llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
parent10d7e4fe596b0db00997dff47c7794d3be9734ca (diff)
downloadbcm5719-llvm-0772ae1b53ff7022ae204ab3b9d1ac1ad36e5055.tar.gz
bcm5719-llvm-0772ae1b53ff7022ae204ab3b9d1ac1ad36e5055.zip
Fixed the MCJIT so that it can emit not only instance
methods but also class methods for Objective-C. Clang emits Objective-C method names with '\1' at the beginning, and the JIT has pre-existing logic to try prepending a '\1' when searching a module for an instance method (that is, a method whose name begins with '-'). I simply extended it to do the same thing when it encountered a class method (a method whose name begins with '+'). llvm-svn: 144451
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h b/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
index c17a39736cc..58f9100eeff 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
@@ -39,9 +39,9 @@ public:
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] == '-')
+ // the symbol and it's of the ObjC conventions (starts with "-" or
+ // "+"), try prepending a \01 and see if we can find it that way.
+ if (!F && (Name[0] == '-' || Name[0] == '+'))
F = M->getFunction((Twine("\1") + Name).str());
assert(F && "No matching function in JIT IR Module!");
return JMM->startFunctionBody(F, Size);
@@ -56,9 +56,9 @@ public:
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] == '-')
+ // the symbol and it's of the ObjC conventions (starts with "-" or
+ // "+"), try prepending a \01 and see if we can find it that way.
+ if (!F && (Name[0] == '-' || Name[0] == '+'))
F = M->getFunction((Twine("\1") + Name).str());
assert(F && "No matching function in JIT IR Module!");
JMM->endFunctionBody(F, FunctionStart, FunctionEnd);
OpenPOWER on IntegriCloud