-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lld][NFC] Remove unnecessary else statements. #69451
Conversation
@llvm/pr-subscribers-lld-coff @llvm/pr-subscribers-lld Author: Jacek Caban (cjacek) ChangesFollow up addressing #69099 review comment. Full diff: https://github.com/llvm/llvm-project/pull/69451.diff 1 Files Affected:
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 {
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
Looks good, but it looks like check-lld failed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I pushed a fixup, sorry about that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Follow up addressing #69099 review comment.