From 11f2740463d5f754531c9efa298f7b36e2038d1c Mon Sep 17 00:00:00 2001 From: John Stiles Date: Fri, 13 May 2022 10:47:00 -0400 Subject: [PATCH] Remove [[maybe_unused]] workaround in MetalCodeGen. This effectively rolls back http://review.skia.org/538045. Change-Id: I9c457a6c9c9ba98d4c2e3a6af03c5dd80c76beb9 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540082 Auto-Submit: John Stiles Commit-Queue: John Stiles Reviewed-by: Brian Osman --- src/sksl/codegen/SkSLMetalCodeGenerator.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/sksl/codegen/SkSLMetalCodeGenerator.cpp b/src/sksl/codegen/SkSLMetalCodeGenerator.cpp index abf49a0678..63d2a9bc11 100644 --- a/src/sksl/codegen/SkSLMetalCodeGenerator.cpp +++ b/src/sksl/codegen/SkSLMetalCodeGenerator.cpp @@ -2148,16 +2148,6 @@ void MetalCodeGenerator::writeName(std::string_view name) { } void MetalCodeGenerator::writeVarDeclaration(const VarDeclaration& varDecl) { - // The graphite shaders include functions with `switch` statements using named constant labels. - // When called with known values, the switch is eliminated. This leaves unused variables like: - // const int kFoo = ...; - // All of these happen to be `const int`. As a hack, mark any `const int` as maybe_unused, to - // suppress warnings from the metal compiler when validation is enabled. - if ((varDecl.var().modifiers().fFlags & Modifiers::kConst_Flag) && - varDecl.var().type().matches(*fContext.fTypes.fInt)) { - this->write("[[maybe_unused]] "); - } - this->writeModifiers(varDecl.var().modifiers()); this->writeType(varDecl.var().type()); this->write(" ");