diff --git a/fuzzers/tint_ast_fuzzer/fuzzer.cc b/fuzzers/tint_ast_fuzzer/fuzzer.cc index ca60cf8a04..b6b238f6f6 100644 --- a/fuzzers/tint_ast_fuzzer/fuzzer.cc +++ b/fuzzers/tint_ast_fuzzer/fuzzer.cc @@ -20,6 +20,7 @@ #include "fuzzers/tint_ast_fuzzer/mutator.h" #include "fuzzers/tint_ast_fuzzer/override_cli_params.h" #include "fuzzers/tint_common_fuzzer.h" +#include "fuzzers/transform_builder.h" #include "src/reader/wgsl/parser.h" #include "src/writer/wgsl/generator.h" @@ -109,13 +110,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { continue; } - transform::Manager transform_manager; - transform::DataMap transform_inputs; - transform_manager.Add(); + TransformBuilder tb(data, size); + tb.AddTransform(); CommonFuzzer fuzzer(InputFormat::kWGSL, target.output_format); fuzzer.EnableInspector(); - fuzzer.SetTransformManager(&transform_manager, &transform_inputs); + fuzzer.SetTransformManager(tb.manager(), tb.data_map()); fuzzer.Run(data, size); if (fuzzer.HasErrors()) { diff --git a/fuzzers/tint_regex_fuzzer/fuzzer.cc b/fuzzers/tint_regex_fuzzer/fuzzer.cc index 1de67c7524..0a557501d4 100644 --- a/fuzzers/tint_regex_fuzzer/fuzzer.cc +++ b/fuzzers/tint_regex_fuzzer/fuzzer.cc @@ -21,6 +21,7 @@ #include "fuzzers/tint_regex_fuzzer/cli.h" #include "fuzzers/tint_regex_fuzzer/override_cli_params.h" #include "fuzzers/tint_regex_fuzzer/wgsl_mutator.h" +#include "fuzzers/transform_builder.h" #include "src/reader/wgsl/parser.h" #include "src/writer/wgsl/generator.h" @@ -137,13 +138,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { continue; } - transform::Manager transform_manager; - transform::DataMap transform_inputs; - transform_manager.Add(); + TransformBuilder tb(data, size); + tb.AddTransform(); CommonFuzzer fuzzer(InputFormat::kWGSL, target.output_format); fuzzer.EnableInspector(); - fuzzer.SetTransformManager(&transform_manager, &transform_inputs); + fuzzer.SetTransformManager(tb.manager(), tb.data_map()); fuzzer.Run(data, size); } diff --git a/fuzzers/tint_robustness_fuzzer.cc b/fuzzers/tint_robustness_fuzzer.cc index e0296bb5d5..16eec00410 100644 --- a/fuzzers/tint_robustness_fuzzer.cc +++ b/fuzzers/tint_robustness_fuzzer.cc @@ -14,16 +14,17 @@ #include "fuzzers/fuzzer_init.h" #include "fuzzers/tint_common_fuzzer.h" +#include "fuzzers/transform_builder.h" namespace tint { namespace fuzzers { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - tint::transform::Manager transform_manager; - transform_manager.Add(); + TransformBuilder tb(data, size); + tb.AddTransform(); tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL); - fuzzer.SetTransformManager(&transform_manager, {}); + fuzzer.SetTransformManager(tb.manager(), tb.data_map()); fuzzer.SetDumpInput(GetCliParams().dump_input); return fuzzer.Run(data, size);