[lld] e24ac11 - [lld][NFC] Remove unnecessary else statements. (#69451)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 20 03:38:16 PDT 2023
Author: Jacek Caban
Date: 2023-10-20T12:38:12+02:00
New Revision: e24ac11fa76abc5916e00ebca3d06eb816d02243
URL: https://github.com/llvm/llvm-project/commit/e24ac11fa76abc5916e00ebca3d06eb816d02243
DIFF: https://github.com/llvm/llvm-project/commit/e24ac11fa76abc5916e00ebca3d06eb816d02243.diff
LOG: [lld][NFC] Remove unnecessary else statements. (#69451)
Added:
Modified:
lld/COFF/Chunks.h
Removed:
################################################################################
diff --git a/lld/COFF/Chunks.h b/lld/COFF/Chunks.h
index 4e500cafd3ce4a2..cbfeb5c025adbb2 100644
--- a/lld/COFF/Chunks.h
+++ b/lld/COFF/Chunks.h
@@ -386,16 +386,13 @@ 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)
- ->getOutputCharacteristics();
+ return static_cast<const NonSectionChunk *>(this)->getOutputCharacteristics();
}
inline void Chunk::writeTo(uint8_t *buf) const {
@@ -408,8 +405,7 @@ inline void Chunk::writeTo(uint8_t *buf) const {
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) {
@@ -422,15 +418,13 @@ inline void Chunk::getBaserels(std::vector<Baserel> *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