[ELF] Refactor uses of getInputSections to improve efficiency NFC
authorAndrew Ng <andrew.ng@sony.com>
Thu, 16 Jan 2020 13:23:08 +0000 (13:23 +0000)
committerAndrew Ng <andrew.ng@sony.com>
Tue, 21 Jan 2020 12:27:52 +0000 (12:27 +0000)
commit4e8116f4692e9b5787ba91c6b557b113aae7e244
treea29549508832b16eb947093b396ca582175b5673
parentbc29069dc401572ba62f7dd692a3474c1ead76c9
[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
lld/ELF/LinkerScript.cpp
lld/ELF/OutputSections.cpp
lld/ELF/OutputSections.h