[lld] [lld-macho] Implement symbol string deduplication (PR #123874)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 09:33:11 PST 2025


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 4564ac91e181da116bd6850e623821c7a2a4e8f4 d09f3d73de7bfef2453d1c726109564f4fba4719 --extensions cpp,h -- lld/MachO/Config.h lld/MachO/Driver.cpp lld/MachO/SyntheticSections.cpp lld/MachO/SyntheticSections.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp
index 9ad3136372..c1864f4815 100644
--- a/lld/MachO/SyntheticSections.cpp
+++ b/lld/MachO/SyntheticSections.cpp
@@ -791,7 +791,7 @@ void StubHelperSection::writeTo(uint8_t *buf) const {
 
 void StubHelperSection::setUp() {
   Symbol *binder = symtab->addUndefined("dyld_stub_binder", /*file=*/nullptr,
-                                       /*isWeakRef=*/false);
+                                        /*isWeakRef=*/false);
   if (auto *undefined = dyn_cast<Undefined>(binder))
     treatUndefinedSymbol(*undefined,
                          "lazy binding (normally in libSystem.dylib)");
@@ -1182,7 +1182,7 @@ void SymtabSection::emitObjectFileStab(ObjFile *file) {
   StabsEntry stab(N_OSO);
   stab.sect = target->cpuSubtype;
   SmallString<261> path(!file->archiveName.empty() ? file->archiveName
-                                                  : file->getName());
+                                                   : file->getName());
   std::error_code ec = sys::fs::make_absolute(path);
   if (ec)
     fatal("failed to get absolute path for " + path);
@@ -1548,7 +1548,7 @@ uint32_t StringTableSection::addString(StringRef str) {
     if (!inserted)
       return it->second;
   }
-  
+
   strings.push_back(str);
   size += str.size() + 1; // +1 for null terminator
   return strx;

``````````

</details>


https://github.com/llvm/llvm-project/pull/123874


More information about the llvm-commits mailing list