Skip to content

Commit f4bc315

Browse files
[mlir] Fix warnings
This patch fixes: mlir/lib/Target/Wasm/TranslateFromWasm.cpp:82:1: error: unused variable 'wasmSectionName<(anonymous namespace)::WasmSectionType::DATACOUNT>' [-Werror,-Wunused-const-variable] mlir/lib/Target/Wasm/TranslateFromWasm.cpp:100:5: error: unused variable 'valueTypesEncodings' [-Werror,-Wunused-const-variable] mlir/lib/Target/Wasm/TranslateFromWasm.cpp:735:13: error: unused function 'buildLiteralType<unsigned int>' [-Werror,-Wunused-function] mlir/lib/Target/Wasm/TranslateFromWasm.cpp:740:13: error: unused function 'buildLiteralType<unsigned long>' [-Werror,-Wunused-function] mlir/lib/Target/Wasm/TranslateFromWasm.cpp:292:33: error: private field 'symbols' is not used [-Werror,-Wunused-private-field]
1 parent 17dd57b commit f4bc315

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mlir/lib/Target/Wasm/TranslateFromWasm.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ constexpr const char *wasmSectionName = "";
7878

7979
#define WASM_SEC_TRANSFORM(section) \
8080
template <> \
81-
constexpr const char *wasmSectionName<WasmSectionType::section> = #section;
81+
[[maybe_unused]] constexpr const char \
82+
*wasmSectionName<WasmSectionType::section> = #section;
8283
APPLY_WASM_SEC_TRANSFORM
8384
#undef WASM_SEC_TRANSFORM
8485

@@ -93,11 +94,10 @@ struct ByteSequence {};
9394
template <std::byte Byte>
9495
struct UniqueByte : ByteSequence<Byte> {};
9596

96-
constexpr ByteSequence<
97+
[[maybe_unused]] constexpr ByteSequence<
9798
WasmBinaryEncoding::Type::i32, WasmBinaryEncoding::Type::i64,
9899
WasmBinaryEncoding::Type::f32, WasmBinaryEncoding::Type::f64,
99-
WasmBinaryEncoding::Type::v128>
100-
valueTypesEncodings{};
100+
WasmBinaryEncoding::Type::v128> valueTypesEncodings{};
101101

102102
template <std::byte... allowedFlags>
103103
constexpr bool isValueOneOf(std::byte value,
@@ -289,7 +289,7 @@ class ExpressionParser {
289289
private:
290290
std::optional<Location> currentOpLoc;
291291
ParserHead &parser;
292-
WasmModuleSymbolTables const &symbols;
292+
[[maybe_unused]] WasmModuleSymbolTables const &symbols;
293293
locals_t locals;
294294
ValueStack valueStack;
295295
};
@@ -732,12 +732,12 @@ inline Type buildLiteralType<int64_t>(OpBuilder &builder) {
732732
}
733733

734734
template <>
735-
inline Type buildLiteralType<uint32_t>(OpBuilder &builder) {
735+
[[maybe_unused]] inline Type buildLiteralType<uint32_t>(OpBuilder &builder) {
736736
return builder.getI32Type();
737737
}
738738

739739
template <>
740-
inline Type buildLiteralType<uint64_t>(OpBuilder &builder) {
740+
[[maybe_unused]] inline Type buildLiteralType<uint64_t>(OpBuilder &builder) {
741741
return builder.getI64Type();
742742
}
743743

0 commit comments

Comments
 (0)