[llvm] [ADT][NFC] Remove `else` after `return` in APSInt.h (PR #180790)
Thibault Monnier via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 10 09:42:47 PST 2026
https://github.com/Thibault-Monnier created https://github.com/llvm/llvm-project/pull/180790
Align with the LLVM coding standard:
* https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return
>From 764e984fec48e42d38589490eb8dbde2f6363a2e Mon Sep 17 00:00:00 2001
From: Thibault-Monnier <thibaultmonni at gmail.com>
Date: Tue, 10 Feb 2026 18:41:01 +0100
Subject: [PATCH] Remove else after return
---
llvm/include/llvm/ADT/APSInt.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/llvm/include/llvm/ADT/APSInt.h b/llvm/include/llvm/ADT/APSInt.h
index 88a7a6e71c817..aca0579b3e796 100644
--- a/llvm/include/llvm/ADT/APSInt.h
+++ b/llvm/include/llvm/ADT/APSInt.h
@@ -113,15 +113,13 @@ class [[nodiscard]] APSInt : public APInt {
APSInt extend(uint32_t width) const {
if (IsUnsigned)
return APSInt(zext(width), IsUnsigned);
- else
- return APSInt(sext(width), IsUnsigned);
+ return APSInt(sext(width), IsUnsigned);
}
APSInt extOrTrunc(uint32_t width) const {
if (IsUnsigned)
return APSInt(zextOrTrunc(width), IsUnsigned);
- else
- return APSInt(sextOrTrunc(width), IsUnsigned);
+ return APSInt(sextOrTrunc(width), IsUnsigned);
}
const APSInt &operator%=(const APSInt &RHS) {
More information about the llvm-commits
mailing list