diff --git a/lld/MachO/LTO.cpp b/lld/MachO/LTO.cpp --- a/lld/MachO/LTO.cpp +++ b/lld/MachO/LTO.cpp @@ -99,9 +99,8 @@ std::vector ret; for (unsigned i = 0; i != maxTasks; ++i) { - if (buf[i].empty()) { + if (buf[i].empty()) continue; - } SmallString<261> filePath("/tmp/lto.tmp"); uint32_t modTime = 0; if (!config->ltoObjPath.empty()) { diff --git a/lld/MachO/MergedOutputSection.cpp b/lld/MachO/MergedOutputSection.cpp --- a/lld/MachO/MergedOutputSection.cpp +++ b/lld/MachO/MergedOutputSection.cpp @@ -45,9 +45,8 @@ } void MergedOutputSection::writeTo(uint8_t *buf) const { - for (InputSection *isec : inputs) { + for (InputSection *isec : inputs) isec->writeTo(buf + isec->outSecFileOff); - } } // TODO: this is most likely wrong; reconsider how section flags diff --git a/lld/MachO/OutputSegment.cpp b/lld/MachO/OutputSegment.cpp --- a/lld/MachO/OutputSegment.cpp +++ b/lld/MachO/OutputSegment.cpp @@ -38,9 +38,8 @@ size_t OutputSegment::numNonHiddenSections() const { size_t count = 0; - for (const OutputSection *osec : sections) { + for (const OutputSection *osec : sections) count += (!osec->isHidden() ? 1 : 0); - } return count; } diff --git a/lld/MachO/SymbolTable.cpp b/lld/MachO/SymbolTable.cpp --- a/lld/MachO/SymbolTable.cpp +++ b/lld/MachO/SymbolTable.cpp @@ -54,11 +54,10 @@ defined->privateExtern &= isPrivateExtern; return defined; } - if (!defined->isWeakDef()) { + if (!defined->isWeakDef()) error("duplicate symbol: " + name + "\n>>> defined in " + toString(defined->getFile()) + "\n>>> defined in " + toString(file)); - } } else if (auto *dysym = dyn_cast(s)) { overridesWeakDef = !isWeakDef && dysym->isWeakDef(); }