[llvm] [llvm-nm][WebAssembly] Print function symbol sizes (PR #81315)

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 13:26:31 PST 2024


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 647010a06f3af725a2e674f025bc0e04aa1fbbff b444331a3a64520344d92ee4903c5829f1467ea5 -- llvm/include/llvm/Object/Wasm.h llvm/lib/Object/WasmObjectFile.cpp llvm/tools/llvm-nm/llvm-nm.cpp llvm/tools/llvm-objdump/llvm-objdump.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index 2c0c25875f..04e2b809c0 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -1934,7 +1934,7 @@ uint32_t WasmObjectFile::getSymbolSectionIdImpl(const WasmSymbol &Sym) const {
 
 uint32_t WasmObjectFile::getSymbolSize(SymbolRef Symb) const {
   const WasmSymbol &Sym = getWasmSymbol(Symb);
-  if(!Sym.isDefined())
+  if (!Sym.isDefined())
     return 0;
   if (Sym.isTypeData())
     return Sym.Info.DataRef.Size;
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index cc1faab3ce..0e4f4e1bf6 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -2948,7 +2948,8 @@ void Dumper::printSymbol(const SymbolRef &Symbol,
   else if (O.isELF())
     outs() << '\t' << format(Fmt, ELFSymbolRef(Symbol).getSize());
   else if (O.isWasm())
-    outs() << '\t' << format(Fmt, cast<WasmObjectFile>(O).getSymbolSize(Symbol));
+    outs() << '\t'
+           << format(Fmt, cast<WasmObjectFile>(O).getSymbolSize(Symbol));
 
   if (O.isELF()) {
     if (!SymbolVersions.empty()) {

``````````

</details>


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


More information about the llvm-commits mailing list