[lld] [llvm] [WebAssembly] Use ValType instead of integer types to model wasm tables (PR #78012)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 17:54:00 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 3edf82d5566ed5c9898f52b5591c05f6366d6bac 5b12f342d1439877a025172d49110adc2abcfa42 -- lld/wasm/InputFiles.cpp lld/wasm/SymbolTable.cpp llvm/include/llvm/BinaryFormat/Wasm.h llvm/include/llvm/BinaryFormat/WasmTraits.h llvm/include/llvm/MC/MCSymbolWasm.h llvm/lib/MC/WasmObjectWriter.cpp llvm/lib/Object/WasmObjectFile.cpp llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp llvm/lib/Target/WebAssembly/WebAssemblyUtilities.cpp llvm/tools/obj2yaml/wasm2yaml.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/include/llvm/BinaryFormat/Wasm.h b/llvm/include/llvm/BinaryFormat/Wasm.h
index 9921af5e52..c6f8375313 100644
--- a/llvm/include/llvm/BinaryFormat/Wasm.h
+++ b/llvm/include/llvm/BinaryFormat/Wasm.h
@@ -95,7 +95,6 @@ enum : unsigned {
   WASM_OPCODE_REF_NULL = 0xd0,
 };
 
-
 // Opcodes used in synthetic functions.
 enum : unsigned {
   WASM_OPCODE_BLOCK = 0x02,
@@ -276,7 +275,6 @@ struct WasmLimits {
   uint64_t Maximum;
 };
 
-
 struct WasmTableType {
   ValType ElemType;
   WasmLimits Limits;
diff --git a/llvm/include/llvm/BinaryFormat/WasmTraits.h b/llvm/include/llvm/BinaryFormat/WasmTraits.h
index a279ce37a7..8167dab01c 100644
--- a/llvm/include/llvm/BinaryFormat/WasmTraits.h
+++ b/llvm/include/llvm/BinaryFormat/WasmTraits.h
@@ -91,7 +91,8 @@ template <> struct DenseMapInfo<wasm::WasmTableType, void> {
   }
   static wasm::WasmTableType getTombstoneKey() {
     return wasm::WasmTableType{
-        wasm::ValType(1), DenseMapInfo<wasm::WasmLimits, void>::getTombstoneKey()};
+        wasm::ValType(1),
+        DenseMapInfo<wasm::WasmLimits, void>::getTombstoneKey()};
   }
   static unsigned getHashValue(const wasm::WasmTableType &TableType) {
     return hash_combine(

``````````

</details>


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


More information about the llvm-commits mailing list