[PATCH] D43574: [ELF] - Introduce getInputSections() helper.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 06:36:35 PST 2018


jhenderson added inline comments.


================
Comment at: lld/trunk/ELF/Writer.cpp:1395
     // section description, we remove it from the output.
-    bool IsEmpty = llvm::all_of(OS->SectionCommands, [](BaseCommand *B) {
-      if (auto *ISD = dyn_cast<InputSectionDescription>(B))
-        return ISD->Sections.empty();
-      return false;
-    });
-    if (IsEmpty)
+    if (getInputSections(OS).empty())
       OS->Live = false;
----------------
This isn't a direct equivalent of what was there before, as it only takes account of InputSectionDescription commands, and not other commands, such as BYTE() or symbol assignments. This has an effect on the layout, though I haven't conclusively determined what (it affects the "Rank" somehow). See PR36475.


Repository:
  rL LLVM

https://reviews.llvm.org/D43574





More information about the llvm-commits mailing list