[ELF] - Simplify #2. NFC.

llvm-svn: 312789
This commit is contained in:
George Rimar 2017-09-08 13:40:07 +00:00
parent cbea95dd95
commit 9a2da39837
1 changed files with 3 additions and 8 deletions

View File

@ -1216,14 +1216,9 @@ static void removeUnusedSyntheticSections() {
// If there are no other sections in the output section, remove it from the
// output.
if (OS->Commands.empty()) {
// Also remove script commands matching the output section.
llvm::erase_if(Script->Opt.Commands, [&](BaseCommand *Cmd) {
if (auto *Sec = dyn_cast<OutputSection>(Cmd))
return Sec == OS;
return false;
});
}
if (OS->Commands.empty())
llvm::erase_if(Script->Opt.Commands,
[&](BaseCommand *Cmd) { return Cmd == OS; });
}
}