1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

Make this actually work on systems that support ppc long double.

llvm-svn: 44374
This commit is contained in:
Chris Lattner 2007-11-27 20:45:25 +00:00
parent b2e4222965
commit fc5fe96a52

View File

@ -107,9 +107,14 @@ void *JIT::getPointerToNamedFunction(const std::string &Name) {
// we have one of these, strip off $LDBLStub and try again. // we have one of these, strip off $LDBLStub and try again.
#if defined(__APPLE__) && defined(__ppc__) #if defined(__APPLE__) && defined(__ppc__)
if (Name.size() > 9 && Name[Name.size()-9] == '$' && if (Name.size() > 9 && Name[Name.size()-9] == '$' &&
memcmp(&Name[Name.size()-8], "LDBLStub", 8) == 0) memcmp(&Name[Name.size()-8], "LDBLStub", 8) == 0) {
return getPointerToNamedFunction(std::string(Name.begin(), // First try turning $LDBLStub into $LDBL128. If that fails, strip it off.
Name.end()-9)); // 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 #endif
/// If a LazyFunctionCreator is installed, use it to get/create the function. /// If a LazyFunctionCreator is installed, use it to get/create the function.