diff --git a/src/tint/fuzzers/tint_common_fuzzer.cc b/src/tint/fuzzers/tint_common_fuzzer.cc index 15ab7d8b69..11cdf76e6c 100644 --- a/src/tint/fuzzers/tint_common_fuzzer.cc +++ b/src/tint/fuzzers/tint_common_fuzzer.cc @@ -149,8 +149,8 @@ int CommonFuzzer::Run(const uint8_t* data, size_t size) { #endif switch (input_) { -#if TINT_BUILD_WGSL_READER case InputFormat::kWGSL: { +#if TINT_BUILD_WGSL_READER // Clear any existing diagnostics, as these will hold pointers to file_, // which we are about to release. diagnostics_ = {}; @@ -160,11 +160,12 @@ int CommonFuzzer::Run(const uint8_t* data, size_t size) { dump_input_data(str, ".wgsl"); } program = reader::wgsl::Parse(file_.get()); +#endif // TINT_BUILD_WGSL_READER break; } -#endif // TINT_BUILD_WGSL_READER -#if TINT_BUILD_SPV_READER + case InputFormat::kSpv: { +#if TINT_BUILD_SPV_READER // `spirv_input` has been initialized with the capacity to store `size / // sizeof(uint32_t)` uint32_t values. If `size` is not a multiple of // sizeof(uint32_t) then not all of `data` can be copied into @@ -177,9 +178,9 @@ int CommonFuzzer::Run(const uint8_t* data, size_t size) { dump_input_data(spirv_input, ".spv"); } program = reader::spirv::Parse(spirv_input); +#endif // TINT_BUILD_SPV_READER break; } -#endif // TINT_BUILD_SPV_READER } if (!program.IsValid()) { diff --git a/src/tint/reader/spirv/parser_impl.h b/src/tint/reader/spirv/parser_impl.h index 9ff9033b28..7713734faf 100644 --- a/src/tint/reader/spirv/parser_impl.h +++ b/src/tint/reader/spirv/parser_impl.h @@ -25,7 +25,6 @@ #include "src/tint/utils/compiler_macros.h" #include "src/tint/utils/hashmap.h" -#if TINT_BUILD_SPV_READER TINT_BEGIN_DISABLE_WARNING(NEWLINE_EOF); TINT_BEGIN_DISABLE_WARNING(OLD_STYLE_CAST); TINT_BEGIN_DISABLE_WARNING(SIGN_CONVERSION); @@ -35,7 +34,6 @@ TINT_END_DISABLE_WARNING(WEAK_VTABLES); TINT_END_DISABLE_WARNING(SIGN_CONVERSION); TINT_END_DISABLE_WARNING(OLD_STYLE_CAST); TINT_END_DISABLE_WARNING(NEWLINE_EOF); -#endif #include "src/tint/program_builder.h" #include "src/tint/reader/reader.h" diff --git a/src/tint/reader/spirv/parser_impl_test_helper.h b/src/tint/reader/spirv/parser_impl_test_helper.h index d1b0e35f84..ea0e37e483 100644 --- a/src/tint/reader/spirv/parser_impl_test_helper.h +++ b/src/tint/reader/spirv/parser_impl_test_helper.h @@ -23,7 +23,6 @@ #include "src/tint/utils/compiler_macros.h" -#if TINT_BUILD_SPV_READER TINT_BEGIN_DISABLE_WARNING(NEWLINE_EOF); TINT_BEGIN_DISABLE_WARNING(OLD_STYLE_CAST); TINT_BEGIN_DISABLE_WARNING(SIGN_CONVERSION); @@ -33,7 +32,6 @@ TINT_END_DISABLE_WARNING(WEAK_VTABLES); TINT_END_DISABLE_WARNING(SIGN_CONVERSION); TINT_END_DISABLE_WARNING(OLD_STYLE_CAST); TINT_END_DISABLE_WARNING(NEWLINE_EOF); -#endif #include "gtest/gtest.h" #include "src/tint/demangler.h"