forked from OSchip/llvm-project
[ELF] Simplify addFile. NFC
This commit is contained in:
parent
2d2737667e
commit
c171250e38
|
@ -239,8 +239,9 @@ void LinkerDriver::addFile(StringRef path, bool withLOption) {
|
||||||
readLinkerScript(mbref);
|
readLinkerScript(mbref);
|
||||||
return;
|
return;
|
||||||
case file_magic::archive: {
|
case file_magic::archive: {
|
||||||
|
auto members = getArchiveMembers(mbref);
|
||||||
if (inWholeArchive) {
|
if (inWholeArchive) {
|
||||||
for (const auto &p : getArchiveMembers(mbref)) {
|
for (const std::pair<MemoryBufferRef, uint64_t> &p : members) {
|
||||||
if (isBitcode(p.first))
|
if (isBitcode(p.first))
|
||||||
files.push_back(make<BitcodeFile>(p.first, path, p.second, false));
|
files.push_back(make<BitcodeFile>(p.first, path, p.second, false));
|
||||||
else
|
else
|
||||||
|
@ -249,7 +250,6 @@ void LinkerDriver::addFile(StringRef path, bool withLOption) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto members = getArchiveMembers(mbref);
|
|
||||||
archiveFiles.emplace_back(path, members.size());
|
archiveFiles.emplace_back(path, members.size());
|
||||||
|
|
||||||
// Handle archives and --start-lib/--end-lib using the same code path. This
|
// Handle archives and --start-lib/--end-lib using the same code path. This
|
||||||
|
|
Loading…
Reference in New Issue