[llvm-branch-commits] [lld] [lld][MachO] Split ObjFile::parse() and parse extracted archive rounds in parallel (PR #240983)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Nov 10 12:06:08 PST 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- lld/MachO/InputFiles.cpp lld/MachO/InputFiles.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp
index 0b81cfd71..d631648d8 100644
--- a/lld/MachO/InputFiles.cpp
+++ b/lld/MachO/InputFiles.cpp
@@ -789,11 +789,11 @@ static macho::Symbol *createDefined(const NList &sym, StringRef name,
isWeakDefCanBeHidden = false;
else if (isWeakDefCanBeHidden)
isPrivateExtern = true;
- return symtab->addDefined(
- *hashedName, isec->getFile(), isec, value, size,
- sym.n_desc & N_WEAK_DEF, isPrivateExtern,
- sym.n_desc & REFERENCED_DYNAMICALLY, sym.n_desc & N_NO_DEAD_STRIP,
- isWeakDefCanBeHidden, isCold, known);
+ return symtab->addDefined(*hashedName, isec->getFile(), isec, value, size,
+ sym.n_desc & N_WEAK_DEF, isPrivateExtern,
+ sym.n_desc & REFERENCED_DYNAMICALLY,
+ sym.n_desc & N_NO_DEAD_STRIP,
+ isWeakDefCanBeHidden, isCold, known);
}
bool includeInSymtab = !isPrivateLabel(name) && !isEhFrameSection(isec);
auto *defined = makeThreadLocal<Defined>(
@@ -842,8 +842,7 @@ macho::Symbol *ObjFile::parseNonSectionSymbol(const NList &sym,
switch (type) {
case N_UNDF:
return sym.n_value == 0
- ? symtab->addUndefined(hashedName, this,
- sym.n_desc & N_WEAK_REF)
+ ? symtab->addUndefined(hashedName, this, sym.n_desc & N_WEAK_REF)
: symtab->addCommon(hashedName, this, sym.n_value,
1 << GET_COMM_ALIGN(sym.n_desc),
isPrivateExtern);
@@ -879,7 +878,8 @@ template <class NList> static bool isUndef(const NList &sym) {
return (sym.n_type & N_TYPE) == N_UNDF && sym.n_value == 0;
}
-template <class NList> static bool nonSectionSymbolNeedsSymtab(const NList &sym) {
+template <class NList>
+static bool nonSectionSymbolNeedsSymtab(const NList &sym) {
uint8_t type = sym.n_type & N_TYPE;
return type != N_INDR && (type != N_ABS || (sym.n_type & N_EXT));
}
@@ -1051,7 +1051,6 @@ void ObjFile::parseSymbolsPrepare(ArrayRef<typename LP::section> sectionHeaders,
subsections.push_back({sym.n_value - sectionAddr, nextIsec});
}
}
-
}
// The half that adds this file's symbols to the symbol table. Everything
``````````
</details>
https://github.com/llvm/llvm-project/pull/240983
More information about the llvm-branch-commits
mailing list