[lld] r328571 - Reduce code duplication a bit.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 26 11:55:33 PDT 2018


Author: rafael
Date: Mon Mar 26 11:55:33 2018
New Revision: 328571

URL: http://llvm.org/viewvc/llvm-project?rev=328571&view=rev
Log:
Reduce code duplication a bit.

Thanks to George Rimar for pointing it out.

Modified:
    lld/trunk/ELF/LinkerScript.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=328571&r1=328570&r2=328571&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Mon Mar 26 11:55:33 2018
@@ -386,9 +386,9 @@ LinkerScript::computeInputSections(const
       // which are common because they are in the default bfd script.
       // We do not ignore SHT_REL[A] linker-synthesized sections here because
       // want to support scripts that do custom layout for them.
-      if (!isa<SyntheticSection>(Sec) &&
-          (Sec->Type == SHT_REL || Sec->Type == SHT_RELA))
-        continue;
+      if (auto *IS = dyn_cast<InputSection>(Sec))
+        if (IS->getRelocatedSection())
+          continue;
 
       std::string Filename = getFilename(Sec->File);
       if (!Cmd->FilePat.match(Filename) ||




More information about the llvm-commits mailing list