Remove the syntax tree printer.

With the conversion to IR, there are really only two places we have AST
at this point, coming out of the parser and into the IR and coming out
of IR for WGSL printing.

With the removal of transformations on the AST the syntax tree parser
has much less utility. Removing it.

Change-Id: I1a324f783a44fe4e5f60558f3f176221ad4678c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/256694
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
diff --git a/scripts/tint_overrides_with_defaults.gni b/scripts/tint_overrides_with_defaults.gni
index 7356693..20cc19b 100644
--- a/scripts/tint_overrides_with_defaults.gni
+++ b/scripts/tint_overrides_with_defaults.gni
@@ -125,11 +125,6 @@
     tint_build_glsl_validator = true
   }
 
-  # Build the Syntax Tree writer
-  if (!defined(tint_build_syntax_tree_writer)) {
-    tint_build_syntax_tree_writer = false
-  }
-
   # Build IR binary format support
   if (!defined(tint_build_ir_binary)) {
     tint_build_ir_binary = tint_has_protobuf
diff --git a/src/tint/BUILD.gn b/src/tint/BUILD.gn
index dab527d..2853229 100644
--- a/src/tint/BUILD.gn
+++ b/src/tint/BUILD.gn
@@ -110,12 +110,6 @@
     defines += [ "TINT_BUILD_GLSL_VALIDATOR=0" ]
   }
 
