[clang] [clang][driver][NFC] Remove else after return (PR #131182)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 13 11:19:11 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Paul Kirth (ilovepi)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/131182.diff
1 Files Affected:
- (modified) clang/lib/Driver/ToolChains/Arch/RISCV.cpp (+10-12)
``````````diff
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,
``````````
</details>
https://github.com/llvm/llvm-project/pull/131182
More information about the cfe-commits
mailing list