[lld] c171250 - [ELF] Simplify addFile. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 2 19:49:25 PDT 2022
Author: Fangrui Song
Date: 2022-10-02T19:49:17-07:00
New Revision: c171250e3802e52dba4bc3f5c1cb15a1ce29aeac
URL: https://github.com/llvm/llvm-project/commit/c171250e3802e52dba4bc3f5c1cb15a1ce29aeac
DIFF: https://github.com/llvm/llvm-project/commit/c171250e3802e52dba4bc3f5c1cb15a1ce29aeac.diff
LOG: [ELF] Simplify addFile. NFC
Added:
Modified:
lld/ELF/Driver.cpp
Removed:
################################################################################
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 7a4853616cb7..2e71282f0f15 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -239,8 +239,9 @@ void LinkerDriver::addFile(StringRef path, bool withLOption) {
readLinkerScript(mbref);
return;
case file_magic::archive: {
+ auto members = getArchiveMembers(mbref);
if (inWholeArchive) {
- for (const auto &p : getArchiveMembers(mbref)) {
+ for (const std::pair<MemoryBufferRef, uint64_t> &p : members) {
if (isBitcode(p.first))
files.push_back(make<BitcodeFile>(p.first, path, p.second, false));
else
@@ -249,7 +250,6 @@ void LinkerDriver::addFile(StringRef path, bool withLOption) {
return;
}
- auto members = getArchiveMembers(mbref);
archiveFiles.emplace_back(path, members.size());
// Handle archives and --start-lib/--end-lib using the same code path. This
More information about the llvm-commits
mailing list