diff --git a/src/tint/fuzzers/tint_common_fuzzer.cc b/src/tint/fuzzers/tint_common_fuzzer.cc index bbea6fce08..ac57071ad0 100644 --- a/src/tint/fuzzers/tint_common_fuzzer.cc +++ b/src/tint/fuzzers/tint_common_fuzzer.cc @@ -219,12 +219,7 @@ int CommonFuzzer::Run(const uint8_t* data, size_t size) { switch (output_) { case OutputFormat::kWGSL: { #if TINT_BUILD_WGSL_WRITER - auto result = writer::wgsl::Generate(&program, options_wgsl_); - generated_wgsl_ = std::move(result.wgsl); - if (!result.success) { - VALIDITY_ERROR(program.Diagnostics(), - "WGSL writer errored on validated input:\n" + result.error); - } + writer::wgsl::Generate(&program, options_wgsl_); #endif // TINT_BUILD_WGSL_WRITER break; } @@ -232,10 +227,6 @@ int CommonFuzzer::Run(const uint8_t* data, size_t size) { #if TINT_BUILD_SPV_WRITER auto result = writer::spirv::Generate(&program, options_spirv_); generated_spirv_ = std::move(result.spirv); - if (!result.success) { - VALIDITY_ERROR(program.Diagnostics(), - "SPIR-V writer errored on validated input:\n" + result.error); - } if (!SPIRVToolsValidationCheck(program, generated_spirv_)) { VALIDITY_ERROR(program.Diagnostics(), @@ -247,12 +238,7 @@ int CommonFuzzer::Run(const uint8_t* data, size_t size) { } case OutputFormat::kHLSL: { #if TINT_BUILD_HLSL_WRITER - auto result = writer::hlsl::Generate(&program, options_hlsl_); - generated_hlsl_ = std::move(result.hlsl); - if (!result.success) { - VALIDITY_ERROR(program.Diagnostics(), - "HLSL writer errored on validated input:\n" + result.error); - } + writer::hlsl::Generate(&program, options_hlsl_); #endif // TINT_BUILD_HLSL_WRITER break; } @@ -266,12 +252,7 @@ int CommonFuzzer::Run(const uint8_t* data, size_t size) { input_program = &*flattened; } - auto result = writer::msl::Generate(input_program, options_msl_); - generated_msl_ = std::move(result.msl); - if (!result.success) { - VALIDITY_ERROR(input_program->Diagnostics(), - "MSL writer errored on validated input:\n" + result.error); - } + writer::msl::Generate(input_program, options_msl_); #endif // TINT_BUILD_MSL_WRITER break; } diff --git a/src/tint/transform/module_scope_var_to_entry_point_param.cc b/src/tint/transform/module_scope_var_to_entry_point_param.cc index 5a7eecc328..7bd3991dfe 100644 --- a/src/tint/transform/module_scope_var_to_entry_point_param.cc +++ b/src/tint/transform/module_scope_var_to_entry_point_param.cc @@ -219,9 +219,10 @@ struct ModuleScopeVarToEntryPointParam::State { case ast::StorageClass::kHandle: case ast::StorageClass::kWorkgroup: break; - default: + default: { TINT_ICE(Transform, ctx.dst->Diagnostics()) << "unhandled module-scope storage class (" << sc << ")"; + } } // Use a pointer for non-handle types. diff --git a/src/tint/writer/glsl/generator_impl.cc b/src/tint/writer/glsl/generator_impl.cc index 0dd1f92dc4..f4fa5ad9c7 100644 --- a/src/tint/writer/glsl/generator_impl.cc +++ b/src/tint/writer/glsl/generator_impl.cc @@ -1932,10 +1932,11 @@ bool GeneratorImpl::EmitGlobalVariable(const ast::Variable* global) { case ast::StorageClass::kIn: case ast::StorageClass::kOut: return EmitIOVariable(sem); - default: + default: { TINT_ICE(Writer, diagnostics_) << "unhandled storage class " << sem->StorageClass(); return false; + } } }, [&](const ast::Let* let) { return EmitProgramConstVariable(let); }, diff --git a/src/tint/writer/hlsl/generator_impl.cc b/src/tint/writer/hlsl/generator_impl.cc index 8aa5d611f2..7bf1eb91c8 100644 --- a/src/tint/writer/hlsl/generator_impl.cc +++ b/src/tint/writer/hlsl/generator_impl.cc @@ -2849,10 +2849,11 @@ bool GeneratorImpl::EmitGlobalVariable(const ast::Variable* global) { return EmitPrivateVariable(sem); case ast::StorageClass::kWorkgroup: return EmitWorkgroupVariable(sem); - default: + default: { TINT_ICE(Writer, diagnostics_) << "unhandled storage class " << sem->StorageClass(); return false; + } } }, [&](const ast::Override* override) { return EmitOverride(override); },