[PATCH] D159222: [clang] Consistently use isOSSolaris()
Rainer Orth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 1 12:46:21 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1bc7b753a5cd: [clang] Consistently use isOSSolaris() (authored by ro).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159222/new/
https://reviews.llvm.org/D159222
Files:
clang/lib/Basic/Targets/Sparc.cpp
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/lib/Driver/ToolChains/Gnu.cpp
Index: clang/lib/Driver/ToolChains/Gnu.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ 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<std::string> &Prefixes,
StringRef SysRoot) {
- if (TargetTriple.getOS() == llvm::Triple::Solaris) {
+ if (TargetTriple.isOSSolaris()) {
// Solaris is a special case.
// The GCC installation is under
// /usr/gcc/<major>.<minor>/lib/gcc/<triple>/<major>.<minor>.<patch>/
@@ -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"};
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ 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")) {
Index: clang/lib/Basic/Targets/Sparc.cpp
===================================================================
--- clang/lib/Basic/Targets/Sparc.cpp
+++ 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__");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159222.555467.patch
Type: text/x-patch
Size: 2799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230901/9b8a9514/attachment.bin>
More information about the cfe-commits
mailing list