summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-11-27 20:45:25 +0000
committerChris Lattner <sabre@nondot.org>2007-11-27 20:45:25 +0000
commitbe5f3cb6f1a15fe767ba878ba46607e3ca5c8103 (patch)
tree24e819c2c69f9210358111437741c70d3284c9c2 /llvm/lib/ExecutionEngine
parentfffd0ae2f19b967a9a4da0e966d1cc5434ce6700 (diff)
downloadbcm5719-llvm-be5f3cb6f1a15fe767ba878ba46607e3ca5c8103.tar.gz
bcm5719-llvm-be5f3cb6f1a15fe767ba878ba46607e3ca5c8103.zip
Make this actually work on systems that support ppc long double.
llvm-svn: 44374
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/JIT/Intercept.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/Intercept.cpp b/llvm/lib/ExecutionEngine/JIT/Intercept.cpp
index 6d5e7da772f..a4d0faa04ba 100644
--- a/llvm/lib/ExecutionEngine/JIT/Intercept.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud