diff options
Diffstat (limited to 'src/ir')
-rw-r--r-- | src/ir/ExpressionAnalyzer.cpp | 10 | ||||
-rw-r--r-- | src/ir/ExpressionManipulator.cpp | 6 | ||||
-rw-r--r-- | src/ir/branch-utils.h | 8 | ||||
-rw-r--r-- | src/ir/iteration.h | 4 | ||||
-rw-r--r-- | src/ir/memory-utils.h | 3 | ||||
-rw-r--r-- | src/ir/possible-contents.cpp | 9 | ||||
-rw-r--r-- | src/ir/properties.h | 4 | ||||
-rw-r--r-- | src/ir/type-updating.cpp | 4 |
8 files changed, 14 insertions, 34 deletions
diff --git a/src/ir/ExpressionAnalyzer.cpp b/src/ir/ExpressionAnalyzer.cpp index 924040e12..62ad3ed3e 100644 --- a/src/ir/ExpressionAnalyzer.cpp +++ b/src/ir/ExpressionAnalyzer.cpp @@ -163,10 +163,8 @@ bool ExpressionAnalyzer::flexibleEqual(Expression* left, // Create cast versions of it for later operations. #define DELEGATE_START(id) \ - auto* castLeft = left->cast<id>(); \ - WASM_UNUSED(castLeft); \ - auto* castRight = right->cast<id>(); \ - WASM_UNUSED(castRight); + [[maybe_unused]] auto* castLeft = left->cast<id>(); \ + [[maybe_unused]] auto* castRight = right->cast<id>(); // Handle each type of field, comparing it appropriately. #define DELEGATE_FIELD_CHILD(id, field) \ @@ -304,9 +302,7 @@ struct Hasher { #define DELEGATE_ID curr->_id // Create cast versions of it for later operations. -#define DELEGATE_START(id) \ - auto* cast = curr->cast<id>(); \ - WASM_UNUSED(cast); +#define DELEGATE_START(id) [[maybe_unused]] auto* cast = curr->cast<id>(); // Handle each type of field, comparing it appropriately. #define DELEGATE_GET_FIELD(id, field) cast->field diff --git a/src/ir/ExpressionManipulator.cpp b/src/ir/ExpressionManipulator.cpp index 20856808e..9232dddf2 100644 --- a/src/ir/ExpressionManipulator.cpp +++ b/src/ir/ExpressionManipulator.cpp @@ -55,10 +55,8 @@ flexibleCopy(Expression* original, Module& wasm, CustomCopier custom) { // for later operations. #define DELEGATE_START(id) \ copy = wasm.allocator.alloc<id>(); \ - auto* castOriginal = original->cast<id>(); \ - WASM_UNUSED(castOriginal); \ - auto* castCopy = copy->cast<id>(); \ - WASM_UNUSED(castCopy); + [[maybe_unused]] auto* castOriginal = original->cast<id>(); \ + [[maybe_unused]] auto* castCopy = copy->cast<id>(); // Handle each type of field, copying it appropriately. #define DELEGATE_FIELD_CHILD(id, field) \ diff --git a/src/ir/branch-utils.h b/src/ir/branch-utils.h index 82a563498..d433a421e 100644 --- a/src/ir/branch-utils.h +++ b/src/ir/branch-utils.h @@ -44,9 +44,7 @@ inline bool isBranchReachable(Expression* expr) { template<typename T> void operateOnScopeNameUses(Expression* expr, T func) { #define DELEGATE_ID expr->_id -#define DELEGATE_START(id) \ - auto* cast = expr->cast<id>(); \ - WASM_UNUSED(cast); +#define DELEGATE_START(id) [[maybe_unused]] auto* cast = expr->cast<id>(); #define DELEGATE_GET_FIELD(id, field) cast->field @@ -110,9 +108,7 @@ void operateOnScopeNameUsesAndSentValues(Expression* expr, T func) { template<typename T> void operateOnScopeNameDefs(Expression* expr, T func) { #define DELEGATE_ID expr->_id -#define DELEGATE_START(id) \ - auto* cast = expr->cast<id>(); \ - WASM_UNUSED(cast); +#define DELEGATE_START(id) [[maybe_unused]] auto* cast = expr->cast<id>(); #define DELEGATE_FIELD_SCOPE_NAME_DEF(id, field) func(cast->field) diff --git a/src/ir/iteration.h b/src/ir/iteration.h index a2c9ceef6..8da03a555 100644 --- a/src/ir/iteration.h +++ b/src/ir/iteration.h @@ -84,9 +84,7 @@ public: #define DELEGATE_ID parent->_id -#define DELEGATE_START(id) \ - auto* cast = parent->cast<id>(); \ - WASM_UNUSED(cast); +#define DELEGATE_START(id) [[maybe_unused]] auto* cast = parent->cast<id>(); #define DELEGATE_GET_FIELD(id, field) cast->field diff --git a/src/ir/memory-utils.h b/src/ir/memory-utils.h index 9bdd00258..f31c55a7d 100644 --- a/src/ir/memory-utils.h +++ b/src/ir/memory-utils.h @@ -92,8 +92,7 @@ inline bool ensureLimitedSegments(Module& module) { // we'll merge constant segments if we must if (numConstant + numDynamic >= WebLimitations::MaxDataSegments) { numConstant = WebLimitations::MaxDataSegments - numDynamic - 1; - auto num = numConstant + numDynamic; - WASM_UNUSED(num); + [[maybe_unused]] auto num = numConstant + numDynamic; assert(num == WebLimitations::MaxDataSegments - 1); } diff --git a/src/ir/possible-contents.cpp b/src/ir/possible-contents.cpp index 7ed6bfde6..52b05057f 100644 --- a/src/ir/possible-contents.cpp +++ b/src/ir/possible-contents.cpp @@ -1765,8 +1765,7 @@ void Flower::flowAfterUpdate(LocationIndex locationIndex) { // This is indeed one of the special cases where it is the child of a // parent, and we need to do some special handling because of that child- // parent connection. - auto* child = exprLoc->expr; - WASM_UNUSED(child); + [[maybe_unused]] auto* child = exprLoc->expr; auto parentIndex = iter->second; auto* parent = std::get<ExpressionLocation>(getLocation(parentIndex)).expr; @@ -2107,11 +2106,9 @@ void Flower::dump(Location location) { } else if (auto* loc = std::get_if<BreakTargetLocation>(&location)) { std::cout << " branchloc " << loc->func->name << " : " << loc->target << " tupleIndex " << loc->tupleIndex << '\n'; - } else if (auto* loc = std::get_if<SignatureParamLocation>(&location)) { - WASM_UNUSED(loc); + } else if (std::get_if<SignatureParamLocation>(&location)) { std::cout << " sigparamloc " << '\n'; - } else if (auto* loc = std::get_if<SignatureResultLocation>(&location)) { - WASM_UNUSED(loc); + } else if (std::get_if<SignatureResultLocation>(&location)) { std::cout << " sigresultloc " << '\n'; } else if (auto* loc = std::get_if<NullLocation>(&location)) { std::cout << " Nullloc " << loc->type << '\n'; diff --git a/src/ir/properties.h b/src/ir/properties.h index bd0487d8f..2214eecaf 100644 --- a/src/ir/properties.h +++ b/src/ir/properties.h @@ -339,9 +339,7 @@ inline Index getNumChildren(Expression* curr) { #define DELEGATE_ID curr->_id -#define DELEGATE_START(id) \ - auto* cast = curr->cast<id>(); \ - WASM_UNUSED(cast); +#define DELEGATE_START(id) [[maybe_unused]] auto* cast = curr->cast<id>(); #define DELEGATE_GET_FIELD(id, field) cast->field diff --git a/src/ir/type-updating.cpp b/src/ir/type-updating.cpp index 3eb29e43c..47931baad 100644 --- a/src/ir/type-updating.cpp +++ b/src/ir/type-updating.cpp @@ -186,9 +186,7 @@ void GlobalTypeRewriter::mapTypes(const TypeMap& oldToNewTypes) { #define DELEGATE_ID curr->_id -#define DELEGATE_START(id) \ - auto* cast = curr->cast<id>(); \ - WASM_UNUSED(cast); +#define DELEGATE_START(id) [[maybe_unused]] auto* cast = curr->cast<id>(); #define DELEGATE_GET_FIELD(id, field) cast->field |