[clang] [Driver][Hurd] Remove llvm_unreachable (PR #171077)

2025-12-07 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Brad Smith (brad0)


Changes

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

Pointed out by bug report #64194

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


1 Files Affected:

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


``diff
diff --git a/clang/lib/Driver/ToolChains/Hurd.cpp 
b/clang/lib/Driver/ToolChains/Hurd.cpp
index 53ee4d4c0cbde..b2c887fb72671 100644
--- a/clang/lib/Driver/ToolChains/Hurd.cpp
+++ b/clang/lib/Driver/ToolChains/Hurd.cpp
@@ -160,7 +160,7 @@ std::string Hurd::getDynamicLinker(const ArgList &Args) 
const {
 break;
   }
 
-  llvm_unreachable("unsupported architecture");
+  return "";
 }
 
 void Hurd::AddClangSystemIncludeArgs(const ArgList &DriverArgs,

``




https://github.com/llvm/llvm-project/pull/171077
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Driver][Hurd] Remove llvm_unreachable (PR #171077)

2025-12-07 Thread Brad Smith via cfe-commits

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

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

Pointed out by bug report #64194

>From 83903444f5ee383ba3ad13ad9152737e8810cff6 Mon Sep 17 00:00:00 2001
From: Brad Smith 
Date: Sun, 7 Dec 2025 23:34:11 -0500
Subject: [PATCH] [Driver][Hurd] Remove llvm_unreachable

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

Pointed out by bug report #64194
---
 clang/lib/Driver/ToolChains/Hurd.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Driver/ToolChains/Hurd.cpp 
b/clang/lib/Driver/ToolChains/Hurd.cpp
index 53ee4d4c0cbde..b2c887fb72671 100644
--- a/clang/lib/Driver/ToolChains/Hurd.cpp
+++ b/clang/lib/Driver/ToolChains/Hurd.cpp
@@ -160,7 +160,7 @@ std::string Hurd::getDynamicLinker(const ArgList &Args) 
const {
 break;
   }
 
-  llvm_unreachable("unsupported architecture");
+  return "";
 }
 
 void Hurd::AddClangSystemIncludeArgs(const ArgList &DriverArgs,

___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits