diff --git a/mlir/lib/Target/Wasm/TranslateFromWasm.cpp b/mlir/lib/Target/Wasm/TranslateFromWasm.cpp index b1c2121b54ebf..da811ba0954c2 100644 --- a/mlir/lib/Target/Wasm/TranslateFromWasm.cpp +++ b/mlir/lib/Target/Wasm/TranslateFromWasm.cpp @@ -78,7 +78,8 @@ constexpr const char *wasmSectionName = ""; #define WASM_SEC_TRANSFORM(section) \ template <> \ - constexpr const char *wasmSectionName = #section; + [[maybe_unused]] constexpr const char \ + *wasmSectionName = #section; APPLY_WASM_SEC_TRANSFORM #undef WASM_SEC_TRANSFORM @@ -93,11 +94,10 @@ struct ByteSequence {}; template struct UniqueByte : ByteSequence {}; -constexpr ByteSequence< +[[maybe_unused]] constexpr ByteSequence< WasmBinaryEncoding::Type::i32, WasmBinaryEncoding::Type::i64, WasmBinaryEncoding::Type::f32, WasmBinaryEncoding::Type::f64, - WasmBinaryEncoding::Type::v128> - valueTypesEncodings{}; + WasmBinaryEncoding::Type::v128> valueTypesEncodings{}; template constexpr bool isValueOneOf(std::byte value, @@ -289,7 +289,7 @@ class ExpressionParser { private: std::optional currentOpLoc; ParserHead &parser; - WasmModuleSymbolTables const &symbols; + [[maybe_unused]] WasmModuleSymbolTables const &symbols; locals_t locals; ValueStack valueStack; }; @@ -732,12 +732,12 @@ inline Type buildLiteralType(OpBuilder &builder) { } template <> -inline Type buildLiteralType(OpBuilder &builder) { +[[maybe_unused]] inline Type buildLiteralType(OpBuilder &builder) { return builder.getI32Type(); } template <> -inline Type buildLiteralType(OpBuilder &builder) { +[[maybe_unused]] inline Type buildLiteralType(OpBuilder &builder) { return builder.getI64Type(); }