[llvm] [lld] Dylink symbols lld (PR #75242)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 12:33:03 PST 2023


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 31cf6df06febdf2483d224d2c9657497cac7d41f 77e038cf19be9584b8e3aa17997ce14dbb96adba -- lld/wasm/Driver.cpp lld/wasm/InputFiles.cpp lld/wasm/InputFiles.h lld/wasm/MarkLive.cpp lld/wasm/Relocations.cpp lld/wasm/SymbolTable.cpp lld/wasm/SymbolTable.h lld/wasm/Symbols.cpp lld/wasm/Symbols.h lld/wasm/SyntheticSections.cpp lld/wasm/Writer.cpp llvm/include/llvm/Object/Wasm.h llvm/lib/Object/WasmObjectFile.cpp
``````````

</details>

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

``````````diff
diff --git a/lld/wasm/Relocations.cpp b/lld/wasm/Relocations.cpp
index d8a99b18f2..460feecc97 100644
--- a/lld/wasm/Relocations.cpp
+++ b/lld/wasm/Relocations.cpp
@@ -158,15 +158,13 @@ void scanRelocations(InputChunk *chunk) {
       case R_WASM_MEMORY_ADDR_LEB64:
         // Certain relocation types can't be used when building PIC output,
         // since they would require absolute symbol addresses at link time.
-        error(toString(file) + ": relocation " +
-              relocTypeToString(reloc.Type) +
+        error(toString(file) + ": relocation " + relocTypeToString(reloc.Type) +
               " cannot be used against symbol `" + toString(*sym) +
               "`; recompile with -fPIC");
         break;
       }
     }
 
-
     if (importSymbol) {
       switch (reloc.Type) {
       case R_WASM_TABLE_INDEX_I32:
diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp
index d3c45691fa..7fef757c1b 100644
--- a/lld/wasm/SymbolTable.cpp
+++ b/lld/wasm/SymbolTable.cpp
@@ -322,8 +322,8 @@ static bool shouldReplace(const Symbol *existing, InputFile *newFile,
 Symbol *SymbolTable::addSharedFunction(StringRef name, uint32_t flags,
                                        InputFile *file,
                                        const WasmSignature *sig) {
-  LLVM_DEBUG(dbgs() << "addSharedFunction: " << name << " ["
-                    << toString(*sig) << "]\n");
+  LLVM_DEBUG(dbgs() << "addSharedFunction: " << name << " [" << toString(*sig)
+                    << "]\n");
   Symbol *s;
   bool wasInserted;
   std::tie(s, wasInserted) = insert(name, file);
@@ -356,7 +356,7 @@ Symbol *SymbolTable::addSharedFunction(StringRef name, uint32_t flags,
     checkSig = ud->isCalledDirectly;
 
   if (checkSig && !signatureMatches(existingFunction, sig)) {
-    Symbol* variant;
+    Symbol *variant;
     if (getFunctionVariant(s, sig, file, &variant))
       // New variant, always replace
       replaceSym(variant);
@@ -375,7 +375,7 @@ Symbol *SymbolTable::addSharedFunction(StringRef name, uint32_t flags,
 }
 
 Symbol *SymbolTable::addSharedData(StringRef name, uint32_t flags,
-                                       InputFile *file) {
+                                   InputFile *file) {
   LLVM_DEBUG(dbgs() << "addSharedData: " << name << "\n");
   Symbol *s;
   bool wasInserted;

``````````

</details>


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


More information about the llvm-commits mailing list