[PATCH] D118530: [ELF] Update flag propagation rule to ignore discarded output sections
Andrew Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 31 08:03:16 PST 2022
andrewng added inline comments.
================
Comment at: lld/ELF/LinkerScript.cpp:1152
+ bool isEmpty = (getFirstInputSection(sec) == nullptr);
+ bool discardable = isEmpty && isDiscardable(*sec);
+ // If sec has at least an input section and not discarded, remember its
----------------
I believe that all uses of `isDiscardable()` are now combined with `getFirstInputSection() == nullptr`, so perhaps `getFirstInputSection() == nullptr` should be part of `isDiscardable()`? Although that doesn't really "help" here as you need `isEmpty`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118530/new/
https://reviews.llvm.org/D118530
More information about the llvm-commits
mailing list