[clang] hurd: Fix build with -Werror,-Wswitch (PR #78520)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 15:20:50 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Samuel Thibault (sthibaul)

<details>
<summary>Changes</summary>

We do not handle all architectures, llvm_unreachable is called after the switch, so we can just break.

Fixes https://lab.llvm.org/buildbot/#/builders/19/builds/23702

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


1 Files Affected:

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


``````````diff
diff --git a/clang/lib/Driver/ToolChains/Hurd.cpp b/clang/lib/Driver/ToolChains/Hurd.cpp
index 5074eda5f41559..36499fb11ad88f 100644
--- a/clang/lib/Driver/ToolChains/Hurd.cpp
+++ b/clang/lib/Driver/ToolChains/Hurd.cpp
@@ -135,6 +135,8 @@ Tool *Hurd::buildAssembler() const {
 
 std::string Hurd::getDynamicLinker(const ArgList &Args) const {
   switch (getArch()) {
+  default:
+    break;
   case llvm::Triple::x86:
     return "/lib/ld.so";
   case llvm::Triple::x86_64:

``````````

</details>


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


More information about the cfe-commits mailing list