[clang] 0871c4b - [Driver][Solaris] Remove reachable llvm_unreachable (#76645)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 1 01:31:31 PST 2024


Author: Brad Smith
Date: 2024-01-01T04:31:27-05:00
New Revision: 0871c4beb826feba2d2aaf2c3efbe1fdeba7624a

URL: https://github.com/llvm/llvm-project/commit/0871c4beb826feba2d2aaf2c3efbe1fdeba7624a
DIFF: https://github.com/llvm/llvm-project/commit/0871c4beb826feba2d2aaf2c3efbe1fdeba7624a.diff

LOG: [Driver][Solaris] Remove reachable llvm_unreachable (#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

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Solaris.cpp

Removed: 
    


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


        


More information about the cfe-commits mailing list