Author: lattner
Date: Tue Nov 27 14:45:25 2007
New Revision: 44374

URL: http://llvm.org/viewvc/llvm-project?rev=44374&view=rev
Log:
Make this actually work on systems that support ppc long double.

Modified:
    llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp

Modified: llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp?rev=44374&r1=44373&r2=44374&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp Tue Nov 27 14:45:25 2007
@@ -107,9 +107,14 @@
   // 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. 


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to