[lld] [lld][NFC] Remove unnecessary else statements. (PR #69451)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 18 05:01:44 PDT 2023
https://github.com/cjacek created https://github.com/llvm/llvm-project/pull/69451
Follow up addressing #69099 review comment.
>From 6f39ffdc5174ae528928f7b86ffd20c82892856a Mon Sep 17 00:00:00 2001
From: Jacek Caban <jacek at codeweavers.com>
Date: Wed, 18 Oct 2023 13:58:47 +0200
Subject: [PATCH] [lld][NFC] Remove unnecessary else statements.
---
lld/COFF/Chunks.h | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/lld/COFF/Chunks.h b/lld/COFF/Chunks.h
index 4e500cafd3ce4a2..ca125a19c3f3e6d 100644
--- a/lld/COFF/Chunks.h
+++ b/lld/COFF/Chunks.h
@@ -386,51 +386,44 @@ class SectionChunk final : public Chunk {
inline size_t Chunk::getSize() const {
if (isa<SectionChunk>(this))
return static_cast<const SectionChunk *>(this)->getSize();
- else
- return static_cast<const NonSectionChunk *>(this)->getSize();
+ return static_cast<const NonSectionChunk *>(this)->getSize();
}
inline uint32_t Chunk::getOutputCharacteristics() const {
if (isa<SectionChunk>(this))
return static_cast<const SectionChunk *>(this)->getOutputCharacteristics();
- else
- return static_cast<const NonSectionChunk *>(this)
+ return static_cast<const NonSectionChunk *>(this)
->getOutputCharacteristics();
}
inline void Chunk::writeTo(uint8_t *buf) const {
if (isa<SectionChunk>(this))
static_cast<const SectionChunk *>(this)->writeTo(buf);
- else
- static_cast<const NonSectionChunk *>(this)->writeTo(buf);
+ static_cast<const NonSectionChunk *>(this)->writeTo(buf);
}
inline StringRef Chunk::getSectionName() const {
if (isa<SectionChunk>(this))
return static_cast<const SectionChunk *>(this)->getSectionName();
- else
- return static_cast<const NonSectionChunk *>(this)->getSectionName();
+ return static_cast<const NonSectionChunk *>(this)->getSectionName();
}
inline void Chunk::getBaserels(std::vector<Baserel> *res) {
if (isa<SectionChunk>(this))
static_cast<SectionChunk *>(this)->getBaserels(res);
- else
- static_cast<NonSectionChunk *>(this)->getBaserels(res);
+ static_cast<NonSectionChunk *>(this)->getBaserels(res);
}
inline StringRef Chunk::getDebugName() const {
if (isa<SectionChunk>(this))
return static_cast<const SectionChunk *>(this)->getDebugName();
- else
- return static_cast<const NonSectionChunk *>(this)->getDebugName();
+ return static_cast<const NonSectionChunk *>(this)->getDebugName();
}
inline MachineTypes Chunk::getMachine() const {
if (isa<SectionChunk>(this))
return static_cast<const SectionChunk *>(this)->getMachine();
- else
- return static_cast<const NonSectionChunk *>(this)->getMachine();
+ return static_cast<const NonSectionChunk *>(this)->getMachine();
}
inline chpe_range_type Chunk::getArm64ECRangeType() const {
More information about the llvm-commits
mailing list