address feedback
diff --git a/src/tools/fuzzing/fuzz-stats.cpp b/src/tools/fuzzing/fuzz-stats.cpp index f03aa01..b024aa8 100644 --- a/src/tools/fuzzing/fuzz-stats.cpp +++ b/src/tools/fuzzing/fuzz-stats.cpp
@@ -1,5 +1,5 @@ /* - * Copyright 2024 WebAssembly Community Group participants + * Copyright 2026 WebAssembly Community Group participants * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
diff --git a/src/tools/fuzzing/fuzz-stats.h b/src/tools/fuzzing/fuzz-stats.h index 5d25137..c3de610 100644 --- a/src/tools/fuzzing/fuzz-stats.h +++ b/src/tools/fuzzing/fuzz-stats.h
@@ -1,5 +1,5 @@ /* - * Copyright 2024 WebAssembly Community Group participants + * Copyright 2026 WebAssembly Community Group participants * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,8 @@ const std::map<std::string, uint64_t>& funcMatches); // CRTP base class for visitors that collect fuzzing pattern statistics. -template<typename SubType> struct Visitor : public PostWalker<SubType> { +template<typename SubType> +struct PatternCollectorBase : public PostWalker<SubType> { // Counts within the current function: pattern name -> count std::map<std::string, uint64_t> currentFuncCounts;
diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp index 3338fab..d906b70 100644 --- a/src/tools/fuzzing/fuzzing.cpp +++ b/src/tools/fuzzing/fuzzing.cpp
@@ -37,7 +37,11 @@ namespace { -struct FuzzStatsVisitor : public FuzzStats::Visitor<FuzzStatsVisitor> { +struct FuzzStatsCollector + : public FuzzStats::PatternCollectorBase<FuzzStatsCollector> { + // Collect the occurrences of various cast instructions. Casts are + // particularly important for fuzzing. Meant as a sample for running + // experiments collecting other interesting patterns. void visitBrOn(BrOn* curr) { switch (curr->op) { case BrOnNull: @@ -456,7 +460,7 @@ mutateJSBoundary(); } - FuzzStatsVisitor().collect(wasm); + FuzzStatsCollector().collect(wasm); } void TranslateToFuzzReader::setupMemory() {