[lld] 8d4b11b - [ELF] Remove redundant isa<InputSection>(sec). NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 00:30:58 PDT 2022


Author: Fangrui Song
Date: 2022-07-29T00:30:52-07:00
New Revision: 8d4b11b4f11bada84517a2a1bc07775d9d179c40

URL: https://github.com/llvm/llvm-project/commit/8d4b11b4f11bada84517a2a1bc07775d9d179c40
DIFF: https://github.com/llvm/llvm-project/commit/8d4b11b4f11bada84517a2a1bc07775d9d179c40.diff

LOG: [ELF] Remove redundant isa<InputSection>(sec). NFC

combineEhSections has been called to remove EhInputSection.

Added: 
    

Modified: 
    lld/ELF/Writer.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index c9345d812270..c14cad34450d 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1932,7 +1932,7 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
       // copy relocations, etc. Note that relocations for non-alloc sections are
       // directly processed by InputSection::relocateNonAlloc.
       for (InputSectionBase *sec : inputSections)
-        if (sec->isLive() && isa<InputSection>(sec) && (sec->flags & SHF_ALLOC))
+        if (sec->isLive() && (sec->flags & SHF_ALLOC))
           scanRelocations<ELFT>(*sec);
       for (Partition &part : partitions) {
         for (EhInputSection *sec : part.ehFrame->sections)


        


More information about the llvm-commits mailing list