From 01cfa94212a1e352145319554047aea3a637d709 Mon Sep 17 00:00:00 2001 From: Yi Jiang Date: Thu, 5 Dec 2013 22:42:50 +0000 Subject: Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, x) ―> __exp10(x) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit llvm-svn: 196544 --- llvm/lib/Target/TargetLibraryInfo.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'llvm/lib/Target/TargetLibraryInfo.cpp') diff --git a/llvm/lib/Target/TargetLibraryInfo.cpp b/llvm/lib/Target/TargetLibraryInfo.cpp index 3e68fe16d4a..753562077f9 100644 --- a/llvm/lib/Target/TargetLibraryInfo.cpp +++ b/llvm/lib/Target/TargetLibraryInfo.cpp @@ -401,6 +401,31 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T, TLI.setAvailableWithName(LibFunc::fputs, "fputs$UNIX2003"); } + // exp10 and exp10f are not available on OS X until 10.9 and iOS until 7.0 + // and their names are __exp10 and __exp10f. exp10l is not available on + // OS X or iOS. + if (T.isMacOSX()) { + TLI.setUnavailable(LibFunc::exp10l); + if (T.isMacOSXVersionLT(10, 9)) { + TLI.setUnavailable(LibFunc::exp10); + TLI.setUnavailable(LibFunc::exp10f); + } else { + TLI.setAvailableWithName(LibFunc::exp10, "__exp10"); + TLI.setAvailableWithName(LibFunc::exp10f, "__exp10f"); + } + } + + if (T.getOS() == Triple::IOS) { + TLI.setUnavailable(LibFunc::exp10l); + if (T.isOSVersionLT(7, 0)) { + TLI.setUnavailable(LibFunc::exp10); + TLI.setUnavailable(LibFunc::exp10f); + } else { + TLI.setAvailableWithName(LibFunc::exp10, "__exp10"); + TLI.setAvailableWithName(LibFunc::exp10f, "__exp10f"); + } + } + // iprintf and friends are only available on XCore and TCE. if (T.getArch() != Triple::xcore && T.getArch() != Triple::tce) { TLI.setUnavailable(LibFunc::iprintf); -- cgit v1.2.3