diff --git a/lld/MachO/LTO.cpp b/lld/MachO/LTO.cpp index 0cf5328e2d6c1..38d4e55cfcaf9 100644 --- a/lld/MachO/LTO.cpp +++ b/lld/MachO/LTO.cpp @@ -99,9 +99,8 @@ std::vector BitcodeCompiler::compile() { 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 index 15e957250dd0e..9a74925ce9670 100644 --- a/lld/MachO/MergedOutputSection.cpp +++ b/lld/MachO/MergedOutputSection.cpp @@ -45,9 +45,8 @@ void MergedOutputSection::finalize() { } 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 index 1ea5d49a32a12..edfc474d3df2b 100644 --- a/lld/MachO/OutputSegment.cpp +++ b/lld/MachO/OutputSegment.cpp @@ -38,9 +38,8 @@ static uint32_t maxProt(StringRef name) { 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 index 43e324ab5f47d..1d812538005dd 100644 --- a/lld/MachO/SymbolTable.cpp +++ b/lld/MachO/SymbolTable.cpp @@ -54,11 +54,10 @@ Defined *SymbolTable::addDefined(StringRef name, InputFile *file, 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(); }