[lld] [llvm] [Object][Wasm] Move WasmSymbolInfo directly into WasmSymbol (NFC) (PR #80219)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 31 15:59:42 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 1d1432356e656fcae7b2a3634a2b349334ba3d80 ee053958e59c6a60dd00887946dc0cf0a9d1f5de -- lld/wasm/InputFiles.cpp llvm/include/llvm/BinaryFormat/Wasm.h llvm/include/llvm/Object/Wasm.h llvm/lib/Object/WasmObjectFile.cpp llvm/tools/obj2yaml/wasm2yaml.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lld/wasm/InputFiles.cpp b/lld/wasm/InputFiles.cpp
index 394ca98d12..69d5e5af8d 100644
--- a/lld/wasm/InputFiles.cpp
+++ b/lld/wasm/InputFiles.cpp
@@ -334,8 +334,8 @@ void ObjFile::addLegacyIndirectFunctionTableIfNeeded(
<< "\n");
const WasmGlobalType *globalType = nullptr;
const WasmSignature *signature = nullptr;
- auto *wasmSym =
- make<WasmSymbol>(std::move(info), globalType, &tableImport->Table, signature);
+ auto *wasmSym = make<WasmSymbol>(std::move(info), globalType,
+ &tableImport->Table, signature);
Symbol *sym = createUndefined(*wasmSym, false);
// We're only sure it's a TableSymbol if the createUndefined succeeded.
if (errorCount())
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index 636ec484e2..90e29f191d 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -842,8 +842,7 @@ Error WasmObjectFile::parseLinkingSectionSymtab(ReadContext &Ctx) {
return make_error<GenericBinaryError>("duplicate symbol name " +
Twine(Info.Name),
object_error::parse_failed);
- Symbols.emplace_back(std::move(Info), GlobalType, TableType,
- Signature);
+ Symbols.emplace_back(std::move(Info), GlobalType, TableType, Signature);
LLVM_DEBUG(dbgs() << "Adding symbol: " << Symbols.back() << "\n");
}
@@ -1451,8 +1450,7 @@ Error WasmObjectFile::parseExportSection(ReadContext &Ctx) {
}
Exports.push_back(Ex);
if (Ex.Kind != wasm::WASM_EXTERNAL_MEMORY) {
- Symbols.emplace_back(std::move(Info), GlobalType,
- TableType, Signature);
+ Symbols.emplace_back(std::move(Info), GlobalType, TableType, Signature);
LLVM_DEBUG(dbgs() << "Adding symbol: " << Symbols.back() << "\n");
}
}
diff --git a/llvm/tools/obj2yaml/wasm2yaml.cpp b/llvm/tools/obj2yaml/wasm2yaml.cpp
index b2679fb288..ea3e95b4b6 100644
--- a/llvm/tools/obj2yaml/wasm2yaml.cpp
+++ b/llvm/tools/obj2yaml/wasm2yaml.cpp
@@ -125,7 +125,7 @@ WasmDumper::dumpCustomSection(const WasmSection &WasmSec) {
uint32_t SymbolIndex = 0;
for (const auto &Sym : Obj.symbols()) {
- const wasm::WasmSymbolInfo& Symbol = Obj.getWasmSymbol(Sym).Info;
+ const wasm::WasmSymbolInfo &Symbol = Obj.getWasmSymbol(Sym).Info;
WasmYAML::SymbolInfo Info;
Info.Index = SymbolIndex++;
Info.Kind = static_cast<uint32_t>(Symbol.Kind);
``````````
</details>
https://github.com/llvm/llvm-project/pull/80219
More information about the llvm-commits
mailing list