summaryrefslogtreecommitdiff
path: root/lib/Target/TargetLibraryInfo.cpp
diff options
context:
space:
mode:
authorYi Jiang <yjiang@apple.com>2013-12-05 22:42:50 +0000
committerYi Jiang <yjiang@apple.com>2013-12-05 22:42:50 +0000
commitab906d0048a4d52dea3511470fa65ff28e657ba3 (patch)
treed27ffa70ae46815d6f970f02dbd4b30cf0efb8ae /lib/Target/TargetLibraryInfo.cpp
parent7d3a11fd9f687e6e9644cf65eac9ec38ab50f266 (diff)
downloadllvm-ab906d0048a4d52dea3511470fa65ff28e657ba3.tar.gz
llvm-ab906d0048a4d52dea3511470fa65ff28e657ba3.tar.bz2
llvm-ab906d0048a4d52dea3511470fa65ff28e657ba3.tar.xz
Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, x) ―> __exp10(x)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196544 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetLibraryInfo.cpp')
-rw-r--r--lib/Target/TargetLibraryInfo.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Target/TargetLibraryInfo.cpp b/lib/Target/TargetLibraryInfo.cpp
index 3e68fe16d4..753562077f 100644
--- a/lib/Target/TargetLibraryInfo.cpp
+++ b/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);