diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-27 20:45:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-27 20:45:25 +0000 |
commit | a8d700138ad17ef3d7e865d29a3dd3d85240d944 (patch) | |
tree | dbcd781ac0ff819948b939bd6466b6a761614489 /lib/ExecutionEngine/JIT/Intercept.cpp | |
parent | 1c8f374a3b56eb39d82f1e70271e56b152779146 (diff) | |
download | external_llvm-a8d700138ad17ef3d7e865d29a3dd3d85240d944.zip external_llvm-a8d700138ad17ef3d7e865d29a3dd3d85240d944.tar.gz external_llvm-a8d700138ad17ef3d7e865d29a3dd3d85240d944.tar.bz2 |
Make this actually work on systems that support ppc long double.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44374 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/Intercept.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/Intercept.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/JIT/Intercept.cpp b/lib/ExecutionEngine/JIT/Intercept.cpp index 6d5e7da..a4d0faa 100644 --- a/lib/ExecutionEngine/JIT/Intercept.cpp +++ b/lib/ExecutionEngine/JIT/Intercept.cpp @@ -107,9 +107,14 @@ void *JIT::getPointerToNamedFunction(const std::string &Name) { // we have one of these, strip off $LDBLStub and try again. #if defined(__APPLE__) && defined(__ppc__) if (Name.size() > 9 && Name[Name.size()-9] == '$' && - memcmp(&Name[Name.size()-8], "LDBLStub", 8) == 0) - return getPointerToNamedFunction(std::string(Name.begin(), - Name.end()-9)); + memcmp(&Name[Name.size()-8], "LDBLStub", 8) == 0) { + // First try turning $LDBLStub into $LDBL128. If that fails, strip it off. + // This mirrors logic in libSystemStubs.a. + std::string Prefix = std::string(Name.begin(), Name.end()-9); + if (void *Ptr = getPointerToNamedFunction(Prefix+"$LDBL128")) + return Ptr; + return getPointerToNamedFunction(Prefix); + } #endif /// If a LazyFunctionCreator is installed, use it to get/create the function. |