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

via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 30 18:53:03 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Brad Smith (brad0)

<details>
<summary>Changes</summary>

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 &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 "";
 }

``````````

</details>


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


More information about the cfe-commits mailing list