mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 13:21:04 +08:00
[ELF] Refactor uses of getInputSections to improve efficiency NFC
Add new method getFirstInputSection and use instead of getInputSections where appropriate to avoid creation of an unneeded vector of input sections. Differential Revision: https://reviews.llvm.org/D73047
This commit is contained in:
@@ -953,7 +953,7 @@ void LinkerScript::adjustSectionsBeforeSorting() {
|
||||
|
||||
// We do not want to keep any special flags for output section
|
||||
// in case it is empty.
|
||||
bool isEmpty = getInputSections(sec).empty();
|
||||
bool isEmpty = (getFirstInputSection(sec) == nullptr);
|
||||
if (isEmpty)
|
||||
sec->flags = flags & ((sec->nonAlloc ? 0 : (uint64_t)SHF_ALLOC) |
|
||||
SHF_WRITE | SHF_EXECINSTR);
|
||||
|
||||
Reference in New Issue
Block a user