From 95dc1ad0601538ecb5744d944bca90d325183056 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Wed, 15 Feb 2023 04:37:30 +0000 Subject: [PATCH] Remove duplicated AST and SEM headers in BUILD.gn This CL updates the BUILD.gn script to have a dedicated AST headers target. This can then be depended on by the AST, SEM and program target. Change-Id: I0fd3a9eb3bffbf5b7d76eee3d44109ee5c5df431 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119903 Auto-Submit: Dan Sinclair Reviewed-by: Ben Clayton Commit-Queue: Dan Sinclair Kokoro: Kokoro --- src/tint/BUILD.gn | 347 ++++++++++++++++++---------------------------- 1 file changed, 137 insertions(+), 210 deletions(-) diff --git a/src/tint/BUILD.gn b/src/tint/BUILD.gn index 8ea182adeb..f0ca1dd33c 100644 --- a/src/tint/BUILD.gn +++ b/src/tint/BUILD.gn @@ -128,8 +128,9 @@ source_set("tint_val") { "val/val.h", ] deps = [ + ":libtint_ast_src", ":libtint_base_src", - ":libtint_syntax_tree_src", + ":libtint_program_src", ":tint_utils_io", ] } @@ -235,90 +236,16 @@ libtint_source_set("libtint_base_src") { deps = [ ":libtint_text_src" ] } -libtint_source_set("libtint_syntax_tree_src") { +libtint_source_set("libtint_clone_context_hdrs") { + sources = [ "clone_context.h" ] + deps = [ ":libtint_base_src" ] +} + +libtint_source_set("libtint_program_src") { sources = [ - "ast/accessor_expression.h", - "ast/alias.h", - "ast/assignment_statement.h", - "ast/attribute.h", - "ast/binary_expression.h", - "ast/binding_attribute.h", - "ast/bitcast_expression.h", - "ast/block_statement.h", - "ast/bool_literal_expression.h", - "ast/break_if_statement.h", - "ast/break_statement.h", - "ast/builtin_attribute.h", - "ast/builtin_value.h", - "ast/call_expression.h", - "ast/call_statement.h", - "ast/case_selector.h", - "ast/case_statement.h", - "ast/compound_assignment_statement.h", - "ast/const.h", - "ast/const_assert.h", - "ast/continue_statement.h", - "ast/diagnostic_attribute.h", - "ast/diagnostic_control.h", - "ast/diagnostic_directive.h", - "ast/disable_validation_attribute.h", - "ast/discard_statement.h", - "ast/enable.h", - "ast/expression.h", - "ast/extension.h", - "ast/float_literal_expression.h", - "ast/for_loop_statement.h", - "ast/function.h", - "ast/group_attribute.h", - "ast/id_attribute.h", - "ast/identifier.h", - "ast/identifier_expression.h", - "ast/if_statement.h", - "ast/increment_decrement_statement.h", - "ast/index_accessor_expression.h", - "ast/int_literal_expression.h", - "ast/internal_attribute.h", - "ast/interpolate_attribute.h", - "ast/invariant_attribute.h", - "ast/let.h", - "ast/literal_expression.h", - "ast/location_attribute.h", - "ast/loop_statement.h", - "ast/member_accessor_expression.h", - "ast/module.h", - "ast/node.h", - "ast/node_id.h", - "ast/override.h", - "ast/parameter.h", - "ast/phony_expression.h", - "ast/pipeline_stage.h", - "ast/return_statement.h", - "ast/stage_attribute.h", - "ast/statement.h", - "ast/stride_attribute.h", - "ast/struct.h", - "ast/struct_member.h", - "ast/struct_member_align_attribute.h", - "ast/struct_member_offset_attribute.h", - "ast/struct_member_size_attribute.h", - "ast/switch_statement.h", - "ast/templated_identifier.h", - "ast/traverse_expressions.h", - "ast/type.h", - "ast/type_decl.h", - "ast/unary_op.h", - "ast/unary_op_expression.h", - "ast/var.h", - "ast/variable.h", - "ast/variable_decl_statement.h", - "ast/while_statement.h", - "ast/workgroup_attribute.h", "clone_context.cc", - "clone_context.h", "program.cc", - "program.h", "program_builder.cc", - "program_builder.h", "resolver/const_eval.cc", "resolver/const_eval.h", "resolver/dependency_graph.cc", @@ -329,55 +256,29 @@ libtint_source_set("libtint_syntax_tree_src") { "resolver/intrinsic_table.h", "resolver/intrinsic_table.inl", "resolver/resolver.cc", - "resolver/resolver.h", "resolver/sem_helper.cc", "resolver/sem_helper.h", "resolver/uniformity.cc", "resolver/uniformity.h", "resolver/validator.cc", "resolver/validator.h", - "sem/array_count.h", - "sem/behavior.h", - "sem/binding_point.h", - "sem/block_statement.h", - "sem/break_if_statement.h", - "sem/builtin.h", - "sem/builtin_enum_expression.h", - "sem/builtin_type.h", - "sem/call.h", - "sem/call_target.h", - "sem/evaluation_stage.h", - "sem/expression.h", - "sem/for_loop_statement.h", - "sem/function.h", - "sem/function_expression.h", - "sem/if_statement.h", - "sem/index_accessor_expression.h", - "sem/info.h", - "sem/load.h", - "sem/loop_statement.h", - "sem/materialize.h", - "sem/member_accessor_expression.h", - "sem/module.h", - "sem/node.h", - "sem/parameter_usage.h", - "sem/pipeline_stage_set.h", - "sem/sampler_texture_pair.h", - "sem/statement.h", - "sem/struct.h", - "sem/switch_statement.h", - "sem/type_conversion.h", - "sem/type_expression.h", - "sem/type_initializer.h", - "sem/type_mappings.h", - "sem/value_expression.h", - "sem/variable.h", - "sem/while_statement.h", + ] + public = [ + "program.h", + "program_builder.h", + "resolver/resolver.h", + ] + friend = [ + ":tint_unittests_resolver_src", # For resolver test access ] + public_deps = [ ":libtint_clone_context_hdrs" ] + deps = [ + ":libtint_ast_hdrs", ":libtint_base_src", ":libtint_constant_src", + ":libtint_sem_src", ":libtint_text_src", ":libtint_type_src", ] @@ -388,7 +289,7 @@ libtint_source_set("libtint_demangler_src") { "demangler.cc", "demangler.h", ] - deps = [ ":libtint_syntax_tree_src" ] + deps = [ ":libtint_program_src" ] } libtint_source_set("libtint_initializer_src") { @@ -407,8 +308,10 @@ libtint_source_set("libtint_inspector_src") { "inspector/scalar.h", ] deps = [ + ":libtint_ast_src", ":libtint_base_src", - ":libtint_syntax_tree_src", + ":libtint_program_src", + ":libtint_sem_src", ":libtint_type_src", ] } @@ -526,169 +429,182 @@ libtint_source_set("libtint_transform_src") { "transform/zero_init_workgroup_memory.h", ] deps = [ + ":libtint_ast_src", ":libtint_base_src", - ":libtint_syntax_tree_src", + ":libtint_program_src", + ":libtint_sem_src", ":libtint_text_src", ":libtint_type_src", ] } +libtint_source_set("libtint_ast_hdrs") { + sources = [ + "ast/accessor_expression.h", + "ast/alias.h", + "ast/assignment_statement.h", + "ast/attribute.h", + "ast/binary_expression.h", + "ast/binding_attribute.h", + "ast/bitcast_expression.h", + "ast/block_statement.h", + "ast/bool_literal_expression.h", + "ast/break_if_statement.h", + "ast/break_statement.h", + "ast/builtin_attribute.h", + "ast/builtin_value.h", + "ast/call_expression.h", + "ast/call_statement.h", + "ast/case_selector.h", + "ast/case_statement.h", + "ast/compound_assignment_statement.h", + "ast/const.h", + "ast/const_assert.h", + "ast/continue_statement.h", + "ast/diagnostic_attribute.h", + "ast/diagnostic_control.h", + "ast/diagnostic_directive.h", + "ast/disable_validation_attribute.h", + "ast/discard_statement.h", + "ast/enable.h", + "ast/expression.h", + "ast/extension.h", + "ast/float_literal_expression.h", + "ast/for_loop_statement.h", + "ast/function.h", + "ast/group_attribute.h", + "ast/id_attribute.h", + "ast/identifier.h", + "ast/identifier_expression.h", + "ast/if_statement.h", + "ast/increment_decrement_statement.h", + "ast/index_accessor_expression.h", + "ast/int_literal_expression.h", + "ast/internal_attribute.h", + "ast/interpolate_attribute.h", + "ast/invariant_attribute.h", + "ast/let.h", + "ast/literal_expression.h", + "ast/location_attribute.h", + "ast/loop_statement.h", + "ast/member_accessor_expression.h", + "ast/module.h", + "ast/node.h", + "ast/node_id.h", + "ast/override.h", + "ast/parameter.h", + "ast/phony_expression.h", + "ast/pipeline_stage.h", + "ast/return_statement.h", + "ast/stage_attribute.h", + "ast/statement.h", + "ast/stride_attribute.h", + "ast/struct.h", + "ast/struct_member.h", + "ast/struct_member_align_attribute.h", + "ast/struct_member_offset_attribute.h", + "ast/struct_member_size_attribute.h", + "ast/switch_statement.h", + "ast/templated_identifier.h", + "ast/traverse_expressions.h", + "ast/type.h", + "ast/type_decl.h", + "ast/unary_op.h", + "ast/unary_op_expression.h", + "ast/var.h", + "ast/variable.h", + "ast/variable_decl_statement.h", + "ast/while_statement.h", + "ast/workgroup_attribute.h", + ] + deps = [ + ":libtint_base_src", + ":libtint_clone_context_hdrs", + ":libtint_type_src", + ] +} + libtint_source_set("libtint_ast_src") { sources = [ "ast/accessor_expression.cc", - "ast/accessor_expression.h", "ast/alias.cc", - "ast/alias.h", "ast/assignment_statement.cc", - "ast/assignment_statement.h", "ast/attribute.cc", - "ast/attribute.h", "ast/binary_expression.cc", - "ast/binary_expression.h", "ast/binding_attribute.cc", - "ast/binding_attribute.h", "ast/bitcast_expression.cc", - "ast/bitcast_expression.h", "ast/block_statement.cc", - "ast/block_statement.h", "ast/bool_literal_expression.cc", - "ast/bool_literal_expression.h", "ast/break_if_statement.cc", - "ast/break_if_statement.h", "ast/break_statement.cc", - "ast/break_statement.h", "ast/builtin_attribute.cc", - "ast/builtin_attribute.h", "ast/builtin_value.cc", - "ast/builtin_value.h", "ast/call_expression.cc", - "ast/call_expression.h", "ast/call_statement.cc", - "ast/call_statement.h", "ast/case_selector.cc", - "ast/case_selector.h", "ast/case_statement.cc", - "ast/case_statement.h", "ast/compound_assignment_statement.cc", - "ast/compound_assignment_statement.h", "ast/const.cc", - "ast/const.h", "ast/const_assert.cc", - "ast/const_assert.h", "ast/continue_statement.cc", - "ast/continue_statement.h", "ast/diagnostic_attribute.cc", - "ast/diagnostic_attribute.h", "ast/diagnostic_control.cc", - "ast/diagnostic_control.h", "ast/diagnostic_directive.cc", - "ast/diagnostic_directive.h", "ast/disable_validation_attribute.cc", - "ast/disable_validation_attribute.h", "ast/discard_statement.cc", - "ast/discard_statement.h", "ast/enable.cc", - "ast/enable.h", "ast/expression.cc", - "ast/expression.h", "ast/extension.cc", - "ast/extension.h", "ast/float_literal_expression.cc", - "ast/float_literal_expression.h", "ast/for_loop_statement.cc", - "ast/for_loop_statement.h", "ast/function.cc", - "ast/function.h", "ast/group_attribute.cc", - "ast/group_attribute.h", "ast/id_attribute.cc", - "ast/id_attribute.h", "ast/identifier.cc", - "ast/identifier.h", "ast/identifier_expression.cc", - "ast/identifier_expression.h", "ast/if_statement.cc", - "ast/if_statement.h", "ast/increment_decrement_statement.cc", - "ast/increment_decrement_statement.h", "ast/index_accessor_expression.cc", - "ast/index_accessor_expression.h", "ast/int_literal_expression.cc", - "ast/int_literal_expression.h", "ast/internal_attribute.cc", - "ast/internal_attribute.h", "ast/interpolate_attribute.cc", - "ast/interpolate_attribute.h", "ast/invariant_attribute.cc", - "ast/invariant_attribute.h", "ast/let.cc", - "ast/let.h", "ast/literal_expression.cc", - "ast/literal_expression.h", "ast/location_attribute.cc", - "ast/location_attribute.h", "ast/loop_statement.cc", - "ast/loop_statement.h", "ast/member_accessor_expression.cc", - "ast/member_accessor_expression.h", "ast/module.cc", - "ast/module.h", "ast/node.cc", - "ast/node.h", - "ast/node_id.h", "ast/override.cc", - "ast/override.h", "ast/parameter.cc", - "ast/parameter.h", "ast/phony_expression.cc", - "ast/phony_expression.h", "ast/pipeline_stage.cc", - "ast/pipeline_stage.h", "ast/return_statement.cc", - "ast/return_statement.h", "ast/stage_attribute.cc", - "ast/stage_attribute.h", "ast/statement.cc", - "ast/statement.h", "ast/stride_attribute.cc", - "ast/stride_attribute.h", "ast/struct.cc", - "ast/struct.h", "ast/struct_member.cc", - "ast/struct_member.h", "ast/struct_member_align_attribute.cc", - "ast/struct_member_align_attribute.h", "ast/struct_member_offset_attribute.cc", - "ast/struct_member_offset_attribute.h", "ast/struct_member_size_attribute.cc", - "ast/struct_member_size_attribute.h", "ast/switch_statement.cc", - "ast/switch_statement.h", "ast/templated_identifier.cc", - "ast/templated_identifier.h", - "ast/traverse_expressions.h", "ast/type.cc", - "ast/type.h", "ast/type_decl.cc", - "ast/type_decl.h", "ast/unary_op.cc", - "ast/unary_op.h", "ast/unary_op_expression.cc", - "ast/unary_op_expression.h", "ast/var.cc", - "ast/var.h", "ast/variable.cc", - "ast/variable.h", "ast/variable_decl_statement.cc", - "ast/variable_decl_statement.h", "ast/while_statement.cc", - "ast/while_statement.h", "ast/workgroup_attribute.cc", - "ast/workgroup_attribute.h", ] + public_deps = [ ":libtint_ast_hdrs" ] deps = [ ":libtint_base_src", - ":libtint_syntax_tree_src", + ":libtint_program_src", ":libtint_type_src", ] } @@ -767,9 +683,9 @@ libtint_source_set("libtint_sem_src") { ] deps = [ + ":libtint_ast_hdrs", ":libtint_base_src", ":libtint_constant_src", - ":libtint_syntax_tree_src", ":libtint_type_src", ] } @@ -879,7 +795,7 @@ libtint_source_set("libtint_reader_src") { ] public_deps = [ - ":libtint_syntax_tree_src", + ":libtint_program_src", ":libtint_transform_src", ] } @@ -908,9 +824,11 @@ libtint_source_set("libtint_spv_reader_src") { ] deps = [ + ":libtint_ast_src", ":libtint_base_src", + ":libtint_program_src", ":libtint_reader_src", - ":libtint_syntax_tree_src", + ":libtint_sem_src", ":libtint_type_src", "${tint_spirv_tools_dir}/:spvtools_opt", ] @@ -941,9 +859,11 @@ libtint_source_set("libtint_writer_src") { ] deps = [ + ":libtint_ast_src", ":libtint_base_src", ":libtint_inspector_src", - ":libtint_syntax_tree_src", + ":libtint_program_src", + ":libtint_sem_src", ":libtint_transform_src", ":libtint_type_src", ] @@ -969,10 +889,11 @@ libtint_source_set("libtint_spv_writer_src") { ] deps = [ + ":libtint_ast_src", ":libtint_base_src", ":libtint_constant_src", + ":libtint_program_src", ":libtint_sem_src", - ":libtint_syntax_tree_src", ":libtint_transform_src", ":libtint_type_src", ":libtint_writer_src", @@ -995,7 +916,9 @@ libtint_source_set("libtint_wgsl_reader_src") { ] deps = [ + ":libtint_ast_src", ":libtint_base_src", + ":libtint_program_src", ":libtint_reader_src", ":libtint_text_src", ":libtint_type_src", @@ -1011,8 +934,10 @@ libtint_source_set("libtint_wgsl_writer_src") { ] deps = [ + ":libtint_ast_src", ":libtint_base_src", - ":libtint_syntax_tree_src", + ":libtint_program_src", + ":libtint_sem_src", ":libtint_type_src", ":libtint_writer_src", ] @@ -1027,10 +952,11 @@ libtint_source_set("libtint_msl_writer_src") { ] deps = [ + ":libtint_ast_src", ":libtint_base_src", ":libtint_constant_src", + ":libtint_program_src", ":libtint_sem_src", - ":libtint_syntax_tree_src", ":libtint_transform_src", ":libtint_type_src", ":libtint_writer_src", @@ -1046,10 +972,11 @@ libtint_source_set("libtint_hlsl_writer_src") { ] deps = [ + ":libtint_ast_src", ":libtint_base_src", ":libtint_constant_src", + ":libtint_program_src", ":libtint_sem_src", - ":libtint_syntax_tree_src", ":libtint_transform_src", ":libtint_type_src", ":libtint_writer_src", @@ -1065,10 +992,11 @@ libtint_source_set("libtint_glsl_writer_src") { ] deps = [ + ":libtint_ast_src", ":libtint_base_src", ":libtint_constant_src", + ":libtint_program_src", ":libtint_sem_src", - ":libtint_syntax_tree_src", ":libtint_transform_src", ":libtint_type_src", ":libtint_writer_src", @@ -1083,8 +1011,8 @@ source_set("libtint") { ":libtint_demangler_src", ":libtint_initializer_src", ":libtint_inspector_src", + ":libtint_program_src", ":libtint_sem_src", - ":libtint_syntax_tree_src", ":libtint_text_src", ":libtint_transform_src", ":libtint_type_src", @@ -1267,7 +1195,6 @@ if (tint_build_unittests) { deps = [ ":libtint_ast_src", ":libtint_base_src", - ":libtint_syntax_tree_src", ] }