https://github.com/ilovepi created 
https://github.com/llvm/llvm-project/pull/131182

None

>From a3f248bb681fe4c181d2ed9fb229617213337eb3 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulki...@google.com>
Date: Thu, 13 Mar 2025 10:18:47 -0700
Subject: [PATCH] [clang][driver][NFC] Remove else after return

---
 clang/lib/Driver/ToolChains/Arch/RISCV.cpp | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp 
b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
index 6935904a24edb..776dc81027046 100644
--- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
@@ -318,11 +318,11 @@ std::string riscv::getRISCVArch(const llvm::opt::ArgList 
&Args,
 
     if (MABI.equals_insensitive("ilp32e"))
       return "rv32e";
-    else if (MABI.equals_insensitive("lp64e"))
+    if (MABI.equals_insensitive("lp64e"))
       return "rv64e";
-    else if (MABI.starts_with_insensitive("ilp32"))
+    if (MABI.starts_with_insensitive("ilp32"))
       return "rv32imafdc";
-    else if (MABI.starts_with_insensitive("lp64")) {
+    if (MABI.starts_with_insensitive("lp64")) {
       if (Triple.isAndroid())
         return "rv64imafdcv_zba_zbb_zbs";
 
@@ -338,16 +338,14 @@ std::string riscv::getRISCVArch(const llvm::opt::ArgList 
&Args,
   if (Triple.isRISCV32()) {
     if (Triple.getOS() == llvm::Triple::UnknownOS)
       return "rv32imac";
-    else
-      return "rv32imafdc";
-  } else {
-    if (Triple.getOS() == llvm::Triple::UnknownOS)
-      return "rv64imac";
-    else if (Triple.isAndroid())
-      return "rv64imafdcv_zba_zbb_zbs";
-    else
-      return "rv64imafdc";
+    return "rv32imafdc";
   }
+
+  if (Triple.getOS() == llvm::Triple::UnknownOS)
+    return "rv64imac";
+  if (Triple.isAndroid())
+    return "rv64imafdcv_zba_zbb_zbs";
+  return "rv64imafdc";
 }
 
 std::string riscv::getRISCVTargetCPU(const llvm::opt::ArgList &Args,

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

Reply via email to