From b07b920f309742ac46f32b2836fed3c03946d63a Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 26 Aug 2024 18:00:51 +0000 Subject: [PATCH] `cmd` headers cleanup This CL removes extraneous headers from the `tint/cmd` files. Change-Id: I8dd09d38100297c8a3654cbbbed5f6a850770ff4 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/203855 Reviewed-by: James Price Commit-Queue: dan sinclair --- src/tint/cmd/bench/bench.cc | 1 + src/tint/cmd/bench/bench.h | 6 ++---- src/tint/cmd/bench/main_bench.cc | 1 - src/tint/cmd/common/helper.cc | 1 - src/tint/cmd/fuzz/ir/as/main.cc | 2 -- src/tint/cmd/fuzz/wgsl/main_fuzz.cc | 2 -- src/tint/cmd/info/BUILD.bazel | 19 ------------------- src/tint/cmd/info/BUILD.cmake | 7 ------- src/tint/cmd/info/BUILD.gn | 8 -------- src/tint/cmd/info/main.cc | 7 ------- src/tint/cmd/loopy/main.cc | 1 - src/tint/cmd/tint/BUILD.bazel | 11 ----------- src/tint/cmd/tint/BUILD.cmake | 7 ------- src/tint/cmd/tint/BUILD.gn | 5 ----- src/tint/cmd/tint/main.cc | 6 ------ 15 files changed, 3 insertions(+), 81 deletions(-) diff --git a/src/tint/cmd/bench/bench.cc b/src/tint/cmd/bench/bench.cc index 5c21469b5d3..81e285be396 100644 --- a/src/tint/cmd/bench/bench.cc +++ b/src/tint/cmd/bench/bench.cc @@ -29,6 +29,7 @@ #include +#include "src/tint/cmd/bench/inputs_bench.h" #include "src/tint/lang/wgsl/reader/reader.h" namespace tint::bench { diff --git a/src/tint/cmd/bench/bench.h b/src/tint/cmd/bench/bench.h index 26bed0f7b60..3ae39dc0dec 100644 --- a/src/tint/cmd/bench/bench.h +++ b/src/tint/cmd/bench/bench.h @@ -30,13 +30,11 @@ #include #include -#include -#include "benchmark/benchmark.h" -#include "src/tint/cmd/bench/inputs_bench.h" +#include "benchmark/benchmark.h" // IWYU pragma: export +#include "src/tint/cmd/bench/inputs_bench.h" // IWYU pragma: export #include "src/tint/lang/wgsl/program/program.h" #include "src/tint/utils/macros/compiler.h" -#include "src/tint/utils/macros/concat.h" #include "src/tint/utils/result/result.h" namespace tint::bench { diff --git a/src/tint/cmd/bench/main_bench.cc b/src/tint/cmd/bench/main_bench.cc index b270f65805d..cc97bd31279 100644 --- a/src/tint/cmd/bench/main_bench.cc +++ b/src/tint/cmd/bench/main_bench.cc @@ -25,7 +25,6 @@ // 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 #include #include "src/tint/cmd/bench/bench.h" diff --git a/src/tint/cmd/common/helper.cc b/src/tint/cmd/common/helper.cc index ffe4dc9fdbb..7c2a99476d3 100644 --- a/src/tint/cmd/common/helper.cc +++ b/src/tint/cmd/common/helper.cc @@ -38,7 +38,6 @@ #endif #if TINT_BUILD_WGSL_WRITER -#include "src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.h" #include "src/tint/lang/wgsl/writer/writer.h" #endif diff --git a/src/tint/cmd/fuzz/ir/as/main.cc b/src/tint/cmd/fuzz/ir/as/main.cc index 64b6c4985f3..b81db3dedf4 100644 --- a/src/tint/cmd/fuzz/ir/as/main.cc +++ b/src/tint/cmd/fuzz/ir/as/main.cc @@ -29,7 +29,6 @@ #include #include #include -#include "src/tint/lang/wgsl/sem/variable.h" #include "src/tint/api/tint.h" #include "src/tint/cmd/common/helper.h" @@ -39,7 +38,6 @@ #include "src/tint/lang/core/ir/validator.h" #include "src/tint/lang/wgsl/ast/module.h" #include "src/tint/lang/wgsl/helpers/apply_substitute_overrides.h" -#include "src/tint/lang/wgsl/helpers/flatten_bindings.h" #include "src/tint/lang/wgsl/reader/reader.h" #include "src/tint/utils/cli/cli.h" #include "src/tint/utils/containers/transform.h" diff --git a/src/tint/cmd/fuzz/wgsl/main_fuzz.cc b/src/tint/cmd/fuzz/wgsl/main_fuzz.cc index 853d0c6395b..5f8c6622f8d 100644 --- a/src/tint/cmd/fuzz/wgsl/main_fuzz.cc +++ b/src/tint/cmd/fuzz/wgsl/main_fuzz.cc @@ -27,12 +27,10 @@ #include #include -#include #include "src/tint/cmd/fuzz/wgsl/fuzz.h" #include "src/tint/utils/cli/cli.h" #include "src/tint/utils/command/command.h" -#include "src/tint/utils/macros/defer.h" #include "src/tint/utils/text/base64.h" #include "src/tint/utils/text/string.h" diff --git a/src/tint/cmd/info/BUILD.bazel b/src/tint/cmd/info/BUILD.bazel index 6d0b8f9e567..a0da15d01d8 100644 --- a/src/tint/cmd/info/BUILD.bazel +++ b/src/tint/cmd/info/BUILD.bazel @@ -54,7 +54,6 @@ cc_binary( "//src/tint/lang/wgsl/inspector", "//src/tint/lang/wgsl/program", "//src/tint/lang/wgsl/sem", - "//src/tint/utils/command", "//src/tint/utils/containers", "//src/tint/utils/diagnostic", "//src/tint/utils/ice", @@ -73,11 +72,6 @@ cc_binary( "//src/tint/lang/spirv/reader/common", ], "//conditions:default": [], - }) + select({ - ":tint_build_spv_reader_or_tint_build_spv_writer": [ - "@spirv_tools", - ], - "//conditions:default": [], }), copts = COPTS, visibility = ["//visibility:public"], @@ -88,16 +82,3 @@ alias( actual = "//src/tint:tint_build_spv_reader_true", ) -alias( - name = "tint_build_spv_writer", - actual = "//src/tint:tint_build_spv_writer_true", -) - -selects.config_setting_group( - name = "tint_build_spv_reader_or_tint_build_spv_writer", - match_any = [ - "tint_build_spv_reader", - "tint_build_spv_writer", - ], -) - diff --git a/src/tint/cmd/info/BUILD.cmake b/src/tint/cmd/info/BUILD.cmake index dda56b95ce8..67e4554582e 100644 --- a/src/tint/cmd/info/BUILD.cmake +++ b/src/tint/cmd/info/BUILD.cmake @@ -55,7 +55,6 @@ tint_target_add_dependencies(tint_cmd_info_cmd cmd tint_lang_wgsl_inspector tint_lang_wgsl_program tint_lang_wgsl_sem - tint_utils_command tint_utils_containers tint_utils_diagnostic tint_utils_ice @@ -77,10 +76,4 @@ if(TINT_BUILD_SPV_READER) ) endif(TINT_BUILD_SPV_READER) -if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER) - tint_target_add_external_dependencies(tint_cmd_info_cmd cmd - "spirv-tools" - ) -endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER) - tint_target_set_output_name(tint_cmd_info_cmd cmd "tint_info") diff --git a/src/tint/cmd/info/BUILD.gn b/src/tint/cmd/info/BUILD.gn index 5f06fcd7cd5..96e0cf1eeb5 100644 --- a/src/tint/cmd/info/BUILD.gn +++ b/src/tint/cmd/info/BUILD.gn @@ -54,7 +54,6 @@ tint_executable("info") { "${tint_src_dir}/lang/wgsl/inspector", "${tint_src_dir}/lang/wgsl/program", "${tint_src_dir}/lang/wgsl/sem", - "${tint_src_dir}/utils/command", "${tint_src_dir}/utils/containers", "${tint_src_dir}/utils/diagnostic", "${tint_src_dir}/utils/ice", @@ -73,11 +72,4 @@ tint_executable("info") { if (tint_build_spv_reader) { deps += [ "${tint_src_dir}/lang/spirv/reader/common" ] } - - if (tint_build_spv_reader || tint_build_spv_writer) { - deps += [ - "${tint_spirv_tools_dir}:spvtools_headers", - "${tint_spirv_tools_dir}:spvtools_val", - ] - } } diff --git a/src/tint/cmd/info/main.cc b/src/tint/cmd/info/main.cc index 97623d04706..ae35de96ff5 100644 --- a/src/tint/cmd/info/main.cc +++ b/src/tint/cmd/info/main.cc @@ -30,16 +30,9 @@ #include "src/tint/utils/text/styled_text_printer.h" -#if TINT_BUILD_SPV_READER -#include "spirv-tools/libspirv.hpp" -#endif // TINT_BUILD_SPV_READER - #include "src/tint/cmd/common/helper.h" #include "src/tint/lang/core/type/struct.h" -#include "src/tint/lang/wgsl/ast/module.h" #include "src/tint/lang/wgsl/inspector/entry_point.h" -#include "src/tint/utils/command/command.h" -#include "src/tint/utils/containers/transform.h" #include "src/tint/utils/text/string.h" namespace { diff --git a/src/tint/cmd/loopy/main.cc b/src/tint/cmd/loopy/main.cc index f414d327e1d..3b02cc899e3 100644 --- a/src/tint/cmd/loopy/main.cc +++ b/src/tint/cmd/loopy/main.cc @@ -29,7 +29,6 @@ #include "src/tint/api/tint.h" #include "src/tint/cmd/common/helper.h" -#include "src/tint/lang/core/ir/module.h" #if TINT_BUILD_GLSL_WRITER #include "src/tint/lang/glsl/writer/helpers/generate_bindings.h" diff --git a/src/tint/cmd/tint/BUILD.bazel b/src/tint/cmd/tint/BUILD.bazel index a1ea7892ebb..20bcb5c6278 100644 --- a/src/tint/cmd/tint/BUILD.bazel +++ b/src/tint/cmd/tint/BUILD.bazel @@ -75,7 +75,6 @@ cc_binary( "//src/tint/utils/rtti", "//src/tint/utils/strconv", "//src/tint/utils/symbol", - "//src/tint/utils/system", "//src/tint/utils/text", "//src/tint/utils/traits", ] + select({ @@ -96,11 +95,6 @@ cc_binary( "//src/tint/lang/hlsl/writer", ], "//conditions:default": [], - }) + select({ - ":tint_build_ir_binary": [ - "//src/tint/lang/core/ir/binary", - ], - "//conditions:default": [], }) + select({ ":tint_build_msl_writer": [ "//src/tint/lang/msl/validate", @@ -157,11 +151,6 @@ alias( actual = "//src/tint:tint_build_hlsl_writer_true", ) -alias( - name = "tint_build_ir_binary", - actual = "//src/tint:tint_build_ir_binary_true", -) - alias( name = "tint_build_msl_writer", actual = "//src/tint:tint_build_msl_writer_true", diff --git a/src/tint/cmd/tint/BUILD.cmake b/src/tint/cmd/tint/BUILD.cmake index a9c5e6af466..7b9a8bb1172 100644 --- a/src/tint/cmd/tint/BUILD.cmake +++ b/src/tint/cmd/tint/BUILD.cmake @@ -76,7 +76,6 @@ tint_target_add_dependencies(tint_cmd_tint_cmd cmd tint_utils_rtti tint_utils_strconv tint_utils_symbol - tint_utils_system tint_utils_text tint_utils_traits ) @@ -102,12 +101,6 @@ if(TINT_BUILD_HLSL_WRITER) ) endif(TINT_BUILD_HLSL_WRITER) -if(TINT_BUILD_IR_BINARY) - tint_target_add_dependencies(tint_cmd_tint_cmd cmd - tint_lang_core_ir_binary - ) -endif(TINT_BUILD_IR_BINARY) - if(TINT_BUILD_MSL_WRITER) tint_target_add_dependencies(tint_cmd_tint_cmd cmd tint_lang_msl_validate diff --git a/src/tint/cmd/tint/BUILD.gn b/src/tint/cmd/tint/BUILD.gn index 8244381a630..d0eef178ba4 100644 --- a/src/tint/cmd/tint/BUILD.gn +++ b/src/tint/cmd/tint/BUILD.gn @@ -75,7 +75,6 @@ tint_executable("tint") { "${tint_src_dir}/utils/rtti", "${tint_src_dir}/utils/strconv", "${tint_src_dir}/utils/symbol", - "${tint_src_dir}/utils/system", "${tint_src_dir}/utils/text", "${tint_src_dir}/utils/traits", ] @@ -99,10 +98,6 @@ tint_executable("tint") { ] } - if (tint_build_ir_binary) { - deps += [ "${tint_src_dir}/lang/core/ir/binary" ] - } - if (tint_build_msl_writer) { deps += [ "${tint_src_dir}/lang/msl/validate", diff --git a/src/tint/cmd/tint/main.cc b/src/tint/cmd/tint/main.cc index 56e33f1fb83..b08ba434eff 100644 --- a/src/tint/cmd/tint/main.cc +++ b/src/tint/cmd/tint/main.cc @@ -43,7 +43,6 @@ #include "src/tint/api/tint.h" #include "src/tint/cmd/common/helper.h" #include "src/tint/lang/core/ir/disassembler.h" -#include "src/tint/lang/core/ir/module.h" #include "src/tint/lang/wgsl/ast/module.h" #include "src/tint/lang/wgsl/ast/transform/first_index_offset.h" #include "src/tint/lang/wgsl/ast/transform/manager.h" @@ -57,21 +56,16 @@ #include "src/tint/utils/containers/transform.h" #include "src/tint/utils/diagnostic/formatter.h" #include "src/tint/utils/macros/defer.h" -#include "src/tint/utils/system/env.h" -#include "src/tint/utils/system/terminal.h" #include "src/tint/utils/text/string.h" #include "src/tint/utils/text/string_stream.h" #include "src/tint/utils/text/styled_text.h" #include "src/tint/utils/text/styled_text_printer.h" -#include "src/tint/utils/text/styled_text_theme.h" #if TINT_BUILD_WGSL_READER #include "src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h" #include "src/tint/lang/wgsl/reader/reader.h" #if TINT_BUILD_IR_BINARY -#include "src/tint/lang/core/ir/binary/encode.h" -#include "src/tint/lang/core/ir/validator.h" #include "src/tint/lang/wgsl/helpers/apply_substitute_overrides.h" #endif // TINT_BUILD_IR_BINARY