-  if (tint_build_syntax_tree_writer) {
-    defines += [ "TINT_BUILD_SYNTAX_TREE_WRITER=1" ]
-  } else {
-    defines += [ "TINT_BUILD_SYNTAX_TREE_WRITER=0" ]
-  }
-
   if (tint_build_ir_binary) {
     defines += [ "TINT_BUILD_IR_BINARY=1" ]
   } else {
diff --git a/src/tint/api/tint.cc b/src/tint/api/tint.cc
index 1d32a75..2688bd2 100644
--- a/src/tint/api/tint.cc
+++ b/src/tint/api/tint.cc
@@ -72,7 +72,7 @@
 #if TINT_BUILD_WGSL_WRITER
     // Register the Program printer. This is used for debugging purposes.
     tint::Program::printer = [](const tint::Program& program) {
-        auto result = wgsl::writer::Generate(program, {});
+        auto result = wgsl::writer::Generate(program);
         if (result != Success) {
             return result.Failure().reason;
         }
diff --git a/src/tint/cmd/bench/wgsl/writer_bench.cc b/src/tint/cmd/bench/wgsl/writer_bench.cc
index a93b587..5ac8d1c 100644
--- a/src/tint/cmd/bench/wgsl/writer_bench.cc
+++ b/src/tint/cmd/bench/wgsl/writer_bench.cc
@@ -40,7 +40,7 @@
         return;
     }
     for (auto _ : state) {
-        auto gen_res = Generate(res->program, {});
+        auto gen_res = Generate(res->program);
         if (gen_res != Success) {
             state.SkipWithError(gen_res.Failure().reason);
         }
diff --git a/src/tint/cmd/common/helper.cc b/src/tint/cmd/common/helper.cc
index ae91a0b..8bde991 100644
--- a/src/tint/cmd/common/helper.cc
+++ b/src/tint/cmd/common/helper.cc
@@ -147,8 +147,7 @@
 
 void PrintWGSL(std::ostream& out, const tint::Program& program) {
 #if TINT_BUILD_WGSL_WRITER
-    tint::wgsl::writer::Options options;
-    auto result = tint::wgsl::writer::Generate(program, options);
+    auto result = tint::wgsl::writer::Generate(program);
     if (result == Success) {
         out << "\n" << result->wgsl << "\n";
     } else {
diff --git a/src/tint/cmd/fuzz/wgsl/fuzz.cc b/src/tint/cmd/fuzz/wgsl/fuzz.cc
index 6fdfbaa..ca8311c 100644
--- a/src/tint/cmd/fuzz/wgsl/fuzz.cc
+++ b/src/tint/cmd/fuzz/wgsl/fuzz.cc
@@ -132,7 +132,7 @@
 #if TINT_BUILD_WGSL_WRITER
     // Register the Program printer. This is used for debugging purposes.
     tint::Program::printer = [](const tint::Program& program) {
-        auto result = tint::wgsl::writer::Generate(program, {});
+        auto result = tint::wgsl::writer::Generate(program);
         if (result != Success) {
             return result.Failure().reason;
         }
diff --git a/src/tint/cmd/tint/main.cc b/src/tint/cmd/tint/main.cc
index e40cd98..431b98c 100644
--- a/src/tint/cmd/tint/main.cc
+++ b/src/tint/cmd/tint/main.cc
@@ -155,10 +155,6 @@
     bool dump_ir = false;
     bool use_ir_reader = false;
 
-#if TINT_BUILD_SYNTAX_TREE_WRITER
-    bool dump_ast = false;
-#endif  // TINT_BUILD_SYNTAX_TREE_WRITER
-
 #if TINT_BUILD_SPV_READER
     tint::spirv::reader::Options spirv_reader_options;
 #endif  // TINT_BUILD_SPV_READER
@@ -497,12 +493,6 @@
         Alias{"emit-inspector-bindings"}, Default{false});
     TINT_DEFER(opts->dump_inspector_bindings = *dump_inspector_bindings.value);
 
-#if TINT_BUILD_SYNTAX_TREE_WRITER
-    auto& dump_ast = options.Add<BoolOption>("dump-ast", "Writes the AST to stdout",
-                                             Alias{"emit-ast"}, Default{false});
-    TINT_DEFER(opts->dump_ast = *dump_ast.value);
-#endif  // TINT_BUILD_SYNTAX_TREE_WRITER
-
     auto& parse_only =
         options.Add<BoolOption>("parse-only", "Stop after parsing the input", Default{false});
     TINT_DEFER(opts->parse_only = *parse_only.value);
@@ -950,9 +940,7 @@
                   [[maybe_unused]] tint::inspector::Inspector& inspector,
                   [[maybe_unused]] tint::Program& program) {
 #if TINT_BUILD_WGSL_WRITER
-    // TODO(jrprice): Provide a way for the user to set non-default options.
-    tint::wgsl::writer::Options gen_options;
-    auto result = tint::wgsl::writer::Generate(program, gen_options);
+    auto result = tint::wgsl::writer::Generate(program);
     if (result != tint::Success) {
         std::cerr << "Failed to generate: " << result.Failure() << "\n";
         return false;
@@ -1456,19 +1444,6 @@
         return 1;
     }
 
-#if TINT_BUILD_SYNTAX_TREE_WRITER
-    if (options.dump_ast) {
-        tint::wgsl::writer::Options gen_options;
-        gen_options.use_syntax_tree_writer = true;
-        auto result = tint::wgsl::writer::Generate(info.program, gen_options);
-        if (result != tint::Success) {
-            std::cerr << "Failed to dump AST: " << result.Failure() << "\n";
-        } else {
-            std::cout << result->wgsl << "\n";
-        }
-    }
-#endif  // TINT_BUILD_SYNTAX_TREE_WRITER
-
     if (options.dump_ir || options.format == Format::kIr) {
         auto res = DumpIR(info.program, options);
         if (options.format == Format::kIr) {
diff --git a/src/tint/lang/spirv/reader/ast_lower/helper_test.h b/src/tint/lang/spirv/reader/ast_lower/helper_test.h
index 41750a6..e85726e 100644
--- a/src/tint/lang/spirv/reader/ast_lower/helper_test.h
+++ b/src/tint/lang/spirv/reader/ast_lower/helper_test.h
@@ -49,8 +49,7 @@
         return program.Diagnostics().Str();
     }
 
-    wgsl::writer::Options options;
-    auto result = wgsl::writer::Generate(program, options);
+    auto result = wgsl::writer::Generate(program);
     if (result != Success) {
         return result.Failure().reason;
     }
diff --git a/src/tint/lang/spirv/reader/ast_parser/ast_parser_test.cc b/src/tint/lang/spirv/reader/ast_parser/ast_parser_test.cc
index 54548ef..7a40634 100644
--- a/src/tint/lang/spirv/reader/ast_parser/ast_parser_test.cc
+++ b/src/tint/lang/spirv/reader/ast_parser/ast_parser_test.cc
@@ -324,7 +324,7 @@
     auto errs = program.Diagnostics().Str();
     EXPECT_TRUE(program.IsValid()) << errs;
     EXPECT_EQ(program.Diagnostics().Count(), 0u) << errs;
-    auto result = wgsl::writer::Generate(program, {});
+    auto result = wgsl::writer::Generate(program);
     EXPECT_EQ(result, Success);
     EXPECT_EQ("\n" + result->wgsl, R"(
 enable dual_source_blending;
@@ -428,7 +428,7 @@
     auto errs = program.Diagnostics().Str();
     EXPECT_TRUE(program.IsValid()) << errs;
     EXPECT_EQ(program.Diagnostics().Count(), 0u) << errs;
-    auto result = wgsl::writer::Generate(program, {});
+    auto result = wgsl::writer::Generate(program);
     EXPECT_EQ(result, Success);
     EXPECT_EQ("\n" + result->wgsl, R"(
 enable clip_distances;
@@ -528,7 +528,7 @@
     auto errs = program.Diagnostics().Str();
     EXPECT_TRUE(program.IsValid()) << errs;
     EXPECT_EQ(program.Diagnostics().Count(), 0u) << errs;
-    auto result = wgsl::writer::Generate(program, {});
+    auto result = wgsl::writer::Generate(program);
     EXPECT_EQ(result, Success);
     EXPECT_EQ("\n" + result->wgsl, R"(
 enable clip_distances;
diff --git a/src/tint/lang/spirv/reader/ast_parser/row_major_matrix_test.cc b/src/tint/lang/spirv/reader/ast_parser/row_major_matrix_test.cc
index ca363ae..3e0e7a6 100644
--- a/src/tint/lang/spirv/reader/ast_parser/row_major_matrix_test.cc
+++ b/src/tint/lang/spirv/reader/ast_parser/row_major_matrix_test.cc
@@ -86,7 +86,7 @@
         auto errs = program.Diagnostics().Str();
         EXPECT_TRUE(program.IsValid()) << errs;
         EXPECT_EQ(program.Diagnostics().Count(), 0u) << errs;
-        auto result = wgsl::writer::Generate(program, {});
+        auto result = wgsl::writer::Generate(program);
         EXPECT_EQ(result, Success);
         return "\n" + result->wgsl;
     }
diff --git a/src/tint/lang/wgsl/ast/module_clone_test.cc b/src/tint/lang/wgsl/ast/module_clone_test.cc
index 9eeeb32..0be6108 100644
--- a/src/tint/lang/wgsl/ast/module_clone_test.cc
+++ b/src/tint/lang/wgsl/ast/module_clone_test.cc
@@ -169,10 +169,9 @@
     // Regenerate the wgsl for the src program. We use this instead of the
     // original source so that reformatting doesn't impact the final wgsl
     // comparison.
-    wgsl::writer::Options options;
     std::string src_wgsl;
     {
-        auto result = wgsl::writer::Generate(src, options);
+        auto result = wgsl::writer::Generate(src);
         ASSERT_EQ(result, Success);
         src_wgsl = result->wgsl;
 
@@ -185,7 +184,7 @@
     }
 
     // Print the dst module, check it matches the original source
-    auto result = wgsl::writer::Generate(dst, options);
+    auto result = wgsl::writer::Generate(dst);
     ASSERT_EQ(result, Success);
     auto dst_wgsl = result->wgsl;
     ASSERT_EQ(src_wgsl, dst_wgsl);
diff --git a/src/tint/lang/wgsl/ir/direct_variable_access_wgsl_test.cc b/src/tint/lang/wgsl/ir/direct_variable_access_wgsl_test.cc
index e4e5bc5..c37b763 100644
--- a/src/tint/lang/wgsl/ir/direct_variable_access_wgsl_test.cc
+++ b/src/tint/lang/wgsl/ir/direct_variable_access_wgsl_test.cc
@@ -95,7 +95,7 @@
                    "\n\nAST:\n" + Program::printer(program_out);
         }
 
-        auto output = wgsl::writer::Generate(program_out, wgsl::writer::Options{});
+        auto output = wgsl::writer::Generate(program_out);
         if (output != Success) {
             return "wgsl::writer::IRToProgram() failed: \n" + output.Failure().reason +
                    "\n\nIR:\n" + ir::Disassembler(module.Get()).Plain();
diff --git a/src/tint/lang/wgsl/ir_roundtrip_test.cc b/src/tint/lang/wgsl/ir_roundtrip_test.cc
index 1079df9..581db75 100644
--- a/src/tint/lang/wgsl/ir_roundtrip_test.cc
+++ b/src/tint/lang/wgsl/ir_roundtrip_test.cc
@@ -91,7 +91,7 @@
             return result;
         }
 
-        auto output = wgsl::writer::Generate(output_program, {});
+        auto output = wgsl::writer::Generate(output_program);
         if (output != Success) {
             std::stringstream ss;
             ss << "wgsl::Generate() errored: " << output.Failure();
diff --git a/src/tint/lang/wgsl/program/clone_context_fuzz.cc b/src/tint/lang/wgsl/program/clone_context_fuzz.cc
index 8aa341a..d17a656 100644
--- a/src/tint/lang/wgsl/program/clone_context_fuzz.cc
+++ b/src/tint/lang/wgsl/program/clone_context_fuzz.cc
@@ -78,12 +78,10 @@
         ASSERT_EQ(src_types.count(dst_type), 0u);
     }
 
-    tint::wgsl::writer::Options wgsl_options;
-
-    auto src_wgsl = tint::wgsl::writer::Generate(src, wgsl_options);
+    auto src_wgsl = tint::wgsl::writer::Generate(src);
     ASSERT_TRUE(src_wgsl);
 
-    auto dst_wgsl = tint::wgsl::writer::Generate(dst, wgsl_options);
+    auto dst_wgsl = tint::wgsl::writer::Generate(dst);
     ASSERT_TRUE(dst_wgsl);
 
     ASSERT_EQ(src_wgsl->wgsl, dst_wgsl->wgsl);
diff --git a/src/tint/lang/wgsl/writer/BUILD.bazel b/src/tint/lang/wgsl/writer/BUILD.bazel
index 940ab9c..0eaba3f 100644
--- a/src/tint/lang/wgsl/writer/BUILD.bazel
+++ b/src/tint/lang/wgsl/writer/BUILD.bazel
@@ -39,12 +39,10 @@
 cc_library(
   name = "writer",
   srcs = [
-    "options.cc",
     "output.cc",
     "writer.cc",
   ],
   hdrs = [
-    "options.h",
     "output.h",
     "writer.h",
   ],
@@ -60,7 +58,6 @@
     "//src/tint/lang/wgsl/sem",
     "//src/tint/lang/wgsl/writer/ir_to_program",
     "//src/tint/lang/wgsl/writer/raise",
-    "//src/tint/lang/wgsl/writer/syntax_tree_printer",
     "//src/tint/utils",
     "//src/tint/utils/containers",
     "//src/tint/utils/diagnostic",
@@ -86,7 +83,6 @@
   name = "test",
   alwayslink = True,
   srcs = [
-    "options_test.cc",
     "writer_test.cc",
   ],
   deps = [
diff --git a/src/tint/lang/wgsl/writer/BUILD.cmake b/src/tint/lang/wgsl/writer/BUILD.cmake
index e2600d2..69dcf92 100644
--- a/src/tint/lang/wgsl/writer/BUILD.cmake
+++ b/src/tint/lang/wgsl/writer/BUILD.cmake
@@ -37,7 +37,6 @@
 include(lang/wgsl/writer/ast_printer/BUILD.cmake)
 include(lang/wgsl/writer/ir_to_program/BUILD.cmake)
 include(lang/wgsl/writer/raise/BUILD.cmake)
-include(lang/wgsl/writer/syntax_tree_printer/BUILD.cmake)
 
 if(TINT_BUILD_WGSL_WRITER)
 ################################################################################
@@ -46,8 +45,6 @@
 # Condition: TINT_BUILD_WGSL_WRITER
 ################################################################################
 tint_add_target(tint_lang_wgsl_writer lib
-  lang/wgsl/writer/options.cc
-  lang/wgsl/writer/options.h
   lang/wgsl/writer/output.cc
   lang/wgsl/writer/output.h
   lang/wgsl/writer/writer.cc
@@ -66,7 +63,6 @@
   tint_lang_wgsl_sem
   tint_lang_wgsl_writer_ir_to_program
   tint_lang_wgsl_writer_raise
-  tint_lang_wgsl_writer_syntax_tree_printer
   tint_utils
   tint_utils_containers
   tint_utils_diagnostic
@@ -98,7 +94,6 @@
 # Condition: TINT_BUILD_WGSL_WRITER
 ################################################################################
 tint_add_target(tint_lang_wgsl_writer_test test
-  lang/wgsl/writer/options_test.cc
   lang/wgsl/writer/writer_test.cc
 )
 
diff --git a/src/tint/lang/wgsl/writer/BUILD.gn b/src/tint/lang/wgsl/writer/BUILD.gn
index 4811ba5..9c732d1 100644
--- a/src/tint/lang/wgsl/writer/BUILD.gn
+++ b/src/tint/lang/wgsl/writer/BUILD.gn
@@ -45,8 +45,6 @@
 if (tint_build_wgsl_writer) {
   libtint_source_set("writer") {
     sources = [
-      "options.cc",
-      "options.h",
       "output.cc",
       "output.h",
       "writer.cc",
@@ -65,7 +63,6 @@
       "${tint_src_dir}/lang/wgsl/sem",
       "${tint_src_dir}/lang/wgsl/writer/ir_to_program",
       "${tint_src_dir}/lang/wgsl/writer/raise",
-      "${tint_src_dir}/lang/wgsl/writer/syntax_tree_printer",
       "${tint_src_dir}/utils",
       "${tint_src_dir}/utils/containers",
       "${tint_src_dir}/utils/diagnostic",
@@ -87,10 +84,7 @@
 if (tint_build_unittests) {
   if (tint_build_wgsl_writer) {
     tint_unittests_source_set("unittests") {
-      sources = [
-        "options_test.cc",
-        "writer_test.cc",
-      ]
+      sources = [ "writer_test.cc" ]
       deps = [
         "${dawn_root}/src/utils:utils",
         "${tint_src_dir}:gmock_and_gtest",
diff --git a/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc b/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc
index 5d2230b..fdc7530 100644
--- a/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc
+++ b/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc
@@ -58,7 +58,7 @@
         return result;
     }
 
-    auto output = wgsl::writer::Generate(output_program, {});
+    auto output = wgsl::writer::Generate(output_program);
     if (output != Success) {
         std::stringstream ss;
         ss << "wgsl::Generate() errored: " << output.Failure();
diff --git a/src/tint/lang/wgsl/writer/options.cc b/src/tint/lang/wgsl/writer/options.cc
deleted file mode 100644
index d2d274b..0000000
--- a/src/tint/lang/wgsl/writer/options.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2023 The Dawn & Tint Authors
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the copyright holder nor the names of its
-//    contributors may be used to endorse or promote products derived from
-//    this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifdef TINT_BUILD_SYNTAX_TREE_WRITER
-
-#include "src/tint/lang/wgsl/writer/options.h"
-
-namespace tint::wgsl::writer {
-
-#ifdef TINT_BUILD_SYNTAX_TREE_WRITER
-
-Options::Options() = default;
-
-Options::~Options() = default;
-
-Options::Options(const Options&) = default;
-
-Options& Options::operator=(const Options&) = default;
-
-#endif  // TINT_BUILD_SYNTAX_TREE_WRITER
-
-}  // namespace tint::wgsl::writer
-
-#endif  // TINT_BUILD_SYNTAX_TREE_WRITER
diff --git a/src/tint/lang/wgsl/writer/options.h b/src/tint/lang/wgsl/writer/options.h
deleted file mode 100644
index 2319bd7..0000000
--- a/src/tint/lang/wgsl/writer/options.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2023 The Dawn & Tint Authors
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the copyright holder nor the names of its
-//    contributors may be used to endorse or promote products derived from
-//    this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef SRC_TINT_LANG_WGSL_WRITER_OPTIONS_H_
-#define SRC_TINT_LANG_WGSL_WRITER_OPTIONS_H_
-
-#include "src/tint/utils/reflection.h"
-
-namespace tint::wgsl::writer {
-
-/// Configuration options used for generating WGSL.
-struct Options {
-#ifdef TINT_BUILD_SYNTAX_TREE_WRITER
-    /// Constructor
-    Options();
-    /// Destructor
-    ~Options();
-    /// Copy constructor
-    Options(const Options&);
-    /// Copy assignment
-    /// @returns this Options
-    Options& operator=(const Options&);
-
-    /// Set to `true` to use the syntax tree writer
-    bool use_syntax_tree_writer = false;
-
-    TINT_REFLECT(Options, use_syntax_tree_writer);
-#endif
-};
-
-}  // namespace tint::wgsl::writer
-
-#endif  // SRC_TINT_LANG_WGSL_WRITER_OPTIONS_H_
diff --git a/src/tint/lang/wgsl/writer/options_test.cc b/src/tint/lang/wgsl/writer/options_test.cc
deleted file mode 100644
index dfc139d..0000000
--- a/src/tint/lang/wgsl/writer/options_test.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2024 The Dawn & Tint Authors
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the copyright holder nor the names of its
-//    contributors may be used to endorse or promote products derived from
-//    this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "src/tint/lang/wgsl/writer/options.h"
-
-#include <gtest/gtest.h>
-
-#ifdef TINT_BUILD_SYNTAX_TREE_WRITER
-
-namespace tint::wgsl::writer {
-namespace {
-
-TEST(TintCheckAllFieldsReflected, WgslWriterOptionsTest) {
-    TINT_ASSERT_ALL_FIELDS_REFLECTED(Options);
-}
-
-}  // namespace
-}  // namespace tint::wgsl::writer
-
-#endif
diff --git a/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.bazel b/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.bazel
deleted file mode 100644
index b09245a..0000000
--- a/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.bazel
+++ /dev/null
@@ -1,73 +0,0 @@
-# Copyright 2023 The Dawn & Tint Authors
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this
-#    list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice,
-#    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution.
-#
-# 3. Neither the name of the copyright holder nor the names of its
-#    contributors may be used to endorse or promote products derived from
-#    this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-#   tools/src/cmd/gen/build/BUILD.bazel.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-#                       Do not modify this file directly
-################################################################################
-
-load("//src/tint:flags.bzl", "COPTS")
-load("@bazel_skylib//lib:selects.bzl", "selects")
-cc_library(
-  name = "syntax_tree_printer",
-  srcs = [
-    "syntax_tree_printer.cc",
-  ],
-  hdrs = [
-    "syntax_tree_printer.h",
-  ],
-  deps = [
-    "//src/tint/api/common",
-    "//src/tint/lang/core",
-    "//src/tint/lang/core/constant",
-    "//src/tint/lang/core/type",
-    "//src/tint/lang/wgsl",
-    "//src/tint/lang/wgsl/ast",
-    "//src/tint/lang/wgsl/program",
-    "//src/tint/lang/wgsl/sem",
-    "//src/tint/utils",
-    "//src/tint/utils/containers",
-    "//src/tint/utils/diagnostic",
-    "//src/tint/utils/ice",
-    "//src/tint/utils/macros",
-    "//src/tint/utils/math",
-    "//src/tint/utils/memory",
-    "//src/tint/utils/rtti",
-    "//src/tint/utils/strconv",
-    "//src/tint/utils/symbol",
-    "//src/tint/utils/text",
-    "//src/tint/utils/text_generator",
-    "//src/utils",
-  ],
-  copts = COPTS,
-  visibility = ["//visibility:public"],
-)
-
diff --git a/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.cmake b/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.cmake
deleted file mode 100644
index db8df55..0000000
--- a/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.cmake
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 2023 The Dawn & Tint Authors
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this
-#    list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice,
-#    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution.
-#
-# 3. Neither the name of the copyright holder nor the names of its
-#    contributors may be used to endorse or promote products derived from
-#    this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-#   tools/src/cmd/gen/build/BUILD.cmake.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-#                       Do not modify this file directly
-################################################################################
-
-################################################################################
-# Target:    tint_lang_wgsl_writer_syntax_tree_printer
-# Kind:      lib
-################################################################################
-tint_add_target(tint_lang_wgsl_writer_syntax_tree_printer lib
-  lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.cc
-  lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.h
-)
-
-tint_target_add_dependencies(tint_lang_wgsl_writer_syntax_tree_printer lib
-  tint_api_common
-  tint_lang_core
-  tint_lang_core_constant
-  tint_lang_core_type
-  tint_lang_wgsl
-  tint_lang_wgsl_ast
-  tint_lang_wgsl_program
-  tint_lang_wgsl_sem
-  tint_utils
-  tint_utils_containers
-  tint_utils_diagnostic
-  tint_utils_ice
-  tint_utils_macros
-  tint_utils_math
-  tint_utils_memory
-  tint_utils_rtti
-  tint_utils_strconv
-  tint_utils_symbol
-  tint_utils_text
-  tint_utils_text_generator
-)
-
-tint_target_add_external_dependencies(tint_lang_wgsl_writer_syntax_tree_printer lib
-  "src_utils"
-)
diff --git a/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.gn b/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.gn
deleted file mode 100644
index 243dd55..0000000
--- a/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.gn
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 2023 The Dawn & Tint Authors
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this
-#    list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice,
-#    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution.
-#
-# 3. Neither the name of the copyright holder nor the names of its
-#    contributors may be used to endorse or promote products derived from
-#    this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-#   tools/src/cmd/gen/build/BUILD.gn.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-#                       Do not modify this file directly
-################################################################################
-
-import("../../../../../../scripts/dawn_overrides_with_defaults.gni")
-import("../../../../../../scripts/tint_overrides_with_defaults.gni")
-
-import("${tint_src_dir}/tint.gni")
-
-libtint_source_set("syntax_tree_printer") {
-  sources = [
-    "syntax_tree_printer.cc",
-    "syntax_tree_printer.h",
-  ]
-  deps = [
-    "${dawn_root}/src/utils:utils",
-    "${tint_src_dir}/api/common",
-    "${tint_src_dir}/lang/core",
-    "${tint_src_dir}/lang/core/constant",
-    "${tint_src_dir}/lang/core/type",
-    "${tint_src_dir}/lang/wgsl",
-    "${tint_src_dir}/lang/wgsl/ast",
-    "${tint_src_dir}/lang/wgsl/program",
-    "${tint_src_dir}/lang/wgsl/sem",
-    "${tint_src_dir}/utils",
-    "${tint_src_dir}/utils/containers",
-    "${tint_src_dir}/utils/diagnostic",
-    "${tint_src_dir}/utils/ice",
-    "${tint_src_dir}/utils/macros",
-    "${tint_src_dir}/utils/math",
-    "${tint_src_dir}/utils/memory",
-    "${tint_src_dir}/utils/rtti",
-    "${tint_src_dir}/utils/strconv",
-    "${tint_src_dir}/utils/symbol",
-    "${tint_src_dir}/utils/text",
-    "${tint_src_dir}/utils/text_generator",
-  ]
-}
diff --git a/src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.cc b/src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.cc
deleted file mode 100644
index af1bb61..0000000
--- a/src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.cc
+++ /dev/null
@@ -1,1094 +0,0 @@
-// Copyright 2023 The Dawn & Tint Authors
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the copyright holder nor the names of its
-//    contributors may be used to endorse or promote products derived from
-//    this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.h"
-
-#include "src/tint/lang/core/enums.h"
-#include "src/tint/lang/wgsl/ast/alias.h"
-#include "src/tint/lang/wgsl/ast/assignment_statement.h"
-#include "src/tint/lang/wgsl/ast/binary_expression.h"
-#include "src/tint/lang/wgsl/ast/blend_src_attribute.h"
-#include "src/tint/lang/wgsl/ast/bool_literal_expression.h"
-#include "src/tint/lang/wgsl/ast/break_if_statement.h"
-#include "src/tint/lang/wgsl/ast/break_statement.h"
-#include "src/tint/lang/wgsl/ast/call_expression.h"
-#include "src/tint/lang/wgsl/ast/call_statement.h"
-#include "src/tint/lang/wgsl/ast/compound_assignment_statement.h"
-#include "src/tint/lang/wgsl/ast/const.h"
-#include "src/tint/lang/wgsl/ast/continue_statement.h"
-#include "src/tint/lang/wgsl/ast/diagnostic_attribute.h"
-#include "src/tint/lang/wgsl/ast/diagnostic_rule_name.h"
-#include "src/tint/lang/wgsl/ast/discard_statement.h"
-#include "src/tint/lang/wgsl/ast/float_literal_expression.h"
-#include "src/tint/lang/wgsl/ast/for_loop_statement.h"
-#include "src/tint/lang/wgsl/ast/id_attribute.h"
-#include "src/tint/lang/wgsl/ast/identifier.h"
-#include "src/tint/lang/wgsl/ast/identifier_expression.h"
-#include "src/tint/lang/wgsl/ast/if_statement.h"
-#include "src/tint/lang/wgsl/ast/increment_decrement_statement.h"
-#include "src/tint/lang/wgsl/ast/index_accessor_expression.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
-#include "src/tint/lang/wgsl/ast/internal_attribute.h"
-#include "src/tint/lang/wgsl/ast/interpolate_attribute.h"
-#include "src/tint/lang/wgsl/ast/invariant_attribute.h"
-#include "src/tint/lang/wgsl/ast/let.h"
-#include "src/tint/lang/wgsl/ast/loop_statement.h"
-#include "src/tint/lang/wgsl/ast/member_accessor_expression.h"
-#include "src/tint/lang/wgsl/ast/module.h"
-#include "src/tint/lang/wgsl/ast/must_use_attribute.h"
-#include "src/tint/lang/wgsl/ast/override.h"
-#include "src/tint/lang/wgsl/ast/phony_expression.h"
-#include "src/tint/lang/wgsl/ast/return_statement.h"
-#include "src/tint/lang/wgsl/ast/stage_attribute.h"
-#include "src/tint/lang/wgsl/ast/stride_attribute.h"
-#include "src/tint/lang/wgsl/ast/struct_member_align_attribute.h"
-#include "src/tint/lang/wgsl/ast/struct_member_offset_attribute.h"
-#include "src/tint/lang/wgsl/ast/struct_member_size_attribute.h"
-#include "src/tint/lang/wgsl/ast/switch_statement.h"
-#include "src/tint/lang/wgsl/ast/templated_identifier.h"
-#include "src/tint/lang/wgsl/ast/unary_op_expression.h"
-#include "src/tint/lang/wgsl/ast/var.h"
-#include "src/tint/lang/wgsl/ast/variable_decl_statement.h"
-#include "src/tint/lang/wgsl/ast/while_statement.h"
-#include "src/tint/lang/wgsl/ast/workgroup_attribute.h"
-#include "src/tint/lang/wgsl/sem/struct.h"
-#include "src/tint/lang/wgsl/sem/switch_statement.h"
-#include "src/tint/utils/macros/scoped_assignment.h"
-#include "src/tint/utils/rtti/switch.h"
-#include "src/tint/utils/strconv/float_to_string.h"
-#include "src/tint/utils/text/string.h"
-
-namespace tint::wgsl::writer {
-
-SyntaxTreePrinter::SyntaxTreePrinter(const Program& program) : program_(program) {}
-
-SyntaxTreePrinter::~SyntaxTreePrinter() = default;
-
-bool SyntaxTreePrinter::Generate() {
-    // Generate global declarations in the order they appear in the module.
-    for (auto* decl : program_.AST().GlobalDeclarations()) {
-        Switch(
-            decl,  //
-            [&](const ast::DiagnosticDirective* dd) { EmitDiagnosticControl(dd->control); },
-            [&](const ast::Enable* e) { EmitEnable(e); },
-            [&](const ast::TypeDecl* td) { EmitTypeDecl(td); },
-            [&](const ast::Function* func) { EmitFunction(func); },
-            [&](const ast::Variable* var) { EmitVariable(var); },
-            [&](const ast::ConstAssert* ca) { EmitConstAssert(ca); },  //
-            TINT_ICE_ON_NO_MATCH);
-
-        if (decl != program_.AST().GlobalDeclarations().Back()) {
-            Line();
-        }
-    }
-
-    return true;
-}
-
-void SyntaxTreePrinter::EmitDiagnosticControl(const ast::DiagnosticControl& diagnostic) {
-    Line() << "DiagnosticControl [severity: " << diagnostic.severity
-           << ", rule: " << diagnostic.rule_name->String() << "]";
-}
-
-void SyntaxTreePrinter::EmitEnable(const ast::Enable* enable) {
-    auto l = Line();
-    l << "Enable [";
-    for (auto* ext : enable->extensions) {
-        if (ext != enable->extensions.Front()) {
-            l << ", ";
-        }
-        l << ext->name;
-    }
-    l << "]";
-}
-
-void SyntaxTreePrinter::EmitTypeDecl(const ast::TypeDecl* ty) {
-    Switch(
-        ty,  //
-        [&](const ast::Alias* alias) {
-            Line() << "Alias [";
-            {
-                ScopedIndent ai(this);
-
-                Line() << "name: " << alias->name->symbol.Name();
-                Line() << "expr: ";
-                {
-                    ScopedIndent ex(this);
-                    EmitExpression(alias->type);
-                }
-            }
-            Line() << "]";
-        },
-        [&](const ast::Struct* str) { EmitStructType(str); },  //
-        TINT_ICE_ON_NO_MATCH);
-}
-
-void SyntaxTreePrinter::EmitExpression(const ast::Expression* expr) {
-    Switch(
-        expr,  //
-        [&](const ast::IndexAccessorExpression* a) { EmitIndexAccessor(a); },
-        [&](const ast::BinaryExpression* b) { EmitBinary(b); },
-        [&](const ast::CallExpression* c) { EmitCall(c); },
-        [&](const ast::IdentifierExpression* i) { EmitIdentifier(i); },
-        [&](const ast::LiteralExpression* l) { EmitLiteral(l); },
-        [&](const ast::MemberAccessorExpression* m) { EmitMemberAccessor(m); },
-        [&](const ast::PhonyExpression*) { Line() << "[PhonyExpression]"; },
-        [&](const ast::UnaryOpExpression* u) { EmitUnaryOp(u); },  //
-        TINT_ICE_ON_NO_MATCH);
-}
-
-void SyntaxTreePrinter::EmitIndexAccessor(const ast::IndexAccessorExpression* expr) {
-    Line() << "IndexAccessorExpression [";
-    {
-        ScopedIndent iae(this);
-        Line() << "object: ";
-        {
-            ScopedIndent obj(this);
-            EmitExpression(expr->object);
-        }
-
-        Line() << "index: ";
-        {
-            ScopedIndent idx(this);
-            EmitExpression(expr->index);
-        }
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitMemberAccessor(const ast::MemberAccessorExpression* expr) {
-    Line() << "MemberAccessorExpression [";
-    {
-        ScopedIndent mae(this);
-
-        Line() << "object: ";
-        {
-            ScopedIndent obj(this);
-            EmitExpression(expr->object);
-        }
-        Line() << "member: " << expr->member->symbol.Name();
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitCall(const ast::CallExpression* expr) {
-    Line() << "Call [";
-    {
-        ScopedIndent cl(this);
-
-        Line() << "target: [";
-        {
-            ScopedIndent tgt(this);
-            EmitExpression(expr->target);
-        }
-        Line() << "]";
-
-        if (!expr->args.IsEmpty()) {
-            Line() << "args: [";
-            {
-                ScopedIndent args(this);
-                for (auto* arg : expr->args) {
-                    Line() << "arg: [";
-                    {
-                        ScopedIndent arg_val(this);
-                        EmitExpression(arg);
-                    }
-                    Line() << "]";
-                }
-            }
-            Line() << "]";
-        }
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitLiteral(const ast::LiteralExpression* lit) {
-    Line() << "LiteralExpression [";
-    {
-        ScopedIndent le(this);
-        Switch(
-            lit,  //
-            [&](const ast::BoolLiteralExpression* l) { Line() << (l->value ? "true" : "false"); },
-            [&](const ast::FloatLiteralExpression* l) {
-                // f16 literals are also emitted as float value with suffix "h".
-                // Note that all normal and subnormal f16 values are normal f32 values, and since
-                // NaN and Inf are not allowed to be spelled in literal, it should be fine to emit
-                // f16 literals in this way.
-                if (l->suffix == ast::FloatLiteralExpression::Suffix::kNone) {
-                    Line() << tint::strconv::DoubleToBitPreservingString(l->value);
-                } else {
-                    Line() << tint::strconv::FloatToBitPreservingString(
-                                  static_cast<float>(l->value))
-                           << l->suffix;
-                }
-            },
-            [&](const ast::IntLiteralExpression* l) { Line() << l->value << l->suffix; },  //
-            TINT_ICE_ON_NO_MATCH);
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitIdentifier(const ast::IdentifierExpression* expr) {
-    Line() << "IdentifierExpression [";
-    {
-        ScopedIndent ie(this);
-        EmitIdentifier(expr->identifier);
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitIdentifier(const ast::Identifier* ident) {
-    Line() << "Identifier [";
-    {
-        ScopedIndent id(this);
-        if (auto* tmpl_ident = ident->As<ast::TemplatedIdentifier>()) {
-            Line() << "Templated [";
-            {
-                ScopedIndent tmpl(this);
-                if (!tmpl_ident->attributes.IsEmpty()) {
-                    Line() << "attrs: [";
-                    {
-                        ScopedIndent attrs(this);
-                        EmitAttributes(tmpl_ident->attributes);
-                    }
-                    Line() << "]";
-                }
-                Line() << "name: " << ident->symbol.Name();
-                if (!tmpl_ident->arguments.IsEmpty()) {
-                    Line() << "args: [";
-                    {
-                        ScopedIndent args(this);
-                        for (auto* expr : tmpl_ident->arguments) {
-                            EmitExpression(expr);
-                        }
-                    }
-                    Line() << "]";
-                }
-            }
-            Line() << "]";
-        } else {
-            Line() << ident->symbol.Name();
-        }
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitFunction(const ast::Function* func) {
-    Line() << "Function [";
-    {
-        ScopedIndent funct(this);
-
-        if (func->attributes.Length()) {
-            Line() << "attrs: [";
-            {
-                ScopedIndent attrs(this);
-                EmitAttributes(func->attributes);
-            }
-            Line() << "]";
-        }
-        Line() << "name: " << func->name->symbol.Name();
-
-        if (!func->params.IsEmpty()) {
-            Line() << "params: [";
-            {
-                ScopedIndent args(this);
-                for (auto* v : func->params) {
-                    Line() << "param: [";
-                    {
-                        ScopedIndent param(this);
-                        Line() << "name: " << v->name->symbol.Name();
-                        if (!v->attributes.IsEmpty()) {
-                            Line() << "attrs: [";
-                            {
-                                ScopedIndent attrs(this);
-                                EmitAttributes(v->attributes);
-                            }
-                            Line() << "]";
-                        }
-                        Line() << "type: [";
-                        {
-                            ScopedIndent ty(this);
-                            EmitExpression(v->type);
-                        }
-                        Line() << "]";
-                    }
-                    Line() << "]";
-                }
-            }
-            Line() << "]";
-        }
-
-        Line() << "return: [";
-        {
-            ScopedIndent ret(this);
-
-            if (func->return_type || !func->return_type_attributes.IsEmpty()) {
-                if (!func->return_type_attributes.IsEmpty()) {
-                    Line() << "attrs: [";
-                    {
-                        ScopedIndent attrs(this);
-                        EmitAttributes(func->return_type_attributes);
-                    }
-                    Line() << "]";
-                }
-
-                Line() << "type: [";
-                {
-                    ScopedIndent ty(this);
-                    EmitExpression(func->return_type);
-                }
-                Line() << "]";
-            } else {
-                Line() << "void";
-            }
-        }
-        Line() << "]";
-        Line() << "body: [";
-        {
-            ScopedIndent bdy(this);
-            if (func->body) {
-                EmitBlockHeader(func->body);
-                EmitStatementsWithIndent(func->body->statements);
-            }
-        }
-        Line() << "]";
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitImageFormat(const core::TexelFormat fmt) {
-    Line() << "core::TexelFormat [" << fmt << "]";
-}
-
-void SyntaxTreePrinter::EmitStructType(const ast::Struct* str) {
-    Line() << "Struct [";
-    {
-        ScopedIndent strct(this);
-
-        if (str->attributes.Length()) {
-            Line() << "attrs: [";
-            {
-                ScopedIndent attrs(this);
-                EmitAttributes(str->attributes);
-            }
-            Line() << "]";
-        }
-        Line() << "name: " << str->name->symbol.Name();
-        Line() << "members: [";
-        {
-            ScopedIndent membs(this);
-
-            for (auto* mem : str->members) {
-                Line() << "StructMember[";
-                {
-                    ScopedIndent m(this);
-                    if (!mem->attributes.IsEmpty()) {
-                        Line() << "attrs: [";
-                        {
-                            ScopedIndent attrs(this);
-                            EmitAttributes(mem->attributes);
-                        }
-                        Line() << "]";
-                    }
-
-                    Line() << "name: " << mem->name->symbol.Name();
-                    Line() << "type: [";
-                    {
-                        ScopedIndent ty(this);
-                        EmitExpression(mem->type);
-                    }
-                    Line() << "]";
-                }
-            }
-            Line() << "]";
-        }
-        Line() << "]";
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitVariable(const ast::Variable* v) {
-    Line() << "Variable [";
-    {
-        ScopedIndent variable(this);
-        if (!v->attributes.IsEmpty()) {
-            Line() << "attrs: [";
-            {
-                ScopedIndent attr(this);
-                EmitAttributes(v->attributes);
-            }
-            Line() << "]";
-        }
-
-        Switch(
-            v,  //
-            [&](const ast::Var* var) {
-                if (var->declared_address_space || var->declared_access) {
-                    Line() << "Var [";
-                    {
-                        ScopedIndent vr(this);
-                        Line() << "address_space: [";
-                        {
-                            ScopedIndent addr(this);
-                            EmitExpression(var->declared_address_space);
-                        }
-                        Line() << "]";
-                        if (var->declared_access) {
-                            Line() << "access: [";
-                            {
-                                ScopedIndent acs(this);
-                                EmitExpression(var->declared_access);
-                            }
-                            Line() << "]";
-                        }
-                    }
-                    Line() << "]";
-                } else {
-                    Line() << "Var []";
-                }
-            },
-            [&](const ast::Let*) { Line() << "Let []"; },
-            [&](const ast::Override*) { Line() << "Override []"; },
-            [&](const ast::Const*) { Line() << "Const []"; },  //
-            TINT_ICE_ON_NO_MATCH);
-
-        Line() << "name: " << v->name->symbol.Name();
-
-        if (auto ty = v->type) {
-            Line() << "type: [";
-            {
-                ScopedIndent vty(this);
-                EmitExpression(ty);
-            }
-            Line() << "]";
-        }
-
-        if (v->initializer != nullptr) {
-            Line() << "initializer: [";
-            {
-                ScopedIndent init(this);
-                EmitExpression(v->initializer);
-            }
-            Line() << "]";
-        }
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitAttributes(VectorRef<const ast::Attribute*> attrs) {
-    for (auto* attr : attrs) {
-        Switch(
-            attr,  //
-            [&](const ast::WorkgroupAttribute* workgroup) {
-                auto values = workgroup->Values();
-                Line() << "WorkgroupAttribute [";
-                {
-                    ScopedIndent wg(this);
-                    for (size_t i = 0; i < 3; i++) {
-                        if (values[i]) {
-                            EmitExpression(values[i]);
-                        }
-                    }
-                }
-                Line() << "]";
-            },
-            [&](const ast::StageAttribute* stage) {
-                Line() << "StageAttribute [" << stage->stage << "]";
-            },
-            [&](const ast::BindingAttribute* binding) {
-                Line() << "BindingAttribute [";
-                {
-                    ScopedIndent ba(this);
-                    EmitExpression(binding->expr);
-                }
-                Line() << "]";
-            },
-            [&](const ast::GroupAttribute* group) {
-                Line() << "GroupAttribute [";
-                {
-                    ScopedIndent ga(this);
-                    EmitExpression(group->expr);
-                }
-                Line() << "]";
-            },
-            [&](const ast::LocationAttribute* location) {
-                Line() << "LocationAttribute [";
-                {
-                    ScopedIndent la(this);
-                    EmitExpression(location->expr);
-                }
-                Line() << "]";
-            },
-            [&](const ast::BlendSrcAttribute* index) {
-                Line() << "BlendSrcAttribute [";
-                {
-                    ScopedIndent idx(this);
-                    EmitExpression(index->expr);
-                }
-                Line() << "]";
-            },
-            [&](const ast::BuiltinAttribute* builtin) {
-                Line() << "BuiltinAttribute [" << core::ToString(builtin->builtin) << "]";
-            },
-            [&](const ast::DiagnosticAttribute* diagnostic) {
-                EmitDiagnosticControl(diagnostic->control);
-            },
-            [&](const ast::InterpolateAttribute* interpolate) {
-                Line() << "InterpolateAttribute [";
-                {
-                    ScopedIndent ia(this);
-                    Line() << "type: [";
-                    {
-                        ScopedIndent ty(this);
-                        Line() << core::ToString(interpolate->interpolation.type);
-                    }
-                    Line() << "]";
-                    if (interpolate->interpolation.sampling !=
-                        core::InterpolationSampling::kUndefined) {
-                        Line() << "sampling: [";
-                        {
-                            ScopedIndent sa(this);
-                            Line() << core::ToString(interpolate->interpolation.sampling);
-                        }
-                        Line() << "]";
-                    }
-                }
-                Line() << "]";
-            },
-            [&](const ast::InvariantAttribute*) { Line() << "InvariantAttribute []"; },
-            [&](const ast::IdAttribute* override_deco) {
-                Line() << "IdAttribute [";
-                {
-                    ScopedIndent id(this);
-                    EmitExpression(override_deco->expr);
-                }
-                Line() << "]";
-            },
-            [&](const ast::MustUseAttribute*) { Line() << "MustUseAttribute []"; },
-            [&](const ast::StructMemberOffsetAttribute* offset) {
-                Line() << "StructMemberOffsetAttribute [";
-                {
-                    ScopedIndent smoa(this);
-                    EmitExpression(offset->expr);
-                }
-                Line() << "]";
-            },
-            [&](const ast::StructMemberSizeAttribute* size) {
-                Line() << "StructMemberSizeAttribute [";
-                {
-                    ScopedIndent smsa(this);
-                    EmitExpression(size->expr);
-                }
-                Line() << "]";
-            },
-            [&](const ast::StructMemberAlignAttribute* align) {
-                Line() << "StructMemberAlignAttribute [";
-                {
-                    ScopedIndent smaa(this);
-                    EmitExpression(align->expr);
-                }
-                Line() << "]";
-            },
-            [&](const ast::StrideAttribute* stride) {
-                Line() << "StrideAttribute [" << stride->stride << "]";
-            },
-            [&](const ast::InternalAttribute* internal) {
-                Line() << "InternalAttribute [" << internal->InternalName() << "]";
-            },  //
-            TINT_ICE_ON_NO_MATCH);
-    }
-}
-
-void SyntaxTreePrinter::EmitBinary(const ast::BinaryExpression* expr) {
-    Line() << "BinaryExpression [";
-    {
-        ScopedIndent be(this);
-        Line() << "lhs: [";
-        {
-            ScopedIndent lhs(this);
-
-            EmitExpression(expr->lhs);
-        }
-        Line() << "]";
-        Line() << "op: [";
-        {
-            ScopedIndent op(this);
-            EmitBinaryOp(expr->op);
-        }
-        Line() << "]";
-        Line() << "rhs: [";
-        {
-            ScopedIndent rhs(this);
-            EmitExpression(expr->rhs);
-        }
-        Line() << "]";
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitBinaryOp(const core::BinaryOp op) {
-    switch (op) {
-        case core::BinaryOp::kAnd:
-            Line() << "&";
-            break;
-        case core::BinaryOp::kOr:
-            Line() << "|";
-            break;
-        case core::BinaryOp::kXor:
-            Line() << "^";
-            break;
-        case core::BinaryOp::kLogicalAnd:
-            Line() << "&&";
-            break;
-        case core::BinaryOp::kLogicalOr:
-            Line() << "||";
-            break;
-        case core::BinaryOp::kEqual:
-            Line() << "==";
-            break;
-        case core::BinaryOp::kNotEqual:
-            Line() << "!=";
-            break;
-        case core::BinaryOp::kLessThan:
-            Line() << "<";
-            break;
-        case core::BinaryOp::kGreaterThan:
-            Line() << ">";
-            break;
-        case core::BinaryOp::kLessThanEqual:
-            Line() << "<=";
-            break;
-        case core::BinaryOp::kGreaterThanEqual:
-            Line() << ">=";
-            break;
-        case core::BinaryOp::kShiftLeft:
-            Line() << "<<";
-            break;
-        case core::BinaryOp::kShiftRight:
-            Line() << ">>";
-            break;
-        case core::BinaryOp::kAdd:
-            Line() << "+";
-            break;
-        case core::BinaryOp::kSubtract:
-            Line() << "-";
-            break;
-        case core::BinaryOp::kMultiply:
-            Line() << "*";
-            break;
-        case core::BinaryOp::kDivide:
-            Line() << "/";
-            break;
-        case core::BinaryOp::kModulo:
-            Line() << "%";
-            break;
-    }
-}
-
-void SyntaxTreePrinter::EmitUnaryOp(const ast::UnaryOpExpression* expr) {
-    Line() << "UnaryOpExpression [";
-    {
-        ScopedIndent uoe(this);
-        Line() << "op: [";
-        {
-            ScopedIndent op(this);
-            switch (expr->op) {
-                case core::UnaryOp::kAddressOf:
-                    Line() << "&";
-                    break;
-                case core::UnaryOp::kComplement:
-                    Line() << "~";
-                    break;
-                case core::UnaryOp::kIndirection:
-                    Line() << "*";
-                    break;
-                case core::UnaryOp::kNot:
-                    Line() << "!";
-                    break;
-                case core::UnaryOp::kNegation:
-                    Line() << "-";
-                    break;
-            }
-        }
-        Line() << "]";
-        Line() << "expr: [";
-        {
-            ScopedIndent ex(this);
-            EmitExpression(expr->expr);
-        }
-        Line() << "]";
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitBlock(const ast::BlockStatement* stmt) {
-    EmitBlockHeader(stmt);
-    EmitStatementsWithIndent(stmt->statements);
-}
-
-void SyntaxTreePrinter::EmitBlockHeader(const ast::BlockStatement* stmt) {
-    if (!stmt->attributes.IsEmpty()) {
-        Line() << "attrs: [";
-        {
-            ScopedIndent attrs(this);
-            EmitAttributes(stmt->attributes);
-        }
-        Line() << "]";
-    }
-}
-
-void SyntaxTreePrinter::EmitStatement(const ast::Statement* stmt) {
-    Switch(
-        stmt,  //
-        [&](const ast::AssignmentStatement* a) { EmitAssign(a); },
-        [&](const ast::BlockStatement* b) { EmitBlock(b); },
-        [&](const ast::BreakStatement* b) { EmitBreak(b); },
-        [&](const ast::BreakIfStatement* b) { EmitBreakIf(b); },
-        [&](const ast::CallStatement* c) { EmitCall(c->expr); },
-        [&](const ast::CompoundAssignmentStatement* c) { EmitCompoundAssign(c); },
-        [&](const ast::ContinueStatement* c) { EmitContinue(c); },
-        [&](const ast::DiscardStatement* d) { EmitDiscard(d); },
-        [&](const ast::IfStatement* i) { EmitIf(i); },
-        [&](const ast::IncrementDecrementStatement* l) { EmitIncrementDecrement(l); },
-        [&](const ast::LoopStatement* l) { EmitLoop(l); },
-        [&](const ast::ForLoopStatement* l) { EmitForLoop(l); },
-        [&](const ast::WhileStatement* l) { EmitWhile(l); },
-        [&](const ast::ReturnStatement* r) { EmitReturn(r); },
-        [&](const ast::ConstAssert* c) { EmitConstAssert(c); },
-        [&](const ast::SwitchStatement* s) { EmitSwitch(s); },
-        [&](const ast::VariableDeclStatement* v) { EmitVariable(v->variable); },  //
-        TINT_ICE_ON_NO_MATCH);
-}
-
-void SyntaxTreePrinter::EmitStatements(VectorRef<const ast::Statement*> stmts) {
-    for (auto* s : stmts) {
-        EmitStatement(s);
-    }
-}
-
-void SyntaxTreePrinter::EmitStatementsWithIndent(VectorRef<const ast::Statement*> stmts) {
-    ScopedIndent si(this);
-    EmitStatements(stmts);
-}
-
-void SyntaxTreePrinter::EmitAssign(const ast::AssignmentStatement* stmt) {
-    Line() << "AssignmentStatement [";
-    {
-        ScopedIndent as(this);
-        Line() << "lhs: [";
-        {
-            ScopedIndent lhs(this);
-            EmitExpression(stmt->lhs);
-        }
-        Line() << "]";
-        Line() << "rhs: [";
-        {
-            ScopedIndent rhs(this);
-            EmitExpression(stmt->rhs);
-        }
-        Line() << "]";
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitBreak(const ast::BreakStatement*) {
-    Line() << "BreakStatement []";
-}
-
-void SyntaxTreePrinter::EmitBreakIf(const ast::BreakIfStatement* b) {
-    Line() << "BreakIfStatement [";
-    {
-        ScopedIndent bis(this);
-        EmitExpression(b->condition);
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitCase(const ast::CaseStatement* stmt) {
-    Line() << "CaseStatement [";
-    {
-        ScopedIndent cs(this);
-        if (stmt->selectors.Length() == 1 && stmt->ContainsDefault()) {
-            Line() << "selector: default";
-            EmitBlockHeader(stmt->body);
-        } else {
-            Line() << "selectors: [";
-            {
-                ScopedIndent sels(this);
-                for (auto* sel : stmt->selectors) {
-                    if (sel->IsDefault()) {
-                        Line() << "default []";
-                    } else {
-                        EmitExpression(sel->expr);
-                    }
-                }
-            }
-            Line() << "]";
-            EmitBlockHeader(stmt->body);
-        }
-        EmitStatementsWithIndent(stmt->body->statements);
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitCompoundAssign(const ast::CompoundAssignmentStatement* stmt) {
-    Line() << "CompoundAssignmentStatement [";
-    {
-        ScopedIndent cas(this);
-        Line() << "lhs: [";
-        {
-            ScopedIndent lhs(this);
-            EmitExpression(stmt->lhs);
-        }
-        Line() << "]";
-
-        Line() << "op: [";
-        {
-            ScopedIndent op(this);
-            EmitBinaryOp(stmt->op);
-        }
-        Line() << "]";
-        Line() << "rhs: [";
-        {
-            ScopedIndent rhs(this);
-
-            EmitExpression(stmt->rhs);
-        }
-        Line() << "]";
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitContinue(const ast::ContinueStatement*) {
-    Line() << "ContinueStatement []";
-}
-
-void SyntaxTreePrinter::EmitIf(const ast::IfStatement* stmt) {
-    {
-        Line() << "IfStatement [";
-        {
-            ScopedIndent ifs(this);
-            Line() << "condition: [";
-            {
-                ScopedIndent cond(this);
-                EmitExpression(stmt->condition);
-            }
-            Line() << "]";
-            EmitBlockHeader(stmt->body);
-        }
-        Line() << "] ";
-    }
-    EmitStatementsWithIndent(stmt->body->statements);
-
-    const ast::Statement* e = stmt->else_statement;
-    while (e) {
-        if (auto* elseif = e->As<ast::IfStatement>()) {
-            {
-                Line() << "Else IfStatement [";
-                {
-                    ScopedIndent ifs(this);
-                    Line() << "condition: [";
-                    EmitExpression(elseif->condition);
-                }
-                Line() << "]";
-                EmitBlockHeader(elseif->body);
-            }
-            Line() << "]";
-            EmitStatementsWithIndent(elseif->body->statements);
-            e = elseif->else_statement;
-        } else {
-            auto* body = e->As<ast::BlockStatement>();
-            {
-                Line() << "Else [";
-                {
-                    ScopedIndent els(this);
-                    EmitBlockHeader(body);
-                }
-                Line() << "]";
-            }
-            EmitStatementsWithIndent(body->statements);
-            break;
-        }
-    }
-}
-
-void SyntaxTreePrinter::EmitIncrementDecrement(const ast::IncrementDecrementStatement* stmt) {
-    Line() << "IncrementDecrementStatement [";
-    {
-        ScopedIndent ids(this);
-        Line() << "expr: [";
-        EmitExpression(stmt->lhs);
-        Line() << "]";
-        Line() << "dir: " << (stmt->increment ? "++" : "--");
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitDiscard(const ast::DiscardStatement*) {
-    Line() << "DiscardStatement []";
-}
-
-void SyntaxTreePrinter::EmitLoop(const ast::LoopStatement* stmt) {
-    Line() << "LoopStatement [";
-    {
-        ScopedIndent ls(this);
-        EmitStatements(stmt->body->statements);
-
-        if (stmt->continuing && !stmt->continuing->Empty()) {
-            Line() << "Continuing [";
-            {
-                ScopedIndent cont(this);
-                EmitStatementsWithIndent(stmt->continuing->statements);
-            }
-            Line() << "]";
-        }
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitForLoop(const ast::ForLoopStatement* stmt) {
-    TextBuffer init_buf;
-    if (auto* init = stmt->initializer) {
-        TINT_SCOPED_ASSIGNMENT(current_buffer_, &init_buf);
-        EmitStatement(init);
-    }
-
-    TextBuffer cont_buf;
-    if (auto* cont = stmt->continuing) {
-        TINT_SCOPED_ASSIGNMENT(current_buffer_, &cont_buf);
-        EmitStatement(cont);
-    }
-
-    Line() << "ForLoopStatement [";
-    {
-        ScopedIndent fs(this);
-
-        Line() << "initializer: [";
-        {
-            ScopedIndent init(this);
-            switch (init_buf.lines.size()) {
-                case 0:  // No initializer
-                    break;
-                case 1:  // Single line initializer statement
-                    Line() << tint::TrimSuffix(init_buf.lines[0].content, ";");
-                    break;
-                default:  // Block initializer statement
-                    for (size_t i = 1; i < init_buf.lines.size(); i++) {
-                        // Indent all by the first line
-                        init_buf.lines[i].indent += current_buffer_->current_indent;
-                    }
-                    Line() << tint::TrimSuffix(init_buf.String(), "\n");
-                    break;
-            }
-        }
-        Line() << "]";
-        Line() << "condition: [";
-        {
-            ScopedIndent con(this);
-            if (auto* cond = stmt->condition) {
-                EmitExpression(cond);
-            }
-        }
-
-        Line() << "]";
-        Line() << "continuing: [";
-        {
-            ScopedIndent cont(this);
-            switch (cont_buf.lines.size()) {
-                case 0:  // No continuing
-                    break;
-                case 1:  // Single line continuing statement
-                    Line() << tint::TrimSuffix(cont_buf.lines[0].content, ";");
-                    break;
-                default:  // Block continuing statement
-                    for (size_t i = 1; i < cont_buf.lines.size(); i++) {
-                        // Indent all by the first line
-                        cont_buf.lines[i].indent += current_buffer_->current_indent;
-                    }
-                    Line() << tint::TrimSuffix(cont_buf.String(), "\n");
-                    break;
-            }
-        }
-        EmitBlockHeader(stmt->body);
-        EmitStatementsWithIndent(stmt->body->statements);
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitWhile(const ast::WhileStatement* stmt) {
-    Line() << "WhileStatement [";
-    {
-        ScopedIndent ws(this);
-        EmitExpression(stmt->condition);
-        EmitBlockHeader(stmt->body);
-        EmitStatementsWithIndent(stmt->body->statements);
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitReturn(const ast::ReturnStatement* stmt) {
-    Line() << "ReturnStatement [";
-    {
-        ScopedIndent ret(this);
-        if (stmt->value) {
-            EmitExpression(stmt->value);
-        }
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitConstAssert(const ast::ConstAssert* stmt) {
-    Line() << "ConstAssert [";
-    {
-        ScopedIndent ca(this);
-        EmitExpression(stmt->condition);
-    }
-    Line() << "]";
-}
-
-void SyntaxTreePrinter::EmitSwitch(const ast::SwitchStatement* stmt) {
-    Line() << "SwitchStatement [";
-    {
-        ScopedIndent ss(this);
-        Line() << "condition: [";
-        {
-            ScopedIndent cond(this);
-            EmitExpression(stmt->condition);
-        }
-        Line() << "]";
-
-        {
-            ScopedIndent si(this);
-            for (auto* s : stmt->body) {
-                EmitCase(s);
-            }
-        }
-    }
-    Line() << "]";
-}
-
-}  // namespace tint::wgsl::writer
diff --git a/src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.h b/src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.h
deleted file mode 100644
index be0c98d..0000000
--- a/src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.h
+++ /dev/null
@@ -1,216 +0,0 @@
-// Copyright 2023 The Dawn & Tint Authors
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the copyright holder nor the names of its
-//    contributors may be used to endorse or promote products derived from
-//    this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef SRC_TINT_LANG_WGSL_WRITER_SYNTAX_TREE_PRINTER_SYNTAX_TREE_PRINTER_H_
-#define SRC_TINT_LANG_WGSL_WRITER_SYNTAX_TREE_PRINTER_SYNTAX_TREE_PRINTER_H_
-
-#include "src/tint/lang/wgsl/program/program.h"
-#include "src/tint/utils/text_generator/text_generator.h"
-
-// Forward declarations
-namespace tint::core {
-enum class BinaryOp;
-}
-namespace tint::ast {
-class AssignmentStatement;
-class Attribute;
-class BinaryExpression;
-class BitcastExpression;
-class BlockStatement;
-class BlockStatement;
-class BreakIfStatement;
-class BreakStatement;
-class CallExpression;
-class CaseStatement;
-class CompoundAssignmentStatement;
-class ConstAssert;
-class ContinueStatement;
-struct DiagnosticControl;
-class DiscardStatement;
-class Enable;
-class Expression;
-class ForLoopStatement;
-class Function;
-class Identifier;
-class IdentifierExpression;
-class IfStatement;
-class IncrementDecrementStatement;
-class IndexAccessorExpression;
-class LiteralExpression;
-class LoopStatement;
-class MemberAccessorExpression;
-class ReturnStatement;
-class Statement;
-class Statement;
-class Statement;
-class Struct;
-class SwitchStatement;
-class TypeDecl;
-class UnaryOpExpression;
-class Variable;
-class WhileStatement;
-}  // namespace tint::ast
-namespace tint::core {
-enum class TexelFormat : uint8_t;
-}  // namespace tint::core
-
-namespace tint::wgsl::writer {
-
-/// Implementation class for AST generator
-class SyntaxTreePrinter : public tint::TextGenerator {
-  public:
-    /// Constructor
-    /// @param program the program
-    explicit SyntaxTreePrinter(const Program& program);
-    ~SyntaxTreePrinter() override;
-
-    /// Generates the result data
-    /// @returns true on success.
-    bool Generate();
-
-    /// Handles generating a diagnostic control
-    /// @param diagnostic the diagnostic control node
-    void EmitDiagnosticControl(const ast::DiagnosticControl& diagnostic);
-    /// Handles generating an enable directive
-    /// @param enable the enable node
-    void EmitEnable(const ast::Enable* enable);
-    /// Handles generating a declared type
-    /// @param ty the declared type to generate
-    void EmitTypeDecl(const ast::TypeDecl* ty);
-    /// Handles an index accessor expression
-    /// @param expr the expression to emit
-    void EmitIndexAccessor(const ast::IndexAccessorExpression* expr);
-    /// Handles an assignment statement
-    /// @param stmt the statement to emit
-    void EmitAssign(const ast::AssignmentStatement* stmt);
-    /// Handles generating a binary expression
-    /// @param expr the binary expression
-    void EmitBinary(const ast::BinaryExpression* expr);
-    /// Handles generating a binary operator
-    /// @param op the binary operator
-    void EmitBinaryOp(const core::BinaryOp op);
-    /// Handles a block statement
-    /// @param stmt the statement to emit
-    void EmitBlock(const ast::BlockStatement* stmt);
-    /// Handles emitting the start of a block statement (including attributes)
-    /// @param stmt the block statement to emit the header for
-    void EmitBlockHeader(const ast::BlockStatement* stmt);
-    /// Handles a break statement
-    /// @param stmt the statement to emit
-    void EmitBreak(const ast::BreakStatement* stmt);
-    /// Handles a break-if statement
-    /// @param stmt the statement to emit
-    void EmitBreakIf(const ast::BreakIfStatement* stmt);
-    /// Handles generating a call expression
-    /// @param expr the call expression
-    void EmitCall(const ast::CallExpression* expr);
-    /// Handles a case statement
-    /// @param stmt the statement
-    void EmitCase(const ast::CaseStatement* stmt);
-    /// Handles a compound assignment statement
-    /// @param stmt the statement to emit
-    void EmitCompoundAssign(const ast::CompoundAssignmentStatement* stmt);
-    /// Handles generating a literal expression
-    /// @param expr the literal expression expression
-    void EmitLiteral(const ast::LiteralExpression* expr);
-    /// Handles a continue statement
-    /// @param stmt the statement to emit
-    void EmitContinue(const ast::ContinueStatement* stmt);
-    /// Handles generate an Expression
-    /// @param expr the expression
-    void EmitExpression(const ast::Expression* expr);
-    /// Handles generating a function
-    /// @param func the function to generate
-    void EmitFunction(const ast::Function* func);
-    /// Handles generating an identifier expression
-    /// @param expr the identifier expression
-    void EmitIdentifier(const ast::IdentifierExpression* expr);
-    /// Handles generating an identifier
-    /// @param ident the identifier
-    void EmitIdentifier(const ast::Identifier* ident);
-    /// Handles an if statement
-    /// @param stmt the statement to emit
-    void EmitIf(const ast::IfStatement* stmt);
-    /// Handles an increment/decrement statement
-    /// @param stmt the statement to emit
-    void EmitIncrementDecrement(const ast::IncrementDecrementStatement* stmt);
-    /// Handles generating a discard statement
-    /// @param stmt the discard statement
-    void EmitDiscard(const ast::DiscardStatement* stmt);
-    /// Handles a loop statement
-    /// @param stmt the statement to emit
-    void EmitLoop(const ast::LoopStatement* stmt);
-    /// Handles a for-loop statement
-    /// @param stmt the statement to emit
-    void EmitForLoop(const ast::ForLoopStatement* stmt);
-    /// Handles a while statement
-    /// @param stmt the statement to emit
-    void EmitWhile(const ast::WhileStatement* stmt);
-    /// Handles a member accessor expression
-    /// @param expr the member accessor expression
-    void EmitMemberAccessor(const ast::MemberAccessorExpression* expr);
-    /// Handles return statements
-    /// @param stmt the statement to emit
-    void EmitReturn(const ast::ReturnStatement* stmt);
-    /// Handles const assertion statements
-    /// @param stmt the statement to emit
-    void EmitConstAssert(const ast::ConstAssert* stmt);
-    /// Handles statement
-    /// @param stmt the statement to emit
-    void EmitStatement(const ast::Statement* stmt);
-    /// Handles a statement list
-    /// @param stmts the statements to emit
-    void EmitStatements(VectorRef<const ast::Statement*> stmts);
-    /// Handles a statement list with an increased indentation
-    /// @param stmts the statements to emit
-    void EmitStatementsWithIndent(VectorRef<const ast::Statement*> stmts);
-    /// Handles generating a switch statement
-    /// @param stmt the statement to emit
-    void EmitSwitch(const ast::SwitchStatement* stmt);
-    /// Handles generating a struct declaration
-    /// @param str the struct
-    void EmitStructType(const ast::Struct* str);
-    /// Handles emitting an image format
-    /// @param fmt the format to generate
-    void EmitImageFormat(const core::TexelFormat fmt);
-    /// Handles a unary op expression
-    /// @param expr the expression to emit
-    void EmitUnaryOp(const ast::UnaryOpExpression* expr);
-    /// Handles generating a variable
-    /// @param var the variable to generate
-    void EmitVariable(const ast::Variable* var);
-    /// Handles generating a attribute list
-    /// @param attrs the attribute list
-    void EmitAttributes(VectorRef<const ast::Attribute*> attrs);
-
-  private:
-    const Program& program_;
-};
-
-}  // namespace tint::wgsl::writer
-
-#endif  // SRC_TINT_LANG_WGSL_WRITER_SYNTAX_TREE_PRINTER_SYNTAX_TREE_PRINTER_H_
diff --git a/src/tint/lang/wgsl/writer/writer.cc b/src/tint/lang/wgsl/writer/writer.cc
index 5b80391..68266d0 100644
--- a/src/tint/lang/wgsl/writer/writer.cc
+++ b/src/tint/lang/wgsl/writer/writer.cc
@@ -34,34 +34,17 @@
 #include "src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.h"
 #include "src/tint/lang/wgsl/writer/raise/raise.h"
 
-#if TINT_BUILD_SYNTAX_TREE_WRITER
-#include "src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.h"
-#endif  // TINT_BUILD_SYNTAX_TREE_WRITER
-
 namespace tint::wgsl::writer {
 
-Result<Output> Generate(const Program& program, const Options& options) {
-    (void)options;
-
+Result<Output> Generate(const Program& program) {
     Output output;
-#if TINT_BUILD_SYNTAX_TREE_WRITER
-    if (options.use_syntax_tree_writer) {
-        // Generate the WGSL code.
-        auto impl = std::make_unique<SyntaxTreePrinter>(program);
-        if (!impl->Generate()) {
-            return Failure{impl->Diagnostics().Str()};
-        }
-        output.wgsl = impl->Result();
-    } else  // NOLINT(readability/braces)
-#endif
-    {
-        // Generate the WGSL code.
-        auto impl = std::make_unique<ASTPrinter>(program);
-        if (!impl->Generate()) {
-            return Failure{impl->Diagnostics().Str()};
-        }
-        output.wgsl = impl->Result();
+
+    // Generate the WGSL code.
+    auto impl = std::make_unique<ASTPrinter>(program);
+    if (!impl->Generate()) {
+        return Failure{impl->Diagnostics().Str()};
     }
+    output.wgsl = impl->Result();
 
     return output;
 }
@@ -71,7 +54,7 @@
     if (res != Success) {
         return res.Failure();
     }
-    return Generate(res.Move(), Options{});
+    return Generate(res.Move());
 }
 
 Result<Program> ProgramFromIR(core::ir::Module& module, const ProgramOptions& options) {
diff --git a/src/tint/lang/wgsl/writer/writer.h b/src/tint/lang/wgsl/writer/writer.h
index 28d1de8..e418fd4 100644
--- a/src/tint/lang/wgsl/writer/writer.h
+++ b/src/tint/lang/wgsl/writer/writer.h
@@ -29,7 +29,6 @@
 #define SRC_TINT_LANG_WGSL_WRITER_WRITER_H_
 
 #include "src/tint/lang/wgsl/writer/ir_to_program/program_options.h"
-#include "src/tint/lang/wgsl/writer/options.h"
 #include "src/tint/lang/wgsl/writer/output.h"
 #include "src/tint/utils/result.h"
 
@@ -46,9 +45,8 @@
 /// Generate WGSL for a program, according to a set of configuration options.
 /// The result will contain the WGSL, or failure.
 /// @param program the program to translate to WGSL
-/// @param options the configuration options to use when generating WGSL
 /// @returns the resulting WGSL, or failure
-Result<Output> Generate(const Program& program, const Options& options);
+Result<Output> Generate(const Program& program);
 
 /// Generate WGSL from a core-dialect ir::Module.
 /// @param module the core-dialect ir::Module.
diff --git a/src/tint/lang/wgsl/writer/writer_fuzz.cc b/src/tint/lang/wgsl/writer/writer_fuzz.cc
index dea3eff..6957449 100644
--- a/src/tint/lang/wgsl/writer/writer_fuzz.cc
+++ b/src/tint/lang/wgsl/writer/writer_fuzz.cc
@@ -35,7 +35,7 @@
 namespace {
 
 void WriterFuzzer(const tint::Program& program) {
-    auto output = tint::wgsl::writer::Generate(program, {});
+    auto output = tint::wgsl::writer::Generate(program);
     if (output != Success) {
         TINT_ICE() << "Generate() failed: " << output.Failure().reason;
     }
diff --git a/src/tint/lang/wgsl/writer/writer_test.cc b/src/tint/lang/wgsl/writer/writer_test.cc
index f022814..8760db2 100644
--- a/src/tint/lang/wgsl/writer/writer_test.cc
+++ b/src/tint/lang/wgsl/writer/writer_test.cc
@@ -86,7 +86,7 @@
             return result;
         }
 
-        auto output = wgsl::writer::Generate(output_program, {});
+        auto output = wgsl::writer::Generate(output_program);
         if (output != Success) {
             std::stringstream ss;
             ss << "wgsl::Generate() errored: " << output.Failure();