diff --git a/clang/lib/Basic/Targets/Sparc.cpp b/clang/lib/Basic/Targets/Sparc.cpp --- a/clang/lib/Basic/Targets/Sparc.cpp +++ b/clang/lib/Basic/Targets/Sparc.cpp @@ -141,7 +141,7 @@ void SparcV8TargetInfo::getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const { SparcTargetInfo::getTargetDefines(Opts, Builder); - if (getTriple().getOS() == llvm::Triple::Solaris) + if (getTriple().isOSSolaris()) Builder.defineMacro("__sparcv8"); else { switch (getCPUGeneration(CPU)) { @@ -168,7 +168,7 @@ Builder.defineMacro("__sparcv9"); Builder.defineMacro("__arch64__"); // Solaris doesn't need these variants, but the BSDs do. - if (getTriple().getOS() != llvm::Triple::Solaris) { + if (!getTriple().isOSSolaris()) { Builder.defineMacro("__sparc64__"); Builder.defineMacro("__sparc_v9__"); Builder.defineMacro("__sparcv9__"); diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -998,7 +998,7 @@ // Solaris ld defaults to --export-dynamic behaviour but doesn't support // the option, so don't try to pass it. - if (TC.getTriple().getOS() == llvm::Triple::Solaris && !LinkerIsGnuLd) + if (TC.getTriple().isOSSolaris() && !LinkerIsGnuLd) return true; SmallString<128> SanRT(TC.getCompilerRT(Args, Sanitizer)); if (llvm::sys::fs::exists(SanRT + ".syms")) { diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp @@ -1838,7 +1838,7 @@ StringRef Suff64 = "/64"; // Solaris uses platform-specific suffixes instead of /64. - if (TargetTriple.getOS() == llvm::Triple::Solaris) { + if (TargetTriple.isOSSolaris()) { switch (TargetTriple.getArch()) { case llvm::Triple::x86: case llvm::Triple::x86_64: @@ -2220,7 +2220,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( const llvm::Triple &TargetTriple, SmallVectorImpl &Prefixes, StringRef SysRoot) { - if (TargetTriple.getOS() == llvm::Triple::Solaris) { + if (TargetTriple.isOSSolaris()) { // Solaris is a special case. // The GCC installation is under // /usr/gcc/./lib/gcc//../ @@ -2422,7 +2422,7 @@ using std::begin; using std::end; - if (TargetTriple.getOS() == llvm::Triple::Solaris) { + if (TargetTriple.isOSSolaris()) { static const char *const SolarisLibDirs[] = {"/lib"}; static const char *const SolarisSparcV8Triples[] = { "sparc-sun-solaris2.11"};