From 1a26e80318b096d818f1042e095111c861bb7a29 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Wed, 25 Jan 2023 22:40:28 +0000 Subject: [PATCH] Create a libtint_ast_src. This CL moves the ast files into a libtint_ast_src source set. Similar to sem, the headers are duplicated into the libtint_syntax_tree_src due to the dependencies with program_builder. This makes the sem and ast source sets be setup the same. Change-Id: If51fac6fab6763c4dcf729061de6ef983a94063a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117587 Reviewed-by: Ben Clayton Kokoro: Kokoro Commit-Queue: Dan Sinclair --- src/tint/BUILD.gn | 284 +++++++++++++++++++++++++++++++--------------- 1 file changed, 194 insertions(+), 90 deletions(-) diff --git a/src/tint/BUILD.gn b/src/tint/BUILD.gn index 77b1d927ab..94271366ad 100644 --- a/src/tint/BUILD.gn +++ b/src/tint/BUILD.gn @@ -237,187 +237,97 @@ libtint_source_set("libtint_base_src") { libtint_source_set("libtint_syntax_tree_src") { sources = [ - "ast/alias.cc", "ast/alias.h", - "ast/array.cc", "ast/array.h", - "ast/assignment_statement.cc", "ast/assignment_statement.h", - "ast/ast_type.cc", # TODO(bclayton) - rename to type.cc - "ast/atomic.cc", "ast/atomic.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.cc", "ast/bool.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/depth_multisampled_texture.cc", "ast/depth_multisampled_texture.h", - "ast/depth_texture.cc", "ast/depth_texture.h", - "ast/diagnostic_attribute.cc", "ast/diagnostic_attribute.h", - "ast/diagnostic_control.cc", "ast/diagnostic_control.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/external_texture.cc", "ast/external_texture.h", - "ast/f16.cc", "ast/f16.h", - "ast/f32.cc", "ast/f32.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/i32.cc", "ast/i32.h", - "ast/id_attribute.cc", "ast/id_attribute.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/matrix.cc", "ast/matrix.h", - "ast/member_accessor_expression.cc", "ast/member_accessor_expression.h", - "ast/module.cc", "ast/module.h", - "ast/multisampled_texture.cc", "ast/multisampled_texture.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/pointer.cc", "ast/pointer.h", - "ast/return_statement.cc", "ast/return_statement.h", - "ast/sampled_texture.cc", "ast/sampled_texture.h", - "ast/sampler.cc", "ast/sampler.h", - "ast/stage_attribute.cc", "ast/stage_attribute.h", - "ast/statement.cc", "ast/statement.h", - "ast/storage_texture.cc", "ast/storage_texture.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/texture.cc", "ast/texture.h", "ast/traverse_expressions.h", "ast/type.h", - "ast/type_decl.cc", "ast/type_decl.h", - "ast/type_name.cc", "ast/type_name.h", - "ast/u32.cc", "ast/u32.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/vector.cc", "ast/vector.h", - "ast/void.cc", "ast/void.h", - "ast/while_statement.cc", "ast/while_statement.h", - "ast/workgroup_attribute.cc", "ast/workgroup_attribute.h", "clone_context.cc", "clone_context.h", @@ -624,6 +534,198 @@ libtint_source_set("libtint_transform_src") { ] } +libtint_source_set("libtint_ast_src") { + sources = [ + "ast/alias.cc", + "ast/alias.h", + "ast/array.cc", + "ast/array.h", + "ast/assignment_statement.cc", + "ast/assignment_statement.h", + "ast/ast_type.cc", # TODO(bclayton) - rename to type.cc + "ast/atomic.cc", + "ast/atomic.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.cc", + "ast/bool.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/depth_multisampled_texture.cc", + "ast/depth_multisampled_texture.h", + "ast/depth_texture.cc", + "ast/depth_texture.h", + "ast/diagnostic_attribute.cc", + "ast/diagnostic_attribute.h", + "ast/diagnostic_control.cc", + "ast/diagnostic_control.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/external_texture.cc", + "ast/external_texture.h", + "ast/f16.cc", + "ast/f16.h", + "ast/f32.cc", + "ast/f32.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/i32.cc", + "ast/i32.h", + "ast/id_attribute.cc", + "ast/id_attribute.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/matrix.cc", + "ast/matrix.h", + "ast/member_accessor_expression.cc", + "ast/member_accessor_expression.h", + "ast/module.cc", + "ast/module.h", + "ast/multisampled_texture.cc", + "ast/multisampled_texture.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/pointer.cc", + "ast/pointer.h", + "ast/return_statement.cc", + "ast/return_statement.h", + "ast/sampled_texture.cc", + "ast/sampled_texture.h", + "ast/sampler.cc", + "ast/sampler.h", + "ast/stage_attribute.cc", + "ast/stage_attribute.h", + "ast/statement.cc", + "ast/statement.h", + "ast/storage_texture.cc", + "ast/storage_texture.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/texture.cc", + "ast/texture.h", + "ast/traverse_expressions.h", + "ast/type.h", + "ast/type_decl.cc", + "ast/type_decl.h", + "ast/type_name.cc", + "ast/type_name.h", + "ast/u32.cc", + "ast/u32.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/vector.cc", + "ast/vector.h", + "ast/void.cc", + "ast/void.h", + "ast/while_statement.cc", + "ast/while_statement.h", + "ast/workgroup_attribute.cc", + "ast/workgroup_attribute.h", + ] + deps = [ + ":libtint_base_src", + ":libtint_syntax_tree_src", + ":libtint_type_src", + ] +} + libtint_source_set("libtint_sem_src") { sources = [ "sem/array_count.cc", @@ -990,6 +1092,7 @@ libtint_source_set("libtint_glsl_writer_src") { source_set("libtint") { public_deps = [ + ":libtint_ast_src", ":libtint_base_src", ":libtint_constant_src", ":libtint_initializer_src", @@ -1248,6 +1351,7 @@ if (tint_build_unittests) { "ast/workgroup_attribute_test.cc", ] deps = [ + ":libtint_ast_src", ":libtint_base_src", ":libtint_transform_src", ]