diff options
author | Yi Jiang <yjiang@apple.com> | 2013-12-12 01:55:04 +0000 |
---|---|---|
committer | Yi Jiang <yjiang@apple.com> | 2013-12-12 01:55:04 +0000 |
commit | f92a574246b391e905847e74b5e0283589c8741f (patch) | |
tree | f1617a8e57fa85330f1d62026e2183a7c6a87c2b /llvm/lib/Target/TargetLibraryInfo.cpp | |
parent | 4705f8d842662050a88e9c0ac91ff337a5922fb6 (diff) | |
download | bcm5719-llvm-f92a574246b391e905847e74b5e0283589c8741f.tar.gz bcm5719-llvm-f92a574246b391e905847e74b5e0283589c8741f.zip |
Resubmit r196544: Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, x) ―> __exp10(x)
llvm-svn: 197109
Diffstat (limited to 'llvm/lib/Target/TargetLibraryInfo.cpp')
-rw-r--r-- | llvm/lib/Target/TargetLibraryInfo.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
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); |