From 8e673570b9e6f7d3f4c30d0436062d6dff8aef25 Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Thu, 9 Oct 2014 05:43:30 +0000 Subject: [PATCH] Use triple's isiOS() and isOSDarwin() methods. These methods are already used in lots of places. This makes things more consistent. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219386 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMISelLowering.cpp | 2 +- lib/Target/ARM/ARMSubtarget.cpp | 3 +-- lib/Target/TargetLibraryInfo.cpp | 4 ++-- lib/Transforms/Instrumentation/AddressSanitizer.cpp | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index f9834b213ca..d63557a34ab 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -898,7 +898,7 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM) if (Subtarget->hasSinCos()) { setLibcallName(RTLIB::SINCOS_F32, "sincosf"); setLibcallName(RTLIB::SINCOS_F64, "sincos"); - if (Subtarget->getTargetTriple().getOS() == Triple::IOS) { + if (Subtarget->getTargetTriple().isiOS()) { // For iOS, we don't want to the normal expansion of a libcall to // sincos. We want to issue a libcall to __sincos_stret. setOperationAction(ISD::FSINCOS, MVT::f64, Custom); diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp index a26fba1d50d..a3ade981740 100644 --- a/lib/Target/ARM/ARMSubtarget.cpp +++ b/lib/Target/ARM/ARMSubtarget.cpp @@ -395,8 +395,7 @@ unsigned ARMSubtarget::getMispredictionPenalty() const { } bool ARMSubtarget::hasSinCos() const { - return getTargetTriple().getOS() == Triple::IOS && - !getTargetTriple().isOSVersionLT(7, 0); + return getTargetTriple().isiOS() && !getTargetTriple().isOSVersionLT(7, 0); } // This overrides the PostRAScheduler bit in the SchedModel for any CPU. diff --git a/lib/Target/TargetLibraryInfo.cpp b/lib/Target/TargetLibraryInfo.cpp index 7ca5c74e935..ecb38198551 100644 --- a/lib/Target/TargetLibraryInfo.cpp +++ b/lib/Target/TargetLibraryInfo.cpp @@ -352,7 +352,7 @@ const char* TargetLibraryInfo::StandardNames[LibFunc::NumLibFuncs] = static bool hasSinCosPiStret(const Triple &T) { // Only Darwin variants have _stret versions of combined trig functions. - if (!T.isMacOSX() && T.getOS() != Triple::IOS) + if (!T.isOSDarwin()) return false; // The ABI is rather complicated on x86, so don't do anything special there. @@ -362,7 +362,7 @@ static bool hasSinCosPiStret(const Triple &T) { if (T.isMacOSX() && T.isMacOSXVersionLT(10, 9)) return false; - if (T.getOS() == Triple::IOS && T.isOSVersionLT(7, 0)) + if (T.isiOS() && T.isOSVersionLT(7, 0)) return false; return true; diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 03b80cc50d5..d0cf4030706 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -300,7 +300,7 @@ struct ShadowMapping { static ShadowMapping getShadowMapping(const Module &M, int LongSize) { llvm::Triple TargetTriple(M.getTargetTriple()); bool IsAndroid = TargetTriple.getEnvironment() == llvm::Triple::Android; - bool IsIOS = TargetTriple.getOS() == llvm::Triple::IOS; + bool IsIOS = TargetTriple.isiOS(); bool IsFreeBSD = TargetTriple.getOS() == llvm::Triple::FreeBSD; bool IsLinux = TargetTriple.getOS() == llvm::Triple::Linux; bool IsPPC64 = TargetTriple.getArch() == llvm::Triple::ppc64 || -- 2.34.1