[lld] r335460 - [ELF] - ICF: Remove dead code. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 25 05:51:56 PDT 2018


Author: grimar
Date: Mon Jun 25 05:51:55 2018
New Revision: 335460

URL: http://llvm.org/viewvc/llvm-project?rev=335460&view=rev
Log:
[ELF] - ICF: Remove dead code. NFC.

Code is dead. We use only InputSections when building the list of
sections elegible for the ICF:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L439
And 'isEligible' filters out SyntheticSections as well for us. 

That way the only Kind we have in the Sections vector is SectionBase::Regular,
so we do not need to check sections kind at all, it is always the same.

Modified:
    lld/trunk/ELF/ICF.cpp

Modified: lld/trunk/ELF/ICF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ICF.cpp?rev=335460&r1=335459&r2=335460&view=diff
==============================================================================
--- lld/trunk/ELF/ICF.cpp (original)
+++ lld/trunk/ELF/ICF.cpp Mon Jun 25 05:51:55 2018
@@ -267,9 +267,6 @@ bool ICF<ELFT>::constantEq(const InputSe
     if (!DA->Section || !DB->Section)
       return false;
 
-    if (DA->Section->kind() != DB->Section->kind())
-      return false;
-
     // Relocations referring to InputSections are constant-equal if their
     // section offsets are equal.
     if (isa<InputSection>(DA->Section)) {




More information about the llvm-commits mailing list