diff options
author | Sam Clegg <sbc@chromium.org> | 2022-12-01 17:27:59 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-02 01:27:59 +0000 |
commit | 197b6da7afe6ec317011800abf9453402e6beaa5 (patch) | |
tree | 564ae447dc2af116be8948703da85e8d9198f7c4 /src/tools | |
parent | f70bc4d6634c5a0b1aa88f3c073b783e83bb5712 (diff) | |
download | binaryen-197b6da7afe6ec317011800abf9453402e6beaa5.tar.gz binaryen-197b6da7afe6ec317011800abf9453402e6beaa5.tar.bz2 binaryen-197b6da7afe6ec317011800abf9453402e6beaa5.zip |
Use C++17's [[maybe_unused]]. NFC (#5309)
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/wasm-reduce.cpp | 1 | ||||
-rw-r--r-- | src/tools/wasm-shell.cpp | 6 | ||||
-rw-r--r-- | src/tools/wasm2c-wrapper.h | 3 |
3 files changed, 3 insertions, 7 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp index d92e0a93c..078eca648 100644 --- a/src/tools/wasm-reduce.cpp +++ b/src/tools/wasm-reduce.cpp @@ -935,7 +935,6 @@ struct Reducer // process things here, we may replace the module, so we should never again // refer to curr. assert(curr == module.get()); - WASM_UNUSED(curr); curr = nullptr; // Reduction of entire functions at a time is very effective, and we do it diff --git a/src/tools/wasm-shell.cpp b/src/tools/wasm-shell.cpp index 61b35e6db..70f52a038 100644 --- a/src/tools/wasm-shell.cpp +++ b/src/tools/wasm-shell.cpp @@ -193,7 +193,7 @@ protected: } void parseAssertTrap(Element& s) { - bool trapped = false; + [[maybe_unused]] bool trapped = false; auto& inner = *s[1]; if (inner[0]->str() == MODULE) { return parseModuleAssertion(s); @@ -207,7 +207,6 @@ protected: std::cout << "[exception thrown: " << e << "]" << std::endl; trapped = true; } - WASM_UNUSED(trapped); assert(trapped); } @@ -218,7 +217,7 @@ protected: expected = getLiteralsFromConstExpression( builders[lastModule]->parseExpression(*s[2])); } - bool trapped = false; + [[maybe_unused]] bool trapped = false; try { actual = parseOperation(*s[1]); } catch (const TrapException&) { @@ -227,7 +226,6 @@ protected: std::cout << "[exception thrown: " << e << "]" << std::endl; trapped = true; } - WASM_UNUSED(trapped); assert(!trapped); std::cerr << "seen " << actual << ", expected " << expected << '\n'; if (expected != actual) { diff --git a/src/tools/wasm2c-wrapper.h b/src/tools/wasm2c-wrapper.h index f44fc5ca0..984a9b53a 100644 --- a/src/tools/wasm2c-wrapper.h +++ b/src/tools/wasm2c-wrapper.h @@ -203,8 +203,7 @@ int main(int argc, char** argv) { // Emit the parameters (all 0s, like the other wrappers). bool first = true; - for (const auto& param : func->getParams()) { - WASM_UNUSED(param); + for ([[maybe_unused]] const auto& param : func->getParams()) { if (!first) { ret += ", "; } |