summaryrefslogtreecommitdiff
path: root/src/tools/wasm-reduce.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/wasm-reduce.cpp')
-rw-r--r--src/tools/wasm-reduce.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index 3cfc0bb11..2276f66a4 100644
--- a/src/tools/wasm-reduce.cpp
+++ b/src/tools/wasm-reduce.cpp
@@ -752,20 +752,14 @@ struct Reducer
// TODO: bisection on segment shrinking?
- void visitMemory(Memory* curr) {
- std::cerr << "| try to simplify memory\n";
-
+ void visitDataSegment(DataSegment* curr) {
// try to reduce to first function. first, shrink segment elements.
// while we are shrinking successfully, keep going exponentially.
bool shrank = false;
- for (auto& segment : curr->segments) {
- shrank = shrinkByReduction(&segment, 2);
- }
+ shrank = shrinkByReduction(curr, 2);
// the "opposite" of shrinking: copy a 'zero' element
- for (auto& segment : curr->segments) {
- reduceByZeroing(
- &segment, 0, [](char item) { return item == 0; }, 2, shrank);
- }
+ reduceByZeroing(
+ curr, 0, [](char item) { return item == 0; }, 2, shrank);
}
template<typename T, typename U, typename C>