[clang] [Driver][Solaris] Remove reachable llvm_unreachable (PR #76645)

2024-01-01 Thread Brad Smith via cfe-commits

https://github.com/brad0 closed https://github.com/llvm/llvm-project/pull/76645
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Driver][Solaris] Remove reachable llvm_unreachable (PR #76645)

2023-12-31 Thread Fangrui Song via cfe-commits

https://github.com/MaskRay approved this pull request.


https://github.com/llvm/llvm-project/pull/76645
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Driver][Solaris] Remove reachable llvm_unreachable (PR #76645)

2023-12-30 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Brad Smith (brad0)


Changes

Remove the llvm_unreachable from getSolarisLibSuffix(). The code path is
reachable. In the case of an unsupported architecture we're not worrying
about trying to actually find the library paths, and I don't think it
makes sense for the Driver to crash.

Fixes #58334

---
Full diff: https://github.com/llvm/llvm-project/pull/76645.diff


1 Files Affected:

- (modified) clang/lib/Driver/ToolChains/Solaris.cpp (+1-2) 


``diff
diff --git a/clang/lib/Driver/ToolChains/Solaris.cpp 
b/clang/lib/Driver/ToolChains/Solaris.cpp
index 9a9792d019d5ed..200ac46aa53409 100644
--- a/clang/lib/Driver/ToolChains/Solaris.cpp
+++ b/clang/lib/Driver/ToolChains/Solaris.cpp
@@ -295,13 +295,12 @@ static StringRef getSolarisLibSuffix(const llvm::Triple 
) {
   switch (Triple.getArch()) {
   case llvm::Triple::x86:
   case llvm::Triple::sparc:
+  default:
 break;
   case llvm::Triple::x86_64:
 return "/amd64";
   case llvm::Triple::sparcv9:
 return "/sparcv9";
-  default:
-llvm_unreachable("Unsupported architecture");
   }
   return "";
 }

``




https://github.com/llvm/llvm-project/pull/76645
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Driver][Solaris] Remove reachable llvm_unreachable (PR #76645)

2023-12-30 Thread Brad Smith via cfe-commits

https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/76645

Remove the llvm_unreachable from getSolarisLibSuffix(). The code path is
reachable. In the case of an unsupported architecture we're not worrying
about trying to actually find the library paths, and I don't think it
makes sense for the Driver to crash.

Fixes #58334

>From a79555f4f862a7717ce9e50973e9609bb5eadf97 Mon Sep 17 00:00:00 2001
From: Brad Smith 
Date: Sat, 30 Dec 2023 21:37:55 -0500
Subject: [PATCH] [Driver][Solaris] Remove reachable llvm_unreachable

Remove the llvm_unreachable from getSolarisLibSuffix(). The code path is
reachable. In the case of an unsupported architecture we're not worrying
about trying to actually find the library paths, and I don't think it
makes sense for the Driver to crash.

Fixes #58334
---
 clang/lib/Driver/ToolChains/Solaris.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Solaris.cpp 
b/clang/lib/Driver/ToolChains/Solaris.cpp
index 9a9792d019d5ed..200ac46aa53409 100644
--- a/clang/lib/Driver/ToolChains/Solaris.cpp
+++ b/clang/lib/Driver/ToolChains/Solaris.cpp
@@ -295,13 +295,12 @@ static StringRef getSolarisLibSuffix(const llvm::Triple 
) {
   switch (Triple.getArch()) {
   case llvm::Triple::x86:
   case llvm::Triple::sparc:
+  default:
 break;
   case llvm::Triple::x86_64:
 return "/amd64";
   case llvm::Triple::sparcv9:
 return "/sparcv9";
-  default:
-llvm_unreachable("Unsupported architecture");
   }
   return "";
 }

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits