From 34323ac069928e9afd88e5b2d1e98461a7dc19a7 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Thu, 7 Apr 2022 18:39:35 +0000 Subject: [PATCH] Condense namespaces in tint/ast. This PR condenses the namespaces in the tint/ast folder. Change-Id: I77a84fb03f921b4db7135572005a08563f2fb60b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86038 Reviewed-by: Ben Clayton Auto-Submit: Dan Sinclair Commit-Queue: Dan Sinclair --- src/tint/ast/access.cc | 6 ++---- src/tint/ast/access.h | 6 ++---- src/tint/ast/alias.cc | 6 ++---- src/tint/ast/alias.h | 6 ++---- src/tint/ast/alias_test.cc | 6 ++---- src/tint/ast/array.cc | 6 ++---- src/tint/ast/array.h | 6 ++---- src/tint/ast/array_test.cc | 6 ++---- src/tint/ast/assignment_statement.cc | 6 ++---- src/tint/ast/assignment_statement.h | 6 ++---- src/tint/ast/assignment_statement_test.cc | 6 ++---- src/tint/ast/ast_type.cc | 6 ++---- src/tint/ast/atomic.cc | 6 ++---- src/tint/ast/atomic.h | 6 ++---- src/tint/ast/atomic_test.cc | 6 ++---- src/tint/ast/attribute.cc | 6 ++---- src/tint/ast/attribute.h | 6 ++---- src/tint/ast/binary_expression.cc | 6 ++---- src/tint/ast/binary_expression.h | 6 ++---- src/tint/ast/binary_expression_test.cc | 6 ++---- src/tint/ast/binding_attribute.cc | 6 ++---- src/tint/ast/binding_attribute.h | 6 ++---- src/tint/ast/binding_attribute_test.cc | 6 ++---- src/tint/ast/bitcast_expression.cc | 6 ++---- src/tint/ast/bitcast_expression.h | 6 ++---- src/tint/ast/bitcast_expression_test.cc | 6 ++---- src/tint/ast/block_statement.cc | 6 ++---- src/tint/ast/block_statement.h | 6 ++---- src/tint/ast/block_statement_test.cc | 6 ++---- src/tint/ast/bool.cc | 6 ++---- src/tint/ast/bool.h | 6 ++---- src/tint/ast/bool_literal_expression.cc | 6 ++---- src/tint/ast/bool_literal_expression.h | 6 ++---- src/tint/ast/bool_literal_expression_test.cc | 6 ++---- src/tint/ast/bool_test.cc | 6 ++---- src/tint/ast/break_statement.cc | 6 ++---- src/tint/ast/break_statement.h | 6 ++---- src/tint/ast/break_statement_test.cc | 6 ++---- src/tint/ast/builtin.cc | 6 ++---- src/tint/ast/builtin.h | 6 ++---- src/tint/ast/builtin_attribute.cc | 6 ++---- src/tint/ast/builtin_attribute.h | 6 ++---- src/tint/ast/builtin_attribute_test.cc | 6 ++---- src/tint/ast/builtin_texture_helper_test.cc | 10 ++-------- src/tint/ast/builtin_texture_helper_test.h | 10 ++-------- src/tint/ast/call_expression.cc | 6 ++---- src/tint/ast/call_expression.h | 6 ++---- src/tint/ast/call_expression_test.cc | 6 ++---- src/tint/ast/call_statement.cc | 6 ++---- src/tint/ast/call_statement.h | 6 ++---- src/tint/ast/call_statement_test.cc | 6 ++---- src/tint/ast/case_statement.cc | 6 ++---- src/tint/ast/case_statement.h | 6 ++---- src/tint/ast/case_statement_test.cc | 6 ++---- src/tint/ast/compound_assignment_statement.cc | 6 ++---- src/tint/ast/compound_assignment_statement.h | 6 ++---- src/tint/ast/compound_assignment_statement_test.cc | 6 ++---- src/tint/ast/continue_statement.cc | 6 ++---- src/tint/ast/continue_statement.h | 6 ++---- src/tint/ast/continue_statement_test.cc | 6 ++---- src/tint/ast/depth_multisampled_texture.cc | 6 ++---- src/tint/ast/depth_multisampled_texture.h | 6 ++---- src/tint/ast/depth_multisampled_texture_test.cc | 6 ++---- src/tint/ast/depth_texture.cc | 6 ++---- src/tint/ast/depth_texture.h | 6 ++---- src/tint/ast/depth_texture_test.cc | 6 ++---- src/tint/ast/disable_validation_attribute.cc | 6 ++---- src/tint/ast/disable_validation_attribute.h | 6 ++---- src/tint/ast/discard_statement.cc | 6 ++---- src/tint/ast/discard_statement.h | 6 ++---- src/tint/ast/discard_statement_test.cc | 6 ++---- src/tint/ast/else_statement.cc | 6 ++---- src/tint/ast/else_statement.h | 6 ++---- src/tint/ast/else_statement_test.cc | 6 ++---- src/tint/ast/expression.cc | 6 ++---- src/tint/ast/expression.h | 6 ++---- src/tint/ast/external_texture.cc | 6 ++---- src/tint/ast/external_texture.h | 6 ++---- src/tint/ast/external_texture_test.cc | 6 ++---- src/tint/ast/f32.cc | 6 ++---- src/tint/ast/f32.h | 6 ++---- src/tint/ast/f32_test.cc | 6 ++---- src/tint/ast/fallthrough_statement.cc | 6 ++---- src/tint/ast/fallthrough_statement.h | 6 ++---- src/tint/ast/fallthrough_statement_test.cc | 6 ++---- src/tint/ast/float_literal_expression.cc | 6 ++---- src/tint/ast/float_literal_expression.h | 6 ++---- src/tint/ast/float_literal_expression_test.cc | 6 ++---- src/tint/ast/for_loop_statement.cc | 6 ++---- src/tint/ast/for_loop_statement.h | 6 ++---- src/tint/ast/for_loop_statement_test.cc | 6 ++---- src/tint/ast/function.cc | 6 ++---- src/tint/ast/function.h | 6 ++---- src/tint/ast/function_test.cc | 6 ++---- src/tint/ast/group_attribute.cc | 6 ++---- src/tint/ast/group_attribute.h | 6 ++---- src/tint/ast/group_attribute_test.cc | 6 ++---- src/tint/ast/i32.cc | 6 ++---- src/tint/ast/i32.h | 6 ++---- src/tint/ast/i32_test.cc | 6 ++---- src/tint/ast/id_attribute.cc | 6 ++---- src/tint/ast/id_attribute.h | 6 ++---- src/tint/ast/id_attribute_test.cc | 6 ++---- src/tint/ast/identifier_expression.cc | 6 ++---- src/tint/ast/identifier_expression.h | 6 ++---- src/tint/ast/identifier_expression_test.cc | 6 ++---- src/tint/ast/if_statement.cc | 6 ++---- src/tint/ast/if_statement.h | 6 ++---- src/tint/ast/if_statement_test.cc | 6 ++---- src/tint/ast/index_accessor_expression.cc | 6 ++---- src/tint/ast/index_accessor_expression.h | 6 ++---- src/tint/ast/index_accessor_expression_test.cc | 6 ++---- src/tint/ast/int_literal_expression.cc | 6 ++---- src/tint/ast/int_literal_expression.h | 6 ++---- src/tint/ast/int_literal_expression_test.cc | 6 ++---- src/tint/ast/internal_attribute.cc | 6 ++---- src/tint/ast/internal_attribute.h | 6 ++---- src/tint/ast/interpolate_attribute.cc | 6 ++---- src/tint/ast/interpolate_attribute.h | 6 ++---- src/tint/ast/interpolate_attribute_test.cc | 6 ++---- src/tint/ast/invariant_attribute.cc | 6 ++---- src/tint/ast/invariant_attribute.h | 6 ++---- src/tint/ast/invariant_attribute_test.cc | 6 ++---- src/tint/ast/literal_expression.cc | 6 ++---- src/tint/ast/literal_expression.h | 6 ++---- src/tint/ast/location_attribute.cc | 6 ++---- src/tint/ast/location_attribute.h | 6 ++---- src/tint/ast/location_attribute_test.cc | 6 ++---- src/tint/ast/loop_statement.cc | 6 ++---- src/tint/ast/loop_statement.h | 6 ++---- src/tint/ast/loop_statement_test.cc | 6 ++---- src/tint/ast/matrix.cc | 6 ++---- src/tint/ast/matrix.h | 6 ++---- src/tint/ast/matrix_test.cc | 6 ++---- src/tint/ast/member_accessor_expression.cc | 6 ++---- src/tint/ast/member_accessor_expression.h | 6 ++---- src/tint/ast/member_accessor_expression_test.cc | 6 ++---- src/tint/ast/module.cc | 6 ++---- src/tint/ast/module.h | 6 ++---- src/tint/ast/module_clone_test.cc | 6 ++---- src/tint/ast/module_test.cc | 6 ++---- src/tint/ast/multisampled_texture.cc | 6 ++---- src/tint/ast/multisampled_texture.h | 6 ++---- src/tint/ast/multisampled_texture_test.cc | 6 ++---- src/tint/ast/node.cc | 6 ++---- src/tint/ast/node.h | 7 +++---- src/tint/ast/phony_expression.cc | 6 ++---- src/tint/ast/phony_expression.h | 6 ++---- src/tint/ast/phony_expression_test.cc | 6 ++---- src/tint/ast/pipeline_stage.cc | 6 ++---- src/tint/ast/pipeline_stage.h | 6 ++---- src/tint/ast/pointer.cc | 6 ++---- src/tint/ast/pointer.h | 6 ++---- src/tint/ast/pointer_test.cc | 6 ++---- src/tint/ast/return_statement.cc | 6 ++---- src/tint/ast/return_statement.h | 6 ++---- src/tint/ast/return_statement_test.cc | 6 ++---- src/tint/ast/sampled_texture.cc | 6 ++---- src/tint/ast/sampled_texture.h | 6 ++---- src/tint/ast/sampled_texture_test.cc | 6 ++---- src/tint/ast/sampler.cc | 6 ++---- src/tint/ast/sampler.h | 6 ++---- src/tint/ast/sampler_test.cc | 6 ++---- src/tint/ast/sint_literal_expression.cc | 6 ++---- src/tint/ast/sint_literal_expression.h | 6 ++---- src/tint/ast/sint_literal_expression_test.cc | 6 ++---- src/tint/ast/stage_attribute.cc | 6 ++---- src/tint/ast/stage_attribute.h | 6 ++---- src/tint/ast/stage_attribute_test.cc | 6 ++---- src/tint/ast/statement.cc | 6 ++---- src/tint/ast/statement.h | 6 ++---- src/tint/ast/storage_class.cc | 6 ++---- src/tint/ast/storage_class.h | 6 ++---- src/tint/ast/storage_texture.cc | 6 ++---- src/tint/ast/storage_texture.h | 6 ++---- src/tint/ast/storage_texture_test.cc | 6 ++---- src/tint/ast/stride_attribute.cc | 6 ++---- src/tint/ast/stride_attribute.h | 6 ++---- src/tint/ast/stride_attribute_test.cc | 6 ++---- src/tint/ast/struct.cc | 6 ++---- src/tint/ast/struct.h | 6 ++---- src/tint/ast/struct_member.cc | 6 ++---- src/tint/ast/struct_member.h | 6 ++---- src/tint/ast/struct_member_align_attribute.cc | 6 ++---- src/tint/ast/struct_member_align_attribute.h | 6 ++---- src/tint/ast/struct_member_align_attribute_test.cc | 6 ++---- src/tint/ast/struct_member_offset_attribute.cc | 6 ++---- src/tint/ast/struct_member_offset_attribute.h | 6 ++---- src/tint/ast/struct_member_offset_attribute_test.cc | 6 ++---- src/tint/ast/struct_member_size_attribute.cc | 6 ++---- src/tint/ast/struct_member_size_attribute.h | 6 ++---- src/tint/ast/struct_member_size_attribute_test.cc | 6 ++---- src/tint/ast/struct_member_test.cc | 6 ++---- src/tint/ast/struct_test.cc | 6 ++---- src/tint/ast/switch_statement.cc | 6 ++---- src/tint/ast/switch_statement.h | 6 ++---- src/tint/ast/switch_statement_test.cc | 6 ++---- src/tint/ast/test_helper.h | 6 ++---- src/tint/ast/texture.cc | 6 ++---- src/tint/ast/texture.h | 6 ++---- src/tint/ast/texture_test.cc | 6 ++---- src/tint/ast/traverse_expressions.h | 6 ++---- src/tint/ast/traverse_expressions_test.cc | 6 ++---- src/tint/ast/type.h | 10 ++++------ src/tint/ast/type_decl.cc | 6 ++---- src/tint/ast/type_decl.h | 6 ++---- src/tint/ast/type_name.cc | 6 ++---- src/tint/ast/type_name.h | 6 ++---- src/tint/ast/u32.cc | 6 ++---- src/tint/ast/u32.h | 6 ++---- src/tint/ast/u32_test.cc | 6 ++---- src/tint/ast/uint_literal_expression.cc | 6 ++---- src/tint/ast/uint_literal_expression.h | 6 ++---- src/tint/ast/uint_literal_expression_test.cc | 6 ++---- src/tint/ast/unary_op.cc | 6 ++---- src/tint/ast/unary_op.h | 6 ++---- src/tint/ast/unary_op_expression.cc | 6 ++---- src/tint/ast/unary_op_expression.h | 6 ++---- src/tint/ast/unary_op_expression_test.cc | 6 ++---- src/tint/ast/variable.cc | 6 ++---- src/tint/ast/variable.h | 6 ++---- src/tint/ast/variable_decl_statement.cc | 6 ++---- src/tint/ast/variable_decl_statement.h | 6 ++---- src/tint/ast/variable_decl_statement_test.cc | 6 ++---- src/tint/ast/variable_test.cc | 6 ++---- src/tint/ast/vector.cc | 6 ++---- src/tint/ast/vector.h | 6 ++---- src/tint/ast/vector_test.cc | 6 ++---- src/tint/ast/void.cc | 6 ++---- src/tint/ast/void.h | 6 ++---- src/tint/ast/workgroup_attribute.cc | 6 ++---- src/tint/ast/workgroup_attribute.h | 6 ++---- src/tint/ast/workgroup_attribute_test.cc | 6 ++---- 233 files changed, 469 insertions(+), 942 deletions(-) diff --git a/src/tint/ast/access.cc b/src/tint/ast/access.cc index cb5f8644dd..575463dfb3 100644 --- a/src/tint/ast/access.cc +++ b/src/tint/ast/access.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/access.h" -namespace tint { -namespace ast { +namespace tint::ast { std::ostream& operator<<(std::ostream& out, Access access) { switch (access) { @@ -39,5 +38,4 @@ std::ostream& operator<<(std::ostream& out, Access access) { return out; } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/access.h b/src/tint/ast/access.h index 67ad71421f..aa9f656957 100644 --- a/src/tint/ast/access.h +++ b/src/tint/ast/access.h @@ -18,8 +18,7 @@ #include #include -namespace tint { -namespace ast { +namespace tint::ast { /// The access control settings enum Access { @@ -40,7 +39,6 @@ enum Access { /// @return the std::ostream so calls can be chained std::ostream& operator<<(std::ostream& out, Access access); -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_ACCESS_H_ diff --git a/src/tint/ast/alias.cc b/src/tint/ast/alias.cc index d8526677da..1f76749dcd 100644 --- a/src/tint/ast/alias.cc +++ b/src/tint/ast/alias.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Alias); -namespace tint { -namespace ast { +namespace tint::ast { Alias::Alias(ProgramID pid, const Source& src, @@ -41,5 +40,4 @@ const Alias* Alias::Clone(CloneContext* ctx) const { return ctx->dst->create(src, sym, ty); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/alias.h b/src/tint/ast/alias.h index c21b3e2d63..f527d43f9d 100644 --- a/src/tint/ast/alias.h +++ b/src/tint/ast/alias.h @@ -19,8 +19,7 @@ #include "src/tint/ast/type_decl.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A type alias type. Holds a name and pointer to another type. class Alias final : public Castable { @@ -48,7 +47,6 @@ class Alias final : public Castable { const Type* const type; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_ALIAS_H_ diff --git a/src/tint/ast/alias_test.cc b/src/tint/ast/alias_test.cc index db82082e0e..6669e525e1 100644 --- a/src/tint/ast/alias_test.cc +++ b/src/tint/ast/alias_test.cc @@ -27,8 +27,7 @@ #include "src/tint/ast/u32.h" #include "src/tint/ast/vector.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstAliasTest = TestHelper; @@ -41,5 +40,4 @@ TEST_F(AstAliasTest, Create) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/array.cc b/src/tint/ast/array.cc index 99b8d56c2d..58d8a45f83 100644 --- a/src/tint/ast/array.cc +++ b/src/tint/ast/array.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Array); -namespace tint { -namespace ast { +namespace tint::ast { namespace { // Returns the string representation of an array size expression. @@ -74,5 +73,4 @@ const Array* Array::Clone(CloneContext* ctx) const { return ctx->dst->create(src, ty, cnt, attrs); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/array.h b/src/tint/ast/array.h index 413e4d3ac5..05c2f4d87e 100644 --- a/src/tint/ast/array.h +++ b/src/tint/ast/array.h @@ -20,8 +20,7 @@ #include "src/tint/ast/attribute.h" #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { // Forward declarations. class Expression; @@ -69,7 +68,6 @@ class Array final : public Castable { const AttributeList attributes; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_ARRAY_H_ diff --git a/src/tint/ast/array_test.cc b/src/tint/ast/array_test.cc index ff977345ce..e255920761 100644 --- a/src/tint/ast/array_test.cc +++ b/src/tint/ast/array_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstArrayTest = TestHelper; @@ -67,5 +66,4 @@ TEST_F(AstArrayTest, FriendlyName_WithStride) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/assignment_statement.cc b/src/tint/ast/assignment_statement.cc index a2340b740b..575e5d2a44 100644 --- a/src/tint/ast/assignment_statement.cc +++ b/src/tint/ast/assignment_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::AssignmentStatement); -namespace tint { -namespace ast { +namespace tint::ast { AssignmentStatement::AssignmentStatement(ProgramID pid, const Source& src, @@ -44,5 +43,4 @@ const AssignmentStatement* AssignmentStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src, l, r); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/assignment_statement.h b/src/tint/ast/assignment_statement.h index 55e07b8cc6..5fb8e3a224 100644 --- a/src/tint/ast/assignment_statement.h +++ b/src/tint/ast/assignment_statement.h @@ -18,8 +18,7 @@ #include "src/tint/ast/expression.h" #include "src/tint/ast/statement.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An assignment statement class AssignmentStatement final @@ -51,7 +50,6 @@ class AssignmentStatement final const Expression* const rhs; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_ASSIGNMENT_STATEMENT_H_ diff --git a/src/tint/ast/assignment_statement_test.cc b/src/tint/ast/assignment_statement_test.cc index 4a41a7c47e..39f8b83c73 100644 --- a/src/tint/ast/assignment_statement_test.cc +++ b/src/tint/ast/assignment_statement_test.cc @@ -17,8 +17,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AssignmentStatementTest = TestHelper; @@ -90,5 +89,4 @@ TEST_F(AssignmentStatementTest, Assert_DifferentProgramID_RHS) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/ast_type.cc b/src/tint/ast/ast_type.cc index cb01679abd..ec247c9460 100644 --- a/src/tint/ast/ast_type.cc +++ b/src/tint/ast/ast_type.cc @@ -28,8 +28,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Type); -namespace tint { -namespace ast { +namespace tint::ast { Type::Type(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -37,5 +36,4 @@ Type::Type(Type&&) = default; Type::~Type() = default; -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/atomic.cc b/src/tint/ast/atomic.cc index addefeeaf2..714dda4b29 100644 --- a/src/tint/ast/atomic.cc +++ b/src/tint/ast/atomic.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Atomic); -namespace tint { -namespace ast { +namespace tint::ast { Atomic::Atomic(ProgramID pid, const Source& src, const Type* const subtype) : Base(pid, src), type(subtype) {} @@ -41,5 +40,4 @@ const Atomic* Atomic::Clone(CloneContext* ctx) const { return ctx->dst->create(src, ty); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/atomic.h b/src/tint/ast/atomic.h index d5e1b9b3eb..734898f941 100644 --- a/src/tint/ast/atomic.h +++ b/src/tint/ast/atomic.h @@ -19,8 +19,7 @@ #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An atomic type. class Atomic final : public Castable { @@ -48,7 +47,6 @@ class Atomic final : public Castable { const Type* const type; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_ATOMIC_H_ diff --git a/src/tint/ast/atomic_test.cc b/src/tint/ast/atomic_test.cc index 636654bae4..cd192c1619 100644 --- a/src/tint/ast/atomic_test.cc +++ b/src/tint/ast/atomic_test.cc @@ -17,8 +17,7 @@ #include "src/tint/ast/i32.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstAtomicTest = TestHelper; @@ -36,5 +35,4 @@ TEST_F(AstAtomicTest, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/attribute.cc b/src/tint/ast/attribute.cc index 87ad3f1ffc..90d0d77654 100644 --- a/src/tint/ast/attribute.cc +++ b/src/tint/ast/attribute.cc @@ -16,10 +16,8 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Attribute); -namespace tint { -namespace ast { +namespace tint::ast { Attribute::~Attribute() = default; -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/attribute.h b/src/tint/ast/attribute.h index d336727e3f..b5c0ffcf76 100644 --- a/src/tint/ast/attribute.h +++ b/src/tint/ast/attribute.h @@ -20,8 +20,7 @@ #include "src/tint/ast/node.h" -namespace tint { -namespace ast { +namespace tint::ast { /// The base class for all attributes class Attribute : public Castable { @@ -65,7 +64,6 @@ const T* GetAttribute(const AttributeList& attributes) { return nullptr; } -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_ATTRIBUTE_H_ diff --git a/src/tint/ast/binary_expression.cc b/src/tint/ast/binary_expression.cc index 6b2be732ff..6d67851238 100644 --- a/src/tint/ast/binary_expression.cc +++ b/src/tint/ast/binary_expression.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::BinaryExpression); -namespace tint { -namespace ast { +namespace tint::ast { BinaryExpression::BinaryExpression(ProgramID pid, const Source& src, @@ -46,5 +45,4 @@ const BinaryExpression* BinaryExpression::Clone(CloneContext* ctx) const { return ctx->dst->create(src, op, l, r); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/binary_expression.h b/src/tint/ast/binary_expression.h index bcacdd4ea7..ab3f6be56d 100644 --- a/src/tint/ast/binary_expression.h +++ b/src/tint/ast/binary_expression.h @@ -17,8 +17,7 @@ #include "src/tint/ast/expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// The operator type enum class BinaryOp { @@ -258,7 +257,6 @@ inline std::ostream& operator<<(std::ostream& out, BinaryOp op) { return out; } -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_BINARY_EXPRESSION_H_ diff --git a/src/tint/ast/binary_expression_test.cc b/src/tint/ast/binary_expression_test.cc index 20b8f8f9a4..5bec07b3b9 100644 --- a/src/tint/ast/binary_expression_test.cc +++ b/src/tint/ast/binary_expression_test.cc @@ -15,8 +15,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using BinaryExpressionTest = TestHelper; @@ -91,5 +90,4 @@ TEST_F(BinaryExpressionTest, Assert_DifferentProgramID_RHS) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/binding_attribute.cc b/src/tint/ast/binding_attribute.cc index bc1a74afff..2fdfe20537 100644 --- a/src/tint/ast/binding_attribute.cc +++ b/src/tint/ast/binding_attribute.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::BindingAttribute); -namespace tint { -namespace ast { +namespace tint::ast { BindingAttribute::BindingAttribute(ProgramID pid, const Source& src, @@ -40,5 +39,4 @@ const BindingAttribute* BindingAttribute::Clone(CloneContext* ctx) const { return ctx->dst->create(src, value); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/binding_attribute.h b/src/tint/ast/binding_attribute.h index 8f3214d90a..6ae6a0ec15 100644 --- a/src/tint/ast/binding_attribute.h +++ b/src/tint/ast/binding_attribute.h @@ -19,8 +19,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A binding attribute class BindingAttribute final : public Castable { @@ -45,7 +44,6 @@ class BindingAttribute final : public Castable { const uint32_t value; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_BINDING_ATTRIBUTE_H_ diff --git a/src/tint/ast/binding_attribute_test.cc b/src/tint/ast/binding_attribute_test.cc index c4c7e395f5..8515651840 100644 --- a/src/tint/ast/binding_attribute_test.cc +++ b/src/tint/ast/binding_attribute_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using BindingAttributeTest = TestHelper; @@ -26,5 +25,4 @@ TEST_F(BindingAttributeTest, Creation) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/bitcast_expression.cc b/src/tint/ast/bitcast_expression.cc index 8de3afc167..9626c47590 100644 --- a/src/tint/ast/bitcast_expression.cc +++ b/src/tint/ast/bitcast_expression.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::BitcastExpression); -namespace tint { -namespace ast { +namespace tint::ast { BitcastExpression::BitcastExpression(ProgramID pid, const Source& src, @@ -42,5 +41,4 @@ const BitcastExpression* BitcastExpression::Clone(CloneContext* ctx) const { return ctx->dst->create(src, t, e); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/bitcast_expression.h b/src/tint/ast/bitcast_expression.h index e16ae22a0b..11407d629b 100644 --- a/src/tint/ast/bitcast_expression.h +++ b/src/tint/ast/bitcast_expression.h @@ -17,8 +17,7 @@ #include "src/tint/ast/expression.h" -namespace tint { -namespace ast { +namespace tint::ast { // Forward declaration class Type; @@ -51,7 +50,6 @@ class BitcastExpression final : public Castable { const Expression* const expr; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_BITCAST_EXPRESSION_H_ diff --git a/src/tint/ast/bitcast_expression_test.cc b/src/tint/ast/bitcast_expression_test.cc index 5803003742..170d765ddb 100644 --- a/src/tint/ast/bitcast_expression_test.cc +++ b/src/tint/ast/bitcast_expression_test.cc @@ -17,8 +17,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using BitcastExpressionTest = TestHelper; @@ -77,5 +76,4 @@ TEST_F(BitcastExpressionTest, Assert_DifferentProgramID_Expr) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/block_statement.cc b/src/tint/ast/block_statement.cc index 5a7dcba37e..4368e24a2d 100644 --- a/src/tint/ast/block_statement.cc +++ b/src/tint/ast/block_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::BlockStatement); -namespace tint { -namespace ast { +namespace tint::ast { BlockStatement::BlockStatement(ProgramID pid, const Source& src, @@ -42,5 +41,4 @@ const BlockStatement* BlockStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src, stmts); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/block_statement.h b/src/tint/ast/block_statement.h index 31b2ef1c13..2afce5e535 100644 --- a/src/tint/ast/block_statement.h +++ b/src/tint/ast/block_statement.h @@ -19,8 +19,7 @@ #include "src/tint/ast/statement.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A block statement class BlockStatement final : public Castable { @@ -54,7 +53,6 @@ class BlockStatement final : public Castable { const StatementList statements; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_BLOCK_STATEMENT_H_ diff --git a/src/tint/ast/block_statement_test.cc b/src/tint/ast/block_statement_test.cc index 1cc8f3897e..17ae585afb 100644 --- a/src/tint/ast/block_statement_test.cc +++ b/src/tint/ast/block_statement_test.cc @@ -17,8 +17,7 @@ #include "src/tint/ast/if_statement.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using BlockStatementTest = TestHelper; @@ -67,5 +66,4 @@ TEST_F(BlockStatementTest, Assert_DifferentProgramID_Statement) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/bool.cc b/src/tint/ast/bool.cc index 79596a3d09..3f126e6d01 100644 --- a/src/tint/ast/bool.cc +++ b/src/tint/ast/bool.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Bool); -namespace tint { -namespace ast { +namespace tint::ast { Bool::Bool(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -36,5 +35,4 @@ const Bool* Bool::Clone(CloneContext* ctx) const { return ctx->dst->create(src); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/bool.h b/src/tint/ast/bool.h index fa326da5ec..50a4fcb7e8 100644 --- a/src/tint/ast/bool.h +++ b/src/tint/ast/bool.h @@ -25,8 +25,7 @@ #undef Bool #endif -namespace tint { -namespace ast { +namespace tint::ast { /// A boolean type class Bool final : public Castable { @@ -50,7 +49,6 @@ class Bool final : public Castable { const Bool* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_BOOL_H_ diff --git a/src/tint/ast/bool_literal_expression.cc b/src/tint/ast/bool_literal_expression.cc index 5c961b4efb..c86036c9d8 100644 --- a/src/tint/ast/bool_literal_expression.cc +++ b/src/tint/ast/bool_literal_expression.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::BoolLiteralExpression); -namespace tint { -namespace ast { +namespace tint::ast { BoolLiteralExpression::BoolLiteralExpression(ProgramID pid, const Source& src, @@ -35,5 +34,4 @@ const BoolLiteralExpression* BoolLiteralExpression::Clone( return ctx->dst->create(src, value); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/bool_literal_expression.h b/src/tint/ast/bool_literal_expression.h index 421453ea77..9fbd775860 100644 --- a/src/tint/ast/bool_literal_expression.h +++ b/src/tint/ast/bool_literal_expression.h @@ -19,8 +19,7 @@ #include "src/tint/ast/literal_expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A boolean literal class BoolLiteralExpression final @@ -43,7 +42,6 @@ class BoolLiteralExpression final const bool value; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_BOOL_LITERAL_EXPRESSION_H_ diff --git a/src/tint/ast/bool_literal_expression_test.cc b/src/tint/ast/bool_literal_expression_test.cc index 78cd632caa..ac7380281c 100644 --- a/src/tint/ast/bool_literal_expression_test.cc +++ b/src/tint/ast/bool_literal_expression_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using BoolLiteralExpressionTest = TestHelper; @@ -33,5 +32,4 @@ TEST_F(BoolLiteralExpressionTest, False) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/bool_test.cc b/src/tint/ast/bool_test.cc index 3defbd4938..665b23f7a5 100644 --- a/src/tint/ast/bool_test.cc +++ b/src/tint/ast/bool_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstBoolTest = TestHelper; @@ -28,5 +27,4 @@ TEST_F(AstBoolTest, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/break_statement.cc b/src/tint/ast/break_statement.cc index 0c78c73fda..5748833504 100644 --- a/src/tint/ast/break_statement.cc +++ b/src/tint/ast/break_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::BreakStatement); -namespace tint { -namespace ast { +namespace tint::ast { BreakStatement::BreakStatement(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -34,5 +33,4 @@ const BreakStatement* BreakStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/break_statement.h b/src/tint/ast/break_statement.h index cf50c74990..bb5b00c99b 100644 --- a/src/tint/ast/break_statement.h +++ b/src/tint/ast/break_statement.h @@ -17,8 +17,7 @@ #include "src/tint/ast/statement.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An break statement class BreakStatement final : public Castable { @@ -38,7 +37,6 @@ class BreakStatement final : public Castable { const BreakStatement* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_BREAK_STATEMENT_H_ diff --git a/src/tint/ast/break_statement_test.cc b/src/tint/ast/break_statement_test.cc index ce419aee9c..dba28cf637 100644 --- a/src/tint/ast/break_statement_test.cc +++ b/src/tint/ast/break_statement_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using BreakStatementTest = TestHelper; @@ -35,5 +34,4 @@ TEST_F(BreakStatementTest, IsBreak) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/builtin.cc b/src/tint/ast/builtin.cc index 48744e00e2..364041177d 100644 --- a/src/tint/ast/builtin.cc +++ b/src/tint/ast/builtin.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/builtin.h" -namespace tint { -namespace ast { +namespace tint::ast { std::ostream& operator<<(std::ostream& out, Builtin builtin) { switch (builtin) { @@ -78,5 +77,4 @@ std::ostream& operator<<(std::ostream& out, Builtin builtin) { return out; } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/builtin.h b/src/tint/ast/builtin.h index 913eba285c..a0b8d5dc28 100644 --- a/src/tint/ast/builtin.h +++ b/src/tint/ast/builtin.h @@ -17,8 +17,7 @@ #include -namespace tint { -namespace ast { +namespace tint::ast { /// The builtin identifiers enum class Builtin { @@ -46,7 +45,6 @@ enum class Builtin { /// @return the std::ostream so calls can be chained std::ostream& operator<<(std::ostream& out, Builtin builtin); -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_BUILTIN_H_ diff --git a/src/tint/ast/builtin_attribute.cc b/src/tint/ast/builtin_attribute.cc index 0591b91bec..f3d013a59f 100644 --- a/src/tint/ast/builtin_attribute.cc +++ b/src/tint/ast/builtin_attribute.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::BuiltinAttribute); -namespace tint { -namespace ast { +namespace tint::ast { BuiltinAttribute::BuiltinAttribute(ProgramID pid, const Source& src, Builtin b) : Base(pid, src), builtin(b) {} @@ -38,5 +37,4 @@ const BuiltinAttribute* BuiltinAttribute::Clone(CloneContext* ctx) const { return ctx->dst->create(src, builtin); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/builtin_attribute.h b/src/tint/ast/builtin_attribute.h index 436673966c..cc562f4466 100644 --- a/src/tint/ast/builtin_attribute.h +++ b/src/tint/ast/builtin_attribute.h @@ -20,8 +20,7 @@ #include "src/tint/ast/attribute.h" #include "src/tint/ast/builtin.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A builtin attribute class BuiltinAttribute final : public Castable { @@ -46,7 +45,6 @@ class BuiltinAttribute final : public Castable { const Builtin builtin; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_BUILTIN_ATTRIBUTE_H_ diff --git a/src/tint/ast/builtin_attribute_test.cc b/src/tint/ast/builtin_attribute_test.cc index e5a91ea403..82b681dc9b 100644 --- a/src/tint/ast/builtin_attribute_test.cc +++ b/src/tint/ast/builtin_attribute_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using BuiltinAttributeTest = TestHelper; @@ -26,5 +25,4 @@ TEST_F(BuiltinAttributeTest, Creation) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/builtin_texture_helper_test.cc b/src/tint/ast/builtin_texture_helper_test.cc index 2f805589ba..85567e08ca 100644 --- a/src/tint/ast/builtin_texture_helper_test.cc +++ b/src/tint/ast/builtin_texture_helper_test.cc @@ -18,10 +18,7 @@ #include "src/tint/sem/multisampled_texture_type.h" #include "src/tint/sem/sampled_texture_type.h" -namespace tint { -namespace ast { -namespace builtin { -namespace test { +namespace tint::ast::builtin::test { using u32 = ProgramBuilder::u32; using i32 = ProgramBuilder::i32; @@ -2280,7 +2277,4 @@ bool ReturnsVoid(ValidTextureOverload texture_overload) { } } -} // namespace test -} // namespace builtin -} // namespace ast -} // namespace tint +} // namespace tint::ast::builtin::test diff --git a/src/tint/ast/builtin_texture_helper_test.h b/src/tint/ast/builtin_texture_helper_test.h index 751f51b12d..ad60757eca 100644 --- a/src/tint/ast/builtin_texture_helper_test.h +++ b/src/tint/ast/builtin_texture_helper_test.h @@ -21,10 +21,7 @@ #include "src/tint/program_builder.h" #include "src/tint/sem/storage_texture_type.h" -namespace tint { -namespace ast { -namespace builtin { -namespace test { +namespace tint::ast::builtin::test { enum class TextureKind { kRegular, @@ -261,9 +258,6 @@ struct TextureOverloadCase { std::ostream& operator<<(std::ostream& out, const TextureOverloadCase& data); -} // namespace test -} // namespace builtin -} // namespace ast -} // namespace tint +} // namespace tint::ast::builtin::test #endif // SRC_TINT_AST_BUILTIN_TEXTURE_HELPER_TEST_H_ diff --git a/src/tint/ast/call_expression.cc b/src/tint/ast/call_expression.cc index 7abf4d79a0..cfb6bd935c 100644 --- a/src/tint/ast/call_expression.cc +++ b/src/tint/ast/call_expression.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::CallExpression); -namespace tint { -namespace ast { +namespace tint::ast { namespace { CallExpression::Target ToTarget(const IdentifierExpression* name) { @@ -74,5 +73,4 @@ const CallExpression* CallExpression::Clone(CloneContext* ctx) const { p); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/call_expression.h b/src/tint/ast/call_expression.h index efb1841abe..5c6f7ba2e9 100644 --- a/src/tint/ast/call_expression.h +++ b/src/tint/ast/call_expression.h @@ -17,8 +17,7 @@ #include "src/tint/ast/expression.h" -namespace tint { -namespace ast { +namespace tint::ast { // Forward declarations. class Type; @@ -78,7 +77,6 @@ class CallExpression final : public Castable { const ExpressionList args; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_CALL_EXPRESSION_H_ diff --git a/src/tint/ast/call_expression_test.cc b/src/tint/ast/call_expression_test.cc index a150af6ede..4da5048e86 100644 --- a/src/tint/ast/call_expression_test.cc +++ b/src/tint/ast/call_expression_test.cc @@ -15,8 +15,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using CallExpressionTest = TestHelper; @@ -145,5 +144,4 @@ TEST_F(CallExpressionTest, Assert_DifferentProgramID_Param) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/call_statement.cc b/src/tint/ast/call_statement.cc index be2e97c687..717b1a9a50 100644 --- a/src/tint/ast/call_statement.cc +++ b/src/tint/ast/call_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::CallStatement); -namespace tint { -namespace ast { +namespace tint::ast { CallStatement::CallStatement(ProgramID pid, const Source& src, @@ -40,5 +39,4 @@ const CallStatement* CallStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src, call); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/call_statement.h b/src/tint/ast/call_statement.h index b9e0c4ce00..7b0677b829 100644 --- a/src/tint/ast/call_statement.h +++ b/src/tint/ast/call_statement.h @@ -18,8 +18,7 @@ #include "src/tint/ast/call_expression.h" #include "src/tint/ast/statement.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A call expression class CallStatement final : public Castable { @@ -43,7 +42,6 @@ class CallStatement final : public Castable { const CallExpression* const expr; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_CALL_STATEMENT_H_ diff --git a/src/tint/ast/call_statement_test.cc b/src/tint/ast/call_statement_test.cc index 1267a6d318..1f06a99af2 100644 --- a/src/tint/ast/call_statement_test.cc +++ b/src/tint/ast/call_statement_test.cc @@ -17,8 +17,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using CallStatementTest = TestHelper; @@ -56,5 +55,4 @@ TEST_F(CallStatementTest, Assert_DifferentProgramID_Call) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/case_statement.cc b/src/tint/ast/case_statement.cc index 98a2277c77..d4a5559c0e 100644 --- a/src/tint/ast/case_statement.cc +++ b/src/tint/ast/case_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::CaseStatement); -namespace tint { -namespace ast { +namespace tint::ast { CaseStatement::CaseStatement(ProgramID pid, const Source& src, @@ -46,5 +45,4 @@ const CaseStatement* CaseStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src, sel, b); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/case_statement.h b/src/tint/ast/case_statement.h index 99fd81d5f4..d030e70329 100644 --- a/src/tint/ast/case_statement.h +++ b/src/tint/ast/case_statement.h @@ -20,8 +20,7 @@ #include "src/tint/ast/block_statement.h" #include "src/tint/ast/int_literal_expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A list of case literals using CaseSelectorList = std::vector; @@ -61,7 +60,6 @@ class CaseStatement final : public Castable { /// A list of case statements using CaseStatementList = std::vector; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_CASE_STATEMENT_H_ diff --git a/src/tint/ast/case_statement_test.cc b/src/tint/ast/case_statement_test.cc index b716f9f521..d6b217f516 100644 --- a/src/tint/ast/case_statement_test.cc +++ b/src/tint/ast/case_statement_test.cc @@ -19,8 +19,7 @@ #include "src/tint/ast/if_statement.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using CaseStatementTest = TestHelper; @@ -133,5 +132,4 @@ TEST_F(CaseStatementTest, Assert_DifferentProgramID_Selector) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/compound_assignment_statement.cc b/src/tint/ast/compound_assignment_statement.cc index cc1f07cef0..2df37f7847 100644 --- a/src/tint/ast/compound_assignment_statement.cc +++ b/src/tint/ast/compound_assignment_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::CompoundAssignmentStatement); -namespace tint { -namespace ast { +namespace tint::ast { CompoundAssignmentStatement::CompoundAssignmentStatement(ProgramID pid, const Source& src, @@ -47,5 +46,4 @@ const CompoundAssignmentStatement* CompoundAssignmentStatement::Clone( return ctx->dst->create(src, l, r, op); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/compound_assignment_statement.h b/src/tint/ast/compound_assignment_statement.h index 49a2004a9b..030efeaf51 100644 --- a/src/tint/ast/compound_assignment_statement.h +++ b/src/tint/ast/compound_assignment_statement.h @@ -19,8 +19,7 @@ #include "src/tint/ast/expression.h" #include "src/tint/ast/statement.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A compound assignment statement class CompoundAssignmentStatement final @@ -57,7 +56,6 @@ class CompoundAssignmentStatement final const BinaryOp op; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_COMPOUND_ASSIGNMENT_STATEMENT_H_ diff --git a/src/tint/ast/compound_assignment_statement_test.cc b/src/tint/ast/compound_assignment_statement_test.cc index c84faf01fe..080f93eda4 100644 --- a/src/tint/ast/compound_assignment_statement_test.cc +++ b/src/tint/ast/compound_assignment_statement_test.cc @@ -17,8 +17,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using CompoundAssignmentStatementTest = TestHelper; @@ -98,5 +97,4 @@ TEST_F(CompoundAssignmentStatementTest, Assert_DifferentProgramID_RHS) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/continue_statement.cc b/src/tint/ast/continue_statement.cc index 764c9123ed..e7d669f33c 100644 --- a/src/tint/ast/continue_statement.cc +++ b/src/tint/ast/continue_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::ContinueStatement); -namespace tint { -namespace ast { +namespace tint::ast { ContinueStatement::ContinueStatement(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -34,5 +33,4 @@ const ContinueStatement* ContinueStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/continue_statement.h b/src/tint/ast/continue_statement.h index ab0b12eb94..5761bfcd1b 100644 --- a/src/tint/ast/continue_statement.h +++ b/src/tint/ast/continue_statement.h @@ -17,8 +17,7 @@ #include "src/tint/ast/statement.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An continue statement class ContinueStatement final : public Castable { @@ -38,7 +37,6 @@ class ContinueStatement final : public Castable { const ContinueStatement* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_CONTINUE_STATEMENT_H_ diff --git a/src/tint/ast/continue_statement_test.cc b/src/tint/ast/continue_statement_test.cc index 8f78852b35..943cdee4b0 100644 --- a/src/tint/ast/continue_statement_test.cc +++ b/src/tint/ast/continue_statement_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using ContinueStatementTest = TestHelper; @@ -35,5 +34,4 @@ TEST_F(ContinueStatementTest, IsContinue) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/depth_multisampled_texture.cc b/src/tint/ast/depth_multisampled_texture.cc index bda191d412..9b09864afe 100644 --- a/src/tint/ast/depth_multisampled_texture.cc +++ b/src/tint/ast/depth_multisampled_texture.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::DepthMultisampledTexture); -namespace tint { -namespace ast { +namespace tint::ast { namespace { bool IsValidDepthDimension(TextureDimension dim) { @@ -52,5 +51,4 @@ const DepthMultisampledTexture* DepthMultisampledTexture::Clone( return ctx->dst->create(src, dim); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/depth_multisampled_texture.h b/src/tint/ast/depth_multisampled_texture.h index 95051a4785..67f6ab0077 100644 --- a/src/tint/ast/depth_multisampled_texture.h +++ b/src/tint/ast/depth_multisampled_texture.h @@ -19,8 +19,7 @@ #include "src/tint/ast/texture.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A multisampled depth texture type. class DepthMultisampledTexture final @@ -48,7 +47,6 @@ class DepthMultisampledTexture final const DepthMultisampledTexture* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_DEPTH_MULTISAMPLED_TEXTURE_H_ diff --git a/src/tint/ast/depth_multisampled_texture_test.cc b/src/tint/ast/depth_multisampled_texture_test.cc index 540a66726b..0ae0adac95 100644 --- a/src/tint/ast/depth_multisampled_texture_test.cc +++ b/src/tint/ast/depth_multisampled_texture_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstDepthMultisampledTextureTest = TestHelper; @@ -33,5 +32,4 @@ TEST_F(AstDepthMultisampledTextureTest, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/depth_texture.cc b/src/tint/ast/depth_texture.cc index 5abfa76ec6..fc1c923987 100644 --- a/src/tint/ast/depth_texture.cc +++ b/src/tint/ast/depth_texture.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::DepthTexture); -namespace tint { -namespace ast { +namespace tint::ast { namespace { bool IsValidDepthDimension(TextureDimension dim) { @@ -49,5 +48,4 @@ const DepthTexture* DepthTexture::Clone(CloneContext* ctx) const { return ctx->dst->create(src, dim); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/depth_texture.h b/src/tint/ast/depth_texture.h index 62cd09df01..ddf4e9589b 100644 --- a/src/tint/ast/depth_texture.h +++ b/src/tint/ast/depth_texture.h @@ -19,8 +19,7 @@ #include "src/tint/ast/texture.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A depth texture type. class DepthTexture final : public Castable { @@ -45,7 +44,6 @@ class DepthTexture final : public Castable { const DepthTexture* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_DEPTH_TEXTURE_H_ diff --git a/src/tint/ast/depth_texture_test.cc b/src/tint/ast/depth_texture_test.cc index 2c4de5e542..4ec2aaa824 100644 --- a/src/tint/ast/depth_texture_test.cc +++ b/src/tint/ast/depth_texture_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstDepthTextureTest = TestHelper; @@ -40,5 +39,4 @@ TEST_F(AstDepthTextureTest, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/disable_validation_attribute.cc b/src/tint/ast/disable_validation_attribute.cc index e474b8ea47..cd009b4349 100644 --- a/src/tint/ast/disable_validation_attribute.cc +++ b/src/tint/ast/disable_validation_attribute.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::DisableValidationAttribute); -namespace tint { -namespace ast { +namespace tint::ast { DisableValidationAttribute::DisableValidationAttribute(ProgramID pid, DisabledValidation val) @@ -53,5 +52,4 @@ const DisableValidationAttribute* DisableValidationAttribute::Clone( validation); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/disable_validation_attribute.h b/src/tint/ast/disable_validation_attribute.h index d46edb8dab..5bc37ee396 100644 --- a/src/tint/ast/disable_validation_attribute.h +++ b/src/tint/ast/disable_validation_attribute.h @@ -19,8 +19,7 @@ #include "src/tint/ast/internal_attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// Enumerator of validation features that can be disabled with a /// DisableValidationAttribute attribute. @@ -77,7 +76,6 @@ class DisableValidationAttribute final const DisabledValidation validation; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_DISABLE_VALIDATION_ATTRIBUTE_H_ diff --git a/src/tint/ast/discard_statement.cc b/src/tint/ast/discard_statement.cc index a8f9cf6d4a..ba081ab906 100644 --- a/src/tint/ast/discard_statement.cc +++ b/src/tint/ast/discard_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::DiscardStatement); -namespace tint { -namespace ast { +namespace tint::ast { DiscardStatement::DiscardStatement(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -34,5 +33,4 @@ const DiscardStatement* DiscardStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/discard_statement.h b/src/tint/ast/discard_statement.h index 7e4fcf1d0a..c17813edf7 100644 --- a/src/tint/ast/discard_statement.h +++ b/src/tint/ast/discard_statement.h @@ -17,8 +17,7 @@ #include "src/tint/ast/statement.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A discard statement class DiscardStatement final : public Castable { @@ -38,7 +37,6 @@ class DiscardStatement final : public Castable { const DiscardStatement* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_DISCARD_STATEMENT_H_ diff --git a/src/tint/ast/discard_statement_test.cc b/src/tint/ast/discard_statement_test.cc index 08a0cc39ed..4101ef1499 100644 --- a/src/tint/ast/discard_statement_test.cc +++ b/src/tint/ast/discard_statement_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using DiscardStatementTest = TestHelper; @@ -45,5 +44,4 @@ TEST_F(DiscardStatementTest, IsDiscard) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/else_statement.cc b/src/tint/ast/else_statement.cc index 62908b550b..d047177a7f 100644 --- a/src/tint/ast/else_statement.cc +++ b/src/tint/ast/else_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::ElseStatement); -namespace tint { -namespace ast { +namespace tint::ast { ElseStatement::ElseStatement(ProgramID pid, const Source& src, @@ -43,5 +42,4 @@ const ElseStatement* ElseStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src, cond, b); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/else_statement.h b/src/tint/ast/else_statement.h index 6f641c78f9..c8c6e51fda 100644 --- a/src/tint/ast/else_statement.h +++ b/src/tint/ast/else_statement.h @@ -20,8 +20,7 @@ #include "src/tint/ast/block_statement.h" #include "src/tint/ast/expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An else statement class ElseStatement final : public Castable { @@ -55,7 +54,6 @@ class ElseStatement final : public Castable { /// A list of else statements using ElseStatementList = std::vector; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_ELSE_STATEMENT_H_ diff --git a/src/tint/ast/else_statement_test.cc b/src/tint/ast/else_statement_test.cc index 27fe9ecd4a..a088438822 100644 --- a/src/tint/ast/else_statement_test.cc +++ b/src/tint/ast/else_statement_test.cc @@ -17,8 +17,7 @@ #include "src/tint/ast/if_statement.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using ElseStatementTest = TestHelper; @@ -90,5 +89,4 @@ TEST_F(ElseStatementTest, Assert_DifferentProgramID_Body) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/expression.cc b/src/tint/ast/expression.cc index a432326eea..a7f23aace4 100644 --- a/src/tint/ast/expression.cc +++ b/src/tint/ast/expression.cc @@ -19,8 +19,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Expression); -namespace tint { -namespace ast { +namespace tint::ast { Expression::Expression(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -28,5 +27,4 @@ Expression::Expression(Expression&&) = default; Expression::~Expression() = default; -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/expression.h b/src/tint/ast/expression.h index 15bdaccf39..2338dfc3ab 100644 --- a/src/tint/ast/expression.h +++ b/src/tint/ast/expression.h @@ -21,8 +21,7 @@ #include "src/tint/ast/node.h" #include "src/tint/sem/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// Base expression class class Expression : public Castable { @@ -41,7 +40,6 @@ class Expression : public Castable { /// A list of expressions using ExpressionList = std::vector; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_EXPRESSION_H_ diff --git a/src/tint/ast/external_texture.cc b/src/tint/ast/external_texture.cc index a5a703d904..01f66f1b49 100644 --- a/src/tint/ast/external_texture.cc +++ b/src/tint/ast/external_texture.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::ExternalTexture); -namespace tint { -namespace ast { +namespace tint::ast { // ExternalTexture::ExternalTexture() : Base(ast::TextureDimension::k2d) {} ExternalTexture::ExternalTexture(ProgramID pid, const Source& src) @@ -37,5 +36,4 @@ const ExternalTexture* ExternalTexture::Clone(CloneContext* ctx) const { return ctx->dst->create(); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/external_texture.h b/src/tint/ast/external_texture.h index cf9f60da90..614bb1047f 100644 --- a/src/tint/ast/external_texture.h +++ b/src/tint/ast/external_texture.h @@ -19,8 +19,7 @@ #include "src/tint/ast/texture.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An external texture type class ExternalTexture final : public Castable { @@ -45,7 +44,6 @@ class ExternalTexture final : public Castable { const ExternalTexture* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_EXTERNAL_TEXTURE_H_ diff --git a/src/tint/ast/external_texture_test.cc b/src/tint/ast/external_texture_test.cc index af25ac2332..b4a186ec7c 100644 --- a/src/tint/ast/external_texture_test.cc +++ b/src/tint/ast/external_texture_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstExternalTextureTest = TestHelper; @@ -42,5 +41,4 @@ TEST_F(AstExternalTextureTest, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/f32.cc b/src/tint/ast/f32.cc index 319822c692..04126934aa 100644 --- a/src/tint/ast/f32.cc +++ b/src/tint/ast/f32.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::F32); -namespace tint { -namespace ast { +namespace tint::ast { F32::F32(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -36,5 +35,4 @@ const F32* F32::Clone(CloneContext* ctx) const { return ctx->dst->create(src); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/f32.h b/src/tint/ast/f32.h index 58019c9627..321cf3eb4e 100644 --- a/src/tint/ast/f32.h +++ b/src/tint/ast/f32.h @@ -19,8 +19,7 @@ #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A float 32 type class F32 final : public Castable { @@ -44,7 +43,6 @@ class F32 final : public Castable { const F32* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_F32_H_ diff --git a/src/tint/ast/f32_test.cc b/src/tint/ast/f32_test.cc index ec6d62e4ce..73791e9425 100644 --- a/src/tint/ast/f32_test.cc +++ b/src/tint/ast/f32_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstF32Test = TestHelper; @@ -28,5 +27,4 @@ TEST_F(AstF32Test, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/fallthrough_statement.cc b/src/tint/ast/fallthrough_statement.cc index 463d2add0f..ff9b3b971c 100644 --- a/src/tint/ast/fallthrough_statement.cc +++ b/src/tint/ast/fallthrough_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::FallthroughStatement); -namespace tint { -namespace ast { +namespace tint::ast { FallthroughStatement::FallthroughStatement(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -35,5 +34,4 @@ const FallthroughStatement* FallthroughStatement::Clone( return ctx->dst->create(src); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/fallthrough_statement.h b/src/tint/ast/fallthrough_statement.h index f1cc716218..262bd87ced 100644 --- a/src/tint/ast/fallthrough_statement.h +++ b/src/tint/ast/fallthrough_statement.h @@ -17,8 +17,7 @@ #include "src/tint/ast/statement.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An fallthrough statement class FallthroughStatement final @@ -39,7 +38,6 @@ class FallthroughStatement final const FallthroughStatement* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_FALLTHROUGH_STATEMENT_H_ diff --git a/src/tint/ast/fallthrough_statement_test.cc b/src/tint/ast/fallthrough_statement_test.cc index 5adda3d07e..3069f03a02 100644 --- a/src/tint/ast/fallthrough_statement_test.cc +++ b/src/tint/ast/fallthrough_statement_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using FallthroughStatementTest = TestHelper; @@ -43,5 +42,4 @@ TEST_F(FallthroughStatementTest, IsFallthrough) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/float_literal_expression.cc b/src/tint/ast/float_literal_expression.cc index b505f67afe..d22cec9286 100644 --- a/src/tint/ast/float_literal_expression.cc +++ b/src/tint/ast/float_literal_expression.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::FloatLiteralExpression); -namespace tint { -namespace ast { +namespace tint::ast { FloatLiteralExpression::FloatLiteralExpression(ProgramID pid, const Source& src, @@ -37,5 +36,4 @@ const FloatLiteralExpression* FloatLiteralExpression::Clone( return ctx->dst->create(src, value); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/float_literal_expression.h b/src/tint/ast/float_literal_expression.h index ffa3c2f3b3..e2b0fa3dbd 100644 --- a/src/tint/ast/float_literal_expression.h +++ b/src/tint/ast/float_literal_expression.h @@ -19,8 +19,7 @@ #include "src/tint/ast/literal_expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A float literal class FloatLiteralExpression final @@ -43,7 +42,6 @@ class FloatLiteralExpression final const float value; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_FLOAT_LITERAL_EXPRESSION_H_ diff --git a/src/tint/ast/float_literal_expression_test.cc b/src/tint/ast/float_literal_expression_test.cc index 7a91da9606..dfb912db10 100644 --- a/src/tint/ast/float_literal_expression_test.cc +++ b/src/tint/ast/float_literal_expression_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using FloatLiteralExpressionTest = TestHelper; @@ -27,5 +26,4 @@ TEST_F(FloatLiteralExpressionTest, Value) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/for_loop_statement.cc b/src/tint/ast/for_loop_statement.cc index 7bb9389660..0a08893f40 100644 --- a/src/tint/ast/for_loop_statement.cc +++ b/src/tint/ast/for_loop_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::ForLoopStatement); -namespace tint { -namespace ast { +namespace tint::ast { ForLoopStatement::ForLoopStatement(ProgramID pid, const Source& src, @@ -55,5 +54,4 @@ const ForLoopStatement* ForLoopStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src, init, cond, cont, b); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/for_loop_statement.h b/src/tint/ast/for_loop_statement.h index 040ba52eb3..904d3276e7 100644 --- a/src/tint/ast/for_loop_statement.h +++ b/src/tint/ast/for_loop_statement.h @@ -17,8 +17,7 @@ #include "src/tint/ast/block_statement.h" -namespace tint { -namespace ast { +namespace tint::ast { class Expression; @@ -61,7 +60,6 @@ class ForLoopStatement final : public Castable { const BlockStatement* const body; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_FOR_LOOP_STATEMENT_H_ diff --git a/src/tint/ast/for_loop_statement_test.cc b/src/tint/ast/for_loop_statement_test.cc index 3e5e585e03..9c03a3071e 100644 --- a/src/tint/ast/for_loop_statement_test.cc +++ b/src/tint/ast/for_loop_statement_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/binary_expression.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using ForLoopStatementTest = TestHelper; @@ -100,5 +99,4 @@ TEST_F(ForLoopStatementTest, Assert_DifferentProgramID_Body) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/function.cc b/src/tint/ast/function.cc index cba809131d..885ca5100d 100644 --- a/src/tint/ast/function.cc +++ b/src/tint/ast/function.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Function); -namespace tint { -namespace ast { +namespace tint::ast { Function::Function(ProgramID pid, const Source& src, @@ -104,5 +103,4 @@ bool FunctionList::HasStage(ast::PipelineStage stage) const { return false; } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/function.h b/src/tint/ast/function.h index 10ad7a69ea..e23edf7952 100644 --- a/src/tint/ast/function.h +++ b/src/tint/ast/function.h @@ -29,8 +29,7 @@ #include "src/tint/ast/pipeline_stage.h" #include "src/tint/ast/variable.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A Function statement. class Function final : public Castable { @@ -112,7 +111,6 @@ class FunctionList : public std::vector { bool HasStage(PipelineStage stage) const; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_FUNCTION_H_ diff --git a/src/tint/ast/function_test.cc b/src/tint/ast/function_test.cc index d4077bdf05..7851ff9919 100644 --- a/src/tint/ast/function_test.cc +++ b/src/tint/ast/function_test.cc @@ -18,8 +18,7 @@ #include "src/tint/ast/test_helper.h" #include "src/tint/ast/workgroup_attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using FunctionTest = TestHelper; @@ -192,5 +191,4 @@ TEST_F(FunctionListTest, HasStage) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/group_attribute.cc b/src/tint/ast/group_attribute.cc index 58714e8630..9cd82b933d 100644 --- a/src/tint/ast/group_attribute.cc +++ b/src/tint/ast/group_attribute.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::GroupAttribute); -namespace tint { -namespace ast { +namespace tint::ast { GroupAttribute::GroupAttribute(ProgramID pid, const Source& src, uint32_t val) : Base(pid, src), value(val) {} @@ -38,5 +37,4 @@ const GroupAttribute* GroupAttribute::Clone(CloneContext* ctx) const { return ctx->dst->create(src, value); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/group_attribute.h b/src/tint/ast/group_attribute.h index be5c61e785..de7015b235 100644 --- a/src/tint/ast/group_attribute.h +++ b/src/tint/ast/group_attribute.h @@ -19,8 +19,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A group attribute class GroupAttribute final : public Castable { @@ -45,7 +44,6 @@ class GroupAttribute final : public Castable { const uint32_t value; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_GROUP_ATTRIBUTE_H_ diff --git a/src/tint/ast/group_attribute_test.cc b/src/tint/ast/group_attribute_test.cc index fd7c18baf4..38cd30933b 100644 --- a/src/tint/ast/group_attribute_test.cc +++ b/src/tint/ast/group_attribute_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using GroupAttributeTest = TestHelper; @@ -26,5 +25,4 @@ TEST_F(GroupAttributeTest, Creation) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/i32.cc b/src/tint/ast/i32.cc index 83e45240c3..294699df72 100644 --- a/src/tint/ast/i32.cc +++ b/src/tint/ast/i32.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::I32); -namespace tint { -namespace ast { +namespace tint::ast { I32::I32(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -36,5 +35,4 @@ const I32* I32::Clone(CloneContext* ctx) const { return ctx->dst->create(src); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/i32.h b/src/tint/ast/i32.h index 335bc98fed..62043e6731 100644 --- a/src/tint/ast/i32.h +++ b/src/tint/ast/i32.h @@ -19,8 +19,7 @@ #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A signed int 32 type. class I32 final : public Castable { @@ -44,7 +43,6 @@ class I32 final : public Castable { const I32* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_I32_H_ diff --git a/src/tint/ast/i32_test.cc b/src/tint/ast/i32_test.cc index 7e1c265e2f..7a632a7772 100644 --- a/src/tint/ast/i32_test.cc +++ b/src/tint/ast/i32_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstI32Test = TestHelper; @@ -28,5 +27,4 @@ TEST_F(AstI32Test, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/id_attribute.cc b/src/tint/ast/id_attribute.cc index b94b4503a5..ac5957d4b3 100644 --- a/src/tint/ast/id_attribute.cc +++ b/src/tint/ast/id_attribute.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::IdAttribute); -namespace tint { -namespace ast { +namespace tint::ast { IdAttribute::IdAttribute(ProgramID pid, const Source& src, uint32_t val) : Base(pid, src), value(val) {} @@ -38,5 +37,4 @@ const IdAttribute* IdAttribute::Clone(CloneContext* ctx) const { return ctx->dst->create(src, value); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/id_attribute.h b/src/tint/ast/id_attribute.h index 7fbac0edeb..4789e0d24e 100644 --- a/src/tint/ast/id_attribute.h +++ b/src/tint/ast/id_attribute.h @@ -19,8 +19,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An id attribute for pipeline-overridable constants class IdAttribute final : public Castable { @@ -45,7 +44,6 @@ class IdAttribute final : public Castable { const uint32_t value; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_ID_ATTRIBUTE_H_ diff --git a/src/tint/ast/id_attribute_test.cc b/src/tint/ast/id_attribute_test.cc index c3c372b7e9..af623ba60e 100644 --- a/src/tint/ast/id_attribute_test.cc +++ b/src/tint/ast/id_attribute_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using IdAttributeTest = TestHelper; @@ -28,5 +27,4 @@ TEST_F(IdAttributeTest, Creation) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/identifier_expression.cc b/src/tint/ast/identifier_expression.cc index 1f73a45692..ff04f737b5 100644 --- a/src/tint/ast/identifier_expression.cc +++ b/src/tint/ast/identifier_expression.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::IdentifierExpression); -namespace tint { -namespace ast { +namespace tint::ast { IdentifierExpression::IdentifierExpression(ProgramID pid, const Source& src, @@ -41,5 +40,4 @@ const IdentifierExpression* IdentifierExpression::Clone( return ctx->dst->create(src, sym); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/identifier_expression.h b/src/tint/ast/identifier_expression.h index 6c3c8b3b98..80e013e6f2 100644 --- a/src/tint/ast/identifier_expression.h +++ b/src/tint/ast/identifier_expression.h @@ -17,8 +17,7 @@ #include "src/tint/ast/expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An identifier expression class IdentifierExpression final @@ -43,7 +42,6 @@ class IdentifierExpression final const Symbol symbol; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_IDENTIFIER_EXPRESSION_H_ diff --git a/src/tint/ast/identifier_expression_test.cc b/src/tint/ast/identifier_expression_test.cc index b8c3a2a485..0609eb11c3 100644 --- a/src/tint/ast/identifier_expression_test.cc +++ b/src/tint/ast/identifier_expression_test.cc @@ -15,8 +15,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using IdentifierExpressionTest = TestHelper; @@ -60,5 +59,4 @@ TEST_F(IdentifierExpressionTest, Assert_DifferentProgramID_Symbol) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/if_statement.cc b/src/tint/ast/if_statement.cc index 276d5d2293..4b78da3252 100644 --- a/src/tint/ast/if_statement.cc +++ b/src/tint/ast/if_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::IfStatement); -namespace tint { -namespace ast { +namespace tint::ast { IfStatement::IfStatement(ProgramID pid, const Source& src, @@ -53,5 +52,4 @@ const IfStatement* IfStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src, cond, b, el); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/if_statement.h b/src/tint/ast/if_statement.h index dae9fd7716..df843f8727 100644 --- a/src/tint/ast/if_statement.h +++ b/src/tint/ast/if_statement.h @@ -19,8 +19,7 @@ #include "src/tint/ast/else_statement.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An if statement class IfStatement final : public Castable { @@ -56,7 +55,6 @@ class IfStatement final : public Castable { const ElseStatementList else_statements; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_IF_STATEMENT_H_ diff --git a/src/tint/ast/if_statement_test.cc b/src/tint/ast/if_statement_test.cc index 6090eca382..83f998ae15 100644 --- a/src/tint/ast/if_statement_test.cc +++ b/src/tint/ast/if_statement_test.cc @@ -18,8 +18,7 @@ #include "src/tint/ast/discard_statement.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using IfStatementTest = TestHelper; @@ -102,5 +101,4 @@ TEST_F(IfStatementTest, Assert_DifferentProgramID_ElseStatement) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/index_accessor_expression.cc b/src/tint/ast/index_accessor_expression.cc index afd73fd8a2..6fed4eae5a 100644 --- a/src/tint/ast/index_accessor_expression.cc +++ b/src/tint/ast/index_accessor_expression.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::IndexAccessorExpression); -namespace tint { -namespace ast { +namespace tint::ast { IndexAccessorExpression::IndexAccessorExpression(ProgramID pid, const Source& src, @@ -46,5 +45,4 @@ const IndexAccessorExpression* IndexAccessorExpression::Clone( return ctx->dst->create(src, obj, idx); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/index_accessor_expression.h b/src/tint/ast/index_accessor_expression.h index 6fabadafa3..a5e48ccd3d 100644 --- a/src/tint/ast/index_accessor_expression.h +++ b/src/tint/ast/index_accessor_expression.h @@ -17,8 +17,7 @@ #include "src/tint/ast/expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An index accessor expression class IndexAccessorExpression final @@ -50,7 +49,6 @@ class IndexAccessorExpression final const Expression* const index; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_INDEX_ACCESSOR_EXPRESSION_H_ diff --git a/src/tint/ast/index_accessor_expression_test.cc b/src/tint/ast/index_accessor_expression_test.cc index 8b91239f6f..45fef2b889 100644 --- a/src/tint/ast/index_accessor_expression_test.cc +++ b/src/tint/ast/index_accessor_expression_test.cc @@ -15,8 +15,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using IndexAccessorExpressionTest = TestHelper; @@ -87,5 +86,4 @@ TEST_F(IndexAccessorExpressionTest, Assert_DifferentProgramID_Index) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/int_literal_expression.cc b/src/tint/ast/int_literal_expression.cc index 05c9f2ddce..8cd68c987d 100644 --- a/src/tint/ast/int_literal_expression.cc +++ b/src/tint/ast/int_literal_expression.cc @@ -16,13 +16,11 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::IntLiteralExpression); -namespace tint { -namespace ast { +namespace tint::ast { IntLiteralExpression::IntLiteralExpression(ProgramID pid, const Source& src) : Base(pid, src) {} IntLiteralExpression::~IntLiteralExpression() = default; -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/int_literal_expression.h b/src/tint/ast/int_literal_expression.h index 9da44bbd79..9ca31053ce 100644 --- a/src/tint/ast/int_literal_expression.h +++ b/src/tint/ast/int_literal_expression.h @@ -17,8 +17,7 @@ #include "src/tint/ast/literal_expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An integer literal. This could be either signed or unsigned. class IntLiteralExpression @@ -39,7 +38,6 @@ class IntLiteralExpression IntLiteralExpression(ProgramID pid, const Source& src); }; // namespace ast -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_INT_LITERAL_EXPRESSION_H_ diff --git a/src/tint/ast/int_literal_expression_test.cc b/src/tint/ast/int_literal_expression_test.cc index e64d456de7..d04def1b91 100644 --- a/src/tint/ast/int_literal_expression_test.cc +++ b/src/tint/ast/int_literal_expression_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using IntLiteralExpressionTest = TestHelper; @@ -31,5 +30,4 @@ TEST_F(IntLiteralExpressionTest, Uint_IsInt) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/internal_attribute.cc b/src/tint/ast/internal_attribute.cc index 7f8c84be3e..b42af9cf85 100644 --- a/src/tint/ast/internal_attribute.cc +++ b/src/tint/ast/internal_attribute.cc @@ -16,8 +16,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::InternalAttribute); -namespace tint { -namespace ast { +namespace tint::ast { InternalAttribute::InternalAttribute(ProgramID pid) : Base(pid, Source{}) {} @@ -27,5 +26,4 @@ std::string InternalAttribute::Name() const { return "internal"; } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/internal_attribute.h b/src/tint/ast/internal_attribute.h index 6a9fd4a367..7e35dcb3f8 100644 --- a/src/tint/ast/internal_attribute.h +++ b/src/tint/ast/internal_attribute.h @@ -19,8 +19,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// An attribute used to indicate that a function is tint-internal. /// These attributes are not produced by generators, but instead are usually @@ -42,7 +41,6 @@ class InternalAttribute : public Castable { std::string Name() const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_INTERNAL_ATTRIBUTE_H_ diff --git a/src/tint/ast/interpolate_attribute.cc b/src/tint/ast/interpolate_attribute.cc index 1cf62c681c..6f452a9cc5 100644 --- a/src/tint/ast/interpolate_attribute.cc +++ b/src/tint/ast/interpolate_attribute.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::InterpolateAttribute); -namespace tint { -namespace ast { +namespace tint::ast { InterpolateAttribute::InterpolateAttribute(ProgramID pid, const Source& src, @@ -82,5 +81,4 @@ std::ostream& operator<<(std::ostream& out, InterpolationSampling sampling) { return out; } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/interpolate_attribute.h b/src/tint/ast/interpolate_attribute.h index ac3b49d650..a659ef9fc9 100644 --- a/src/tint/ast/interpolate_attribute.h +++ b/src/tint/ast/interpolate_attribute.h @@ -20,8 +20,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// The interpolation type. enum class InterpolationType { kPerspective, kLinear, kFlat }; @@ -70,7 +69,6 @@ std::ostream& operator<<(std::ostream& out, InterpolationType type); /// @return the std::ostream so calls can be chained std::ostream& operator<<(std::ostream& out, InterpolationSampling sampling); -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_INTERPOLATE_ATTRIBUTE_H_ diff --git a/src/tint/ast/interpolate_attribute_test.cc b/src/tint/ast/interpolate_attribute_test.cc index e8417b2a86..8bf85e1db4 100644 --- a/src/tint/ast/interpolate_attribute_test.cc +++ b/src/tint/ast/interpolate_attribute_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using InterpolateAttributeTest = TestHelper; @@ -30,5 +29,4 @@ TEST_F(InterpolateAttributeTest, Creation) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/invariant_attribute.cc b/src/tint/ast/invariant_attribute.cc index f893b8a72b..31dd4b7d2c 100644 --- a/src/tint/ast/invariant_attribute.cc +++ b/src/tint/ast/invariant_attribute.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::InvariantAttribute); -namespace tint { -namespace ast { +namespace tint::ast { InvariantAttribute::InvariantAttribute(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -36,5 +35,4 @@ const InvariantAttribute* InvariantAttribute::Clone(CloneContext* ctx) const { return ctx->dst->create(src); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/invariant_attribute.h b/src/tint/ast/invariant_attribute.h index 08a58e87fb..375eb3c0a2 100644 --- a/src/tint/ast/invariant_attribute.h +++ b/src/tint/ast/invariant_attribute.h @@ -19,8 +19,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// The invariant attribute class InvariantAttribute final @@ -42,7 +41,6 @@ class InvariantAttribute final const InvariantAttribute* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_INVARIANT_ATTRIBUTE_H_ diff --git a/src/tint/ast/invariant_attribute_test.cc b/src/tint/ast/invariant_attribute_test.cc index 7b09ed6315..edc7498f43 100644 --- a/src/tint/ast/invariant_attribute_test.cc +++ b/src/tint/ast/invariant_attribute_test.cc @@ -16,12 +16,10 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using InvariantAttributeTest = TestHelper; } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/literal_expression.cc b/src/tint/ast/literal_expression.cc index 25aa908e6a..6863357a6a 100644 --- a/src/tint/ast/literal_expression.cc +++ b/src/tint/ast/literal_expression.cc @@ -16,13 +16,11 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::LiteralExpression); -namespace tint { -namespace ast { +namespace tint::ast { LiteralExpression::LiteralExpression(ProgramID pid, const Source& src) : Base(pid, src) {} LiteralExpression::~LiteralExpression() = default; -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/literal_expression.h b/src/tint/ast/literal_expression.h index 0b1c708560..e794f59bc5 100644 --- a/src/tint/ast/literal_expression.h +++ b/src/tint/ast/literal_expression.h @@ -19,8 +19,7 @@ #include "src/tint/ast/expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// Base class for a literal value expressions class LiteralExpression : public Castable { @@ -34,7 +33,6 @@ class LiteralExpression : public Castable { LiteralExpression(ProgramID pid, const Source& src); }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_LITERAL_EXPRESSION_H_ diff --git a/src/tint/ast/location_attribute.cc b/src/tint/ast/location_attribute.cc index 9f3a53d3af..e6d4f68dc1 100644 --- a/src/tint/ast/location_attribute.cc +++ b/src/tint/ast/location_attribute.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::LocationAttribute); -namespace tint { -namespace ast { +namespace tint::ast { LocationAttribute::LocationAttribute(ProgramID pid, const Source& src, @@ -40,5 +39,4 @@ const LocationAttribute* LocationAttribute::Clone(CloneContext* ctx) const { return ctx->dst->create(src, value); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/location_attribute.h b/src/tint/ast/location_attribute.h index 3c8078d5f5..eefd863e9e 100644 --- a/src/tint/ast/location_attribute.h +++ b/src/tint/ast/location_attribute.h @@ -19,8 +19,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A location attribute class LocationAttribute final : public Castable { @@ -45,7 +44,6 @@ class LocationAttribute final : public Castable { const uint32_t value; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_LOCATION_ATTRIBUTE_H_ diff --git a/src/tint/ast/location_attribute_test.cc b/src/tint/ast/location_attribute_test.cc index e826a1cd29..e71b7fb156 100644 --- a/src/tint/ast/location_attribute_test.cc +++ b/src/tint/ast/location_attribute_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using LocationAttributeTest = TestHelper; @@ -26,5 +25,4 @@ TEST_F(LocationAttributeTest, Creation) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/loop_statement.cc b/src/tint/ast/loop_statement.cc index 4e490fd209..35f8d7937b 100644 --- a/src/tint/ast/loop_statement.cc +++ b/src/tint/ast/loop_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::LoopStatement); -namespace tint { -namespace ast { +namespace tint::ast { LoopStatement::LoopStatement(ProgramID pid, const Source& src, @@ -43,5 +42,4 @@ const LoopStatement* LoopStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src, b, cont); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/loop_statement.h b/src/tint/ast/loop_statement.h index be29fc0459..921b68eabe 100644 --- a/src/tint/ast/loop_statement.h +++ b/src/tint/ast/loop_statement.h @@ -17,8 +17,7 @@ #include "src/tint/ast/block_statement.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A loop statement class LoopStatement final : public Castable { @@ -49,7 +48,6 @@ class LoopStatement final : public Castable { const BlockStatement* const continuing; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_LOOP_STATEMENT_H_ diff --git a/src/tint/ast/loop_statement_test.cc b/src/tint/ast/loop_statement_test.cc index 17cf7e93fc..9c8e812be5 100644 --- a/src/tint/ast/loop_statement_test.cc +++ b/src/tint/ast/loop_statement_test.cc @@ -19,8 +19,7 @@ #include "src/tint/ast/if_statement.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using LoopStatementTest = TestHelper; @@ -101,5 +100,4 @@ TEST_F(LoopStatementTest, Assert_DifferentProgramID_Continuing) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/matrix.cc b/src/tint/ast/matrix.cc index ce65483d08..b9baa27693 100644 --- a/src/tint/ast/matrix.cc +++ b/src/tint/ast/matrix.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Matrix); -namespace tint { -namespace ast { +namespace tint::ast { Matrix::Matrix(ProgramID pid, const Source& src, @@ -52,5 +51,4 @@ const Matrix* Matrix::Clone(CloneContext* ctx) const { return ctx->dst->create(src, ty, rows, columns); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/matrix.h b/src/tint/ast/matrix.h index 0ba418c4f5..cb1f6d9d37 100644 --- a/src/tint/ast/matrix.h +++ b/src/tint/ast/matrix.h @@ -19,8 +19,7 @@ #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A matrix type class Matrix final : public Castable { @@ -64,7 +63,6 @@ class Matrix final : public Castable { const uint32_t columns; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_MATRIX_H_ diff --git a/src/tint/ast/matrix_test.cc b/src/tint/ast/matrix_test.cc index 9bb4b8cf28..54c11eb29d 100644 --- a/src/tint/ast/matrix_test.cc +++ b/src/tint/ast/matrix_test.cc @@ -27,8 +27,7 @@ #include "src/tint/ast/u32.h" #include "src/tint/ast/vector.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstMatrixTest = TestHelper; @@ -48,5 +47,4 @@ TEST_F(AstMatrixTest, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/member_accessor_expression.cc b/src/tint/ast/member_accessor_expression.cc index 1b5a724481..71f1991efe 100644 --- a/src/tint/ast/member_accessor_expression.cc +++ b/src/tint/ast/member_accessor_expression.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::MemberAccessorExpression); -namespace tint { -namespace ast { +namespace tint::ast { MemberAccessorExpression::MemberAccessorExpression( ProgramID pid, @@ -47,5 +46,4 @@ const MemberAccessorExpression* MemberAccessorExpression::Clone( return ctx->dst->create(src, str, mem); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/member_accessor_expression.h b/src/tint/ast/member_accessor_expression.h index 8a82ba1915..800d018051 100644 --- a/src/tint/ast/member_accessor_expression.h +++ b/src/tint/ast/member_accessor_expression.h @@ -17,8 +17,7 @@ #include "src/tint/ast/identifier_expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A member accessor expression class MemberAccessorExpression final @@ -50,7 +49,6 @@ class MemberAccessorExpression final const IdentifierExpression* const member; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_MEMBER_ACCESSOR_EXPRESSION_H_ diff --git a/src/tint/ast/member_accessor_expression_test.cc b/src/tint/ast/member_accessor_expression_test.cc index 12c4e1f0a5..ed134a040e 100644 --- a/src/tint/ast/member_accessor_expression_test.cc +++ b/src/tint/ast/member_accessor_expression_test.cc @@ -15,8 +15,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using MemberAccessorExpressionTest = TestHelper; @@ -85,5 +84,4 @@ TEST_F(MemberAccessorExpressionTest, Assert_DifferentProgramID_Member) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/module.cc b/src/tint/ast/module.cc index 49634f861b..8fd5caef91 100644 --- a/src/tint/ast/module.cc +++ b/src/tint/ast/module.cc @@ -21,8 +21,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Module); -namespace tint { -namespace ast { +namespace tint::ast { Module::Module(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -123,5 +122,4 @@ void Module::Copy(CloneContext* ctx, const Module* src) { } } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/module.h b/src/tint/ast/module.h index b98013da1b..03e64d940f 100644 --- a/src/tint/ast/module.h +++ b/src/tint/ast/module.h @@ -21,8 +21,7 @@ #include "src/tint/ast/function.h" #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { class TypeDecl; @@ -119,7 +118,6 @@ class Module final : public Castable { VariableList global_variables_; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_MODULE_H_ diff --git a/src/tint/ast/module_clone_test.cc b/src/tint/ast/module_clone_test.cc index 4e92f25312..3cb900bf31 100644 --- a/src/tint/ast/module_clone_test.cc +++ b/src/tint/ast/module_clone_test.cc @@ -18,8 +18,7 @@ #include "src/tint/reader/wgsl/parser.h" #include "src/tint/writer/wgsl/generator.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { TEST(ModuleCloneTest, Clone) { @@ -177,5 +176,4 @@ let declaration_order_check_4 : i32 = 1; } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/module_test.cc b/src/tint/ast/module_test.cc index 21b48dc6ad..0d655092d0 100644 --- a/src/tint/ast/module_test.cc +++ b/src/tint/ast/module_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" #include "src/tint/clone_context.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using ModuleTest = TestHelper; @@ -139,5 +138,4 @@ TEST_F(ModuleTest, CloneOrder) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/multisampled_texture.cc b/src/tint/ast/multisampled_texture.cc index f216a3cffa..fd5fc59f74 100644 --- a/src/tint/ast/multisampled_texture.cc +++ b/src/tint/ast/multisampled_texture.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::MultisampledTexture); -namespace tint { -namespace ast { +namespace tint::ast { MultisampledTexture::MultisampledTexture(ProgramID pid, const Source& src, @@ -48,5 +47,4 @@ const MultisampledTexture* MultisampledTexture::Clone(CloneContext* ctx) const { return ctx->dst->create(src, dim, ty); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/multisampled_texture.h b/src/tint/ast/multisampled_texture.h index fbc3db05e4..92141241ee 100644 --- a/src/tint/ast/multisampled_texture.h +++ b/src/tint/ast/multisampled_texture.h @@ -19,8 +19,7 @@ #include "src/tint/ast/texture.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A multisampled texture type. class MultisampledTexture final @@ -53,7 +52,6 @@ class MultisampledTexture final const Type* const type; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_MULTISAMPLED_TEXTURE_H_ diff --git a/src/tint/ast/multisampled_texture_test.cc b/src/tint/ast/multisampled_texture_test.cc index ba7ffb521d..14b3252765 100644 --- a/src/tint/ast/multisampled_texture_test.cc +++ b/src/tint/ast/multisampled_texture_test.cc @@ -32,8 +32,7 @@ #include "src/tint/ast/u32.h" #include "src/tint/ast/vector.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstMultisampledTextureTest = TestHelper; @@ -66,5 +65,4 @@ TEST_F(AstMultisampledTextureTest, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/node.cc b/src/tint/ast/node.cc index b90f0ef627..2368791d3d 100644 --- a/src/tint/ast/node.cc +++ b/src/tint/ast/node.cc @@ -16,8 +16,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Node); -namespace tint { -namespace ast { +namespace tint::ast { Node::Node(ProgramID pid, const Source& src) : program_id(pid), source(src) {} @@ -25,5 +24,4 @@ Node::Node(Node&&) = default; Node::~Node() = default; -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/node.h b/src/tint/ast/node.h index 01b017b574..49a917c37f 100644 --- a/src/tint/ast/node.h +++ b/src/tint/ast/node.h @@ -19,17 +19,16 @@ #include "src/tint/clone_context.h" -namespace tint { - // Forward declarations +namespace tint { class CloneContext; namespace sem { class Type; -} -namespace sem { class Info; } +} // namespace tint +namespace tint { namespace ast { /// AST base class node diff --git a/src/tint/ast/phony_expression.cc b/src/tint/ast/phony_expression.cc index c05fb1d9d0..eb52063f46 100644 --- a/src/tint/ast/phony_expression.cc +++ b/src/tint/ast/phony_expression.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::PhonyExpression); -namespace tint { -namespace ast { +namespace tint::ast { PhonyExpression::PhonyExpression(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -34,5 +33,4 @@ const PhonyExpression* PhonyExpression::Clone(CloneContext* ctx) const { return ctx->dst->create(src); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/phony_expression.h b/src/tint/ast/phony_expression.h index e021846d81..b6012b0c1d 100644 --- a/src/tint/ast/phony_expression.h +++ b/src/tint/ast/phony_expression.h @@ -17,8 +17,7 @@ #include "src/tint/ast/expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// Represents the `_` of a phony assignment `_ = ` /// @see https://www.w3.org/TR/WGSL/#phony-assignment-section @@ -39,7 +38,6 @@ class PhonyExpression final : public Castable { const PhonyExpression* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_PHONY_EXPRESSION_H_ diff --git a/src/tint/ast/phony_expression_test.cc b/src/tint/ast/phony_expression_test.cc index 568a2d0966..f15b2ffd11 100644 --- a/src/tint/ast/phony_expression_test.cc +++ b/src/tint/ast/phony_expression_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using IdentifierExpressionTest = TestHelper; @@ -38,5 +37,4 @@ TEST_F(IdentifierExpressionTest, IsPhony) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/pipeline_stage.cc b/src/tint/ast/pipeline_stage.cc index 9f5203dd9c..fc604a1a8d 100644 --- a/src/tint/ast/pipeline_stage.cc +++ b/src/tint/ast/pipeline_stage.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/pipeline_stage.h" -namespace tint { -namespace ast { +namespace tint::ast { std::ostream& operator<<(std::ostream& out, PipelineStage stage) { switch (stage) { @@ -39,5 +38,4 @@ std::ostream& operator<<(std::ostream& out, PipelineStage stage) { return out; } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/pipeline_stage.h b/src/tint/ast/pipeline_stage.h index 37e50309f2..a1b9c0cf84 100644 --- a/src/tint/ast/pipeline_stage.h +++ b/src/tint/ast/pipeline_stage.h @@ -17,8 +17,7 @@ #include -namespace tint { -namespace ast { +namespace tint::ast { /// The pipeline stage enum class PipelineStage { kNone = -1, kVertex, kFragment, kCompute }; @@ -28,7 +27,6 @@ enum class PipelineStage { kNone = -1, kVertex, kFragment, kCompute }; /// @return the std::ostream so calls can be chained std::ostream& operator<<(std::ostream& out, PipelineStage stage); -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_PIPELINE_STAGE_H_ diff --git a/src/tint/ast/pointer.cc b/src/tint/ast/pointer.cc index 1db6fc0b0b..74b1da7400 100644 --- a/src/tint/ast/pointer.cc +++ b/src/tint/ast/pointer.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Pointer); -namespace tint { -namespace ast { +namespace tint::ast { Pointer::Pointer(ProgramID pid, const Source& src, @@ -53,5 +52,4 @@ const Pointer* Pointer::Clone(CloneContext* ctx) const { return ctx->dst->create(src, ty, storage_class, access); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/pointer.h b/src/tint/ast/pointer.h index c73eb40933..9742e78c44 100644 --- a/src/tint/ast/pointer.h +++ b/src/tint/ast/pointer.h @@ -21,8 +21,7 @@ #include "src/tint/ast/storage_class.h" #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A pointer type. class Pointer final : public Castable { @@ -62,7 +61,6 @@ class Pointer final : public Castable { ast::Access const access; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_POINTER_H_ diff --git a/src/tint/ast/pointer_test.cc b/src/tint/ast/pointer_test.cc index ec5520c369..c755e1e117 100644 --- a/src/tint/ast/pointer_test.cc +++ b/src/tint/ast/pointer_test.cc @@ -17,8 +17,7 @@ #include "src/tint/ast/i32.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstPointerTest = TestHelper; @@ -46,5 +45,4 @@ TEST_F(AstPointerTest, FriendlyNameWithAccess) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/return_statement.cc b/src/tint/ast/return_statement.cc index 61b6d45546..0adbecb0a9 100644 --- a/src/tint/ast/return_statement.cc +++ b/src/tint/ast/return_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::ReturnStatement); -namespace tint { -namespace ast { +namespace tint::ast { ReturnStatement::ReturnStatement(ProgramID pid, const Source& src) : Base(pid, src), value(nullptr) {} @@ -42,5 +41,4 @@ const ReturnStatement* ReturnStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src, ret); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/return_statement.h b/src/tint/ast/return_statement.h index 5a20ff4f24..d43874cc84 100644 --- a/src/tint/ast/return_statement.h +++ b/src/tint/ast/return_statement.h @@ -18,8 +18,7 @@ #include "src/tint/ast/expression.h" #include "src/tint/ast/statement.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A return statement class ReturnStatement final : public Castable { @@ -48,7 +47,6 @@ class ReturnStatement final : public Castable { const Expression* const value; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_RETURN_STATEMENT_H_ diff --git a/src/tint/ast/return_statement_test.cc b/src/tint/ast/return_statement_test.cc index 93c75a7fcf..d17a89d1a0 100644 --- a/src/tint/ast/return_statement_test.cc +++ b/src/tint/ast/return_statement_test.cc @@ -17,8 +17,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using ReturnStatementTest = TestHelper; @@ -64,5 +63,4 @@ TEST_F(ReturnStatementTest, Assert_DifferentProgramID_Expr) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/sampled_texture.cc b/src/tint/ast/sampled_texture.cc index 7937ad5438..21cb0f5932 100644 --- a/src/tint/ast/sampled_texture.cc +++ b/src/tint/ast/sampled_texture.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::SampledTexture); -namespace tint { -namespace ast { +namespace tint::ast { SampledTexture::SampledTexture(ProgramID pid, const Source& src, @@ -46,5 +45,4 @@ const SampledTexture* SampledTexture::Clone(CloneContext* ctx) const { return ctx->dst->create(src, dim, ty); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/sampled_texture.h b/src/tint/ast/sampled_texture.h index 6d0820ce6e..d7c28f5df6 100644 --- a/src/tint/ast/sampled_texture.h +++ b/src/tint/ast/sampled_texture.h @@ -19,8 +19,7 @@ #include "src/tint/ast/texture.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A sampled texture type. class SampledTexture final : public Castable { @@ -52,7 +51,6 @@ class SampledTexture final : public Castable { const Type* const type; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_SAMPLED_TEXTURE_H_ diff --git a/src/tint/ast/sampled_texture_test.cc b/src/tint/ast/sampled_texture_test.cc index 033751d053..d89ff96bd4 100644 --- a/src/tint/ast/sampled_texture_test.cc +++ b/src/tint/ast/sampled_texture_test.cc @@ -17,8 +17,7 @@ #include "src/tint/ast/f32.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstSampledTextureTest = TestHelper; @@ -50,5 +49,4 @@ TEST_F(AstSampledTextureTest, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/sampler.cc b/src/tint/ast/sampler.cc index 2db571d0eb..68eddaf074 100644 --- a/src/tint/ast/sampler.cc +++ b/src/tint/ast/sampler.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Sampler); -namespace tint { -namespace ast { +namespace tint::ast { std::ostream& operator<<(std::ostream& out, SamplerKind kind) { switch (kind) { @@ -49,5 +48,4 @@ const Sampler* Sampler::Clone(CloneContext* ctx) const { return ctx->dst->create(src, kind); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/sampler.h b/src/tint/ast/sampler.h index 8724384534..18c6fa2c3e 100644 --- a/src/tint/ast/sampler.h +++ b/src/tint/ast/sampler.h @@ -19,8 +19,7 @@ #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// The different kinds of samplers enum class SamplerKind { @@ -64,7 +63,6 @@ class Sampler final : public Castable { const SamplerKind kind; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_SAMPLER_H_ diff --git a/src/tint/ast/sampler_test.cc b/src/tint/ast/sampler_test.cc index 2ae7d42a05..16e2129004 100644 --- a/src/tint/ast/sampler_test.cc +++ b/src/tint/ast/sampler_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstSamplerTest = TestHelper; @@ -44,5 +43,4 @@ TEST_F(AstSamplerTest, FriendlyNameComparisonSampler) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/sint_literal_expression.cc b/src/tint/ast/sint_literal_expression.cc index fc0a4b3e6c..5a215ece80 100644 --- a/src/tint/ast/sint_literal_expression.cc +++ b/src/tint/ast/sint_literal_expression.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::SintLiteralExpression); -namespace tint { -namespace ast { +namespace tint::ast { SintLiteralExpression::SintLiteralExpression(ProgramID pid, const Source& src, @@ -39,5 +38,4 @@ const SintLiteralExpression* SintLiteralExpression::Clone( return ctx->dst->create(src, value); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/sint_literal_expression.h b/src/tint/ast/sint_literal_expression.h index 1431dd233e..74d60fc250 100644 --- a/src/tint/ast/sint_literal_expression.h +++ b/src/tint/ast/sint_literal_expression.h @@ -19,8 +19,7 @@ #include "src/tint/ast/int_literal_expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A signed int literal class SintLiteralExpression final @@ -46,7 +45,6 @@ class SintLiteralExpression final const int32_t value; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_SINT_LITERAL_EXPRESSION_H_ diff --git a/src/tint/ast/sint_literal_expression_test.cc b/src/tint/ast/sint_literal_expression_test.cc index f19fff956c..79be9b2c62 100644 --- a/src/tint/ast/sint_literal_expression_test.cc +++ b/src/tint/ast/sint_literal_expression_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using SintLiteralExpressionTest = TestHelper; @@ -27,5 +26,4 @@ TEST_F(SintLiteralExpressionTest, Value) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/stage_attribute.cc b/src/tint/ast/stage_attribute.cc index 92cc802d6d..0b596336d8 100644 --- a/src/tint/ast/stage_attribute.cc +++ b/src/tint/ast/stage_attribute.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::StageAttribute); -namespace tint { -namespace ast { +namespace tint::ast { StageAttribute::StageAttribute(ProgramID pid, const Source& src, @@ -40,5 +39,4 @@ const StageAttribute* StageAttribute::Clone(CloneContext* ctx) const { return ctx->dst->create(src, stage); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/stage_attribute.h b/src/tint/ast/stage_attribute.h index 7bf918c1f9..6195eaa997 100644 --- a/src/tint/ast/stage_attribute.h +++ b/src/tint/ast/stage_attribute.h @@ -20,8 +20,7 @@ #include "src/tint/ast/attribute.h" #include "src/tint/ast/pipeline_stage.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A workgroup attribute class StageAttribute final : public Castable { @@ -48,7 +47,6 @@ class StageAttribute final : public Castable { const PipelineStage stage; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_STAGE_ATTRIBUTE_H_ diff --git a/src/tint/ast/stage_attribute_test.cc b/src/tint/ast/stage_attribute_test.cc index e1cc93a929..f1d8b5a490 100644 --- a/src/tint/ast/stage_attribute_test.cc +++ b/src/tint/ast/stage_attribute_test.cc @@ -17,8 +17,7 @@ #include "src/tint/ast/test_helper.h" #include "src/tint/ast/workgroup_attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using StageAttributeTest = TestHelper; @@ -29,5 +28,4 @@ TEST_F(StageAttributeTest, Creation_1param) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/statement.cc b/src/tint/ast/statement.cc index de02bbd357..0d8750dcef 100644 --- a/src/tint/ast/statement.cc +++ b/src/tint/ast/statement.cc @@ -28,8 +28,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Statement); -namespace tint { -namespace ast { +namespace tint::ast { Statement::Statement(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -83,5 +82,4 @@ const char* Statement::Name() const { return "statement"; } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/statement.h b/src/tint/ast/statement.h index e6c9a1c8fd..931e1b5ab6 100644 --- a/src/tint/ast/statement.h +++ b/src/tint/ast/statement.h @@ -19,8 +19,7 @@ #include "src/tint/ast/node.h" -namespace tint { -namespace ast { +namespace tint::ast { /// Base statement class class Statement : public Castable { @@ -42,7 +41,6 @@ class Statement : public Castable { /// A list of statements using StatementList = std::vector; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_STATEMENT_H_ diff --git a/src/tint/ast/storage_class.cc b/src/tint/ast/storage_class.cc index b760647aa6..00d6d92fe0 100644 --- a/src/tint/ast/storage_class.cc +++ b/src/tint/ast/storage_class.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/storage_class.h" -namespace tint { -namespace ast { +namespace tint::ast { const char* ToString(StorageClass sc) { switch (sc) { @@ -47,5 +46,4 @@ std::ostream& operator<<(std::ostream& out, StorageClass sc) { return out; } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/storage_class.h b/src/tint/ast/storage_class.h index bc224688c4..dc7a94a4de 100644 --- a/src/tint/ast/storage_class.h +++ b/src/tint/ast/storage_class.h @@ -17,8 +17,7 @@ #include -namespace tint { -namespace ast { +namespace tint::ast { /// Storage class of a given pointer. enum class StorageClass { @@ -50,7 +49,6 @@ const char* ToString(StorageClass sc); /// @return the std::ostream so calls can be chained std::ostream& operator<<(std::ostream& out, StorageClass sc); -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_STORAGE_CLASS_H_ diff --git a/src/tint/ast/storage_texture.cc b/src/tint/ast/storage_texture.cc index 9f818ec88f..170b2ee752 100644 --- a/src/tint/ast/storage_texture.cc +++ b/src/tint/ast/storage_texture.cc @@ -21,8 +21,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::StorageTexture); -namespace tint { -namespace ast { +namespace tint::ast { // Note, these names match the names in the WGSL spec. This behaviour is used // in the WGSL writer to emit the texture format names. @@ -142,5 +141,4 @@ Type* StorageTexture::SubtypeFor(TexelFormat format, ProgramBuilder& builder) { return nullptr; } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/storage_texture.h b/src/tint/ast/storage_texture.h index 9af93af249..ca962c1eba 100644 --- a/src/tint/ast/storage_texture.h +++ b/src/tint/ast/storage_texture.h @@ -20,8 +20,7 @@ #include "src/tint/ast/access.h" #include "src/tint/ast/texture.h" -namespace tint { -namespace ast { +namespace tint::ast { /// The texel format in the storage texture enum class TexelFormat { @@ -95,7 +94,6 @@ class StorageTexture final : public Castable { const Access access; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_STORAGE_TEXTURE_H_ diff --git a/src/tint/ast/storage_texture_test.cc b/src/tint/ast/storage_texture_test.cc index 5186b7e4aa..77447a8488 100644 --- a/src/tint/ast/storage_texture_test.cc +++ b/src/tint/ast/storage_texture_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstStorageTextureTest = TestHelper; @@ -91,5 +90,4 @@ TEST_F(AstStorageTextureTest, I32) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/stride_attribute.cc b/src/tint/ast/stride_attribute.cc index 1c763acd87..3eb1f6d688 100644 --- a/src/tint/ast/stride_attribute.cc +++ b/src/tint/ast/stride_attribute.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::StrideAttribute); -namespace tint { -namespace ast { +namespace tint::ast { StrideAttribute::StrideAttribute(ProgramID pid, const Source& src, uint32_t s) : Base(pid, src), stride(s) {} @@ -38,5 +37,4 @@ const StrideAttribute* StrideAttribute::Clone(CloneContext* ctx) const { return ctx->dst->create(src, stride); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/stride_attribute.h b/src/tint/ast/stride_attribute.h index 0aa3baf63e..232bae7823 100644 --- a/src/tint/ast/stride_attribute.h +++ b/src/tint/ast/stride_attribute.h @@ -20,8 +20,7 @@ #include "src/tint/ast/attribute.h" #include "src/tint/ast/internal_attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A stride attribute used by the SPIR-V reader for strided arrays and /// matrices. @@ -47,7 +46,6 @@ class StrideAttribute final : public Castable { const uint32_t stride; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_STRIDE_ATTRIBUTE_H_ diff --git a/src/tint/ast/stride_attribute_test.cc b/src/tint/ast/stride_attribute_test.cc index f8549ecffd..1eba1e1b57 100644 --- a/src/tint/ast/stride_attribute_test.cc +++ b/src/tint/ast/stride_attribute_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using StrideAttributeTest = TestHelper; @@ -35,5 +34,4 @@ TEST_F(StrideAttributeTest, Source) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/struct.cc b/src/tint/ast/struct.cc index c33c07d704..4f82c3ac24 100644 --- a/src/tint/ast/struct.cc +++ b/src/tint/ast/struct.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Struct); -namespace tint { -namespace ast { +namespace tint::ast { Struct::Struct(ProgramID pid, const Source& src, @@ -52,5 +51,4 @@ const Struct* Struct::Clone(CloneContext* ctx) const { return ctx->dst->create(src, n, mem, attrs); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/struct.h b/src/tint/ast/struct.h index 076c46d346..7e44da40da 100644 --- a/src/tint/ast/struct.h +++ b/src/tint/ast/struct.h @@ -22,8 +22,7 @@ #include "src/tint/ast/struct_member.h" #include "src/tint/ast/type_decl.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A struct statement. class Struct final : public Castable { @@ -57,7 +56,6 @@ class Struct final : public Castable { const AttributeList attributes; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_STRUCT_H_ diff --git a/src/tint/ast/struct_member.cc b/src/tint/ast/struct_member.cc index 2afb10d98d..b1cff3b0ed 100644 --- a/src/tint/ast/struct_member.cc +++ b/src/tint/ast/struct_member.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::StructMember); -namespace tint { -namespace ast { +namespace tint::ast { StructMember::StructMember(ProgramID pid, const Source& src, @@ -49,5 +48,4 @@ const StructMember* StructMember::Clone(CloneContext* ctx) const { return ctx->dst->create(src, sym, ty, attrs); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/struct_member.h b/src/tint/ast/struct_member.h index 4be9256837..4d3bb026e9 100644 --- a/src/tint/ast/struct_member.h +++ b/src/tint/ast/struct_member.h @@ -20,8 +20,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { // Forward declaration class Type; @@ -64,7 +63,6 @@ class StructMember final : public Castable { /// A list of struct members using StructMemberList = std::vector; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_STRUCT_MEMBER_H_ diff --git a/src/tint/ast/struct_member_align_attribute.cc b/src/tint/ast/struct_member_align_attribute.cc index 7790800d0a..8736dd102d 100644 --- a/src/tint/ast/struct_member_align_attribute.cc +++ b/src/tint/ast/struct_member_align_attribute.cc @@ -21,8 +21,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::StructMemberAlignAttribute); -namespace tint { -namespace ast { +namespace tint::ast { StructMemberAlignAttribute::StructMemberAlignAttribute(ProgramID pid, const Source& src, @@ -42,5 +41,4 @@ const StructMemberAlignAttribute* StructMemberAlignAttribute::Clone( return ctx->dst->create(src, align); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/struct_member_align_attribute.h b/src/tint/ast/struct_member_align_attribute.h index a1b455bcba..d8e629ea18 100644 --- a/src/tint/ast/struct_member_align_attribute.h +++ b/src/tint/ast/struct_member_align_attribute.h @@ -20,8 +20,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A struct member align attribute class StructMemberAlignAttribute final @@ -47,7 +46,6 @@ class StructMemberAlignAttribute final const uint32_t align; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_STRUCT_MEMBER_ALIGN_ATTRIBUTE_H_ diff --git a/src/tint/ast/struct_member_align_attribute_test.cc b/src/tint/ast/struct_member_align_attribute_test.cc index 9dcddd4c30..47b57aa403 100644 --- a/src/tint/ast/struct_member_align_attribute_test.cc +++ b/src/tint/ast/struct_member_align_attribute_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using StructMemberAlignAttributeTest = TestHelper; @@ -28,5 +27,4 @@ TEST_F(StructMemberAlignAttributeTest, Creation) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/struct_member_offset_attribute.cc b/src/tint/ast/struct_member_offset_attribute.cc index a854f8c0da..5d9ec16e20 100644 --- a/src/tint/ast/struct_member_offset_attribute.cc +++ b/src/tint/ast/struct_member_offset_attribute.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::StructMemberOffsetAttribute); -namespace tint { -namespace ast { +namespace tint::ast { StructMemberOffsetAttribute::StructMemberOffsetAttribute(ProgramID pid, const Source& src, @@ -41,5 +40,4 @@ const StructMemberOffsetAttribute* StructMemberOffsetAttribute::Clone( return ctx->dst->create(src, offset); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/struct_member_offset_attribute.h b/src/tint/ast/struct_member_offset_attribute.h index 63db9595ca..b1a25e08fd 100644 --- a/src/tint/ast/struct_member_offset_attribute.h +++ b/src/tint/ast/struct_member_offset_attribute.h @@ -19,8 +19,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A struct member offset attribute /// @note The WGSL spec removed the `@offset(n)` attribute for `@size(n)` @@ -57,7 +56,6 @@ class StructMemberOffsetAttribute final const uint32_t offset; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_STRUCT_MEMBER_OFFSET_ATTRIBUTE_H_ diff --git a/src/tint/ast/struct_member_offset_attribute_test.cc b/src/tint/ast/struct_member_offset_attribute_test.cc index 022821a29f..8039926234 100644 --- a/src/tint/ast/struct_member_offset_attribute_test.cc +++ b/src/tint/ast/struct_member_offset_attribute_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using StructMemberOffsetAttributeTest = TestHelper; @@ -26,5 +25,4 @@ TEST_F(StructMemberOffsetAttributeTest, Creation) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/struct_member_size_attribute.cc b/src/tint/ast/struct_member_size_attribute.cc index d76820ae92..5e01c7d6cc 100644 --- a/src/tint/ast/struct_member_size_attribute.cc +++ b/src/tint/ast/struct_member_size_attribute.cc @@ -21,8 +21,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::StructMemberSizeAttribute); -namespace tint { -namespace ast { +namespace tint::ast { StructMemberSizeAttribute::StructMemberSizeAttribute(ProgramID pid, const Source& src, @@ -42,5 +41,4 @@ const StructMemberSizeAttribute* StructMemberSizeAttribute::Clone( return ctx->dst->create(src, size); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/struct_member_size_attribute.h b/src/tint/ast/struct_member_size_attribute.h index c2a6e505a0..967e602b2c 100644 --- a/src/tint/ast/struct_member_size_attribute.h +++ b/src/tint/ast/struct_member_size_attribute.h @@ -20,8 +20,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A struct member size attribute class StructMemberSizeAttribute final @@ -47,7 +46,6 @@ class StructMemberSizeAttribute final const uint32_t size; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_STRUCT_MEMBER_SIZE_ATTRIBUTE_H_ diff --git a/src/tint/ast/struct_member_size_attribute_test.cc b/src/tint/ast/struct_member_size_attribute_test.cc index 346535d739..8998d1d861 100644 --- a/src/tint/ast/struct_member_size_attribute_test.cc +++ b/src/tint/ast/struct_member_size_attribute_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using StructMemberSizeAttributeTest = TestHelper; @@ -28,5 +27,4 @@ TEST_F(StructMemberSizeAttributeTest, Creation) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/struct_member_test.cc b/src/tint/ast/struct_member_test.cc index c675a471c4..9fd4d7b129 100644 --- a/src/tint/ast/struct_member_test.cc +++ b/src/tint/ast/struct_member_test.cc @@ -15,8 +15,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using StructMemberTest = TestHelper; @@ -94,5 +93,4 @@ TEST_F(StructMemberTest, Assert_DifferentProgramID_Attribute) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/struct_test.cc b/src/tint/ast/struct_test.cc index 3b02767bfd..2c629a2d25 100644 --- a/src/tint/ast/struct_test.cc +++ b/src/tint/ast/struct_test.cc @@ -28,8 +28,7 @@ #include "src/tint/ast/vector.h" #include "src/tint/transform/add_spirv_block_attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstStructTest = TestHelper; @@ -129,5 +128,4 @@ TEST_F(AstStructTest, Assert_DifferentProgramID_Attribute) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/switch_statement.cc b/src/tint/ast/switch_statement.cc index 02cbb619ca..13c455a2ae 100644 --- a/src/tint/ast/switch_statement.cc +++ b/src/tint/ast/switch_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::SwitchStatement); -namespace tint { -namespace ast { +namespace tint::ast { SwitchStatement::SwitchStatement(ProgramID pid, const Source& src, @@ -46,5 +45,4 @@ const SwitchStatement* SwitchStatement::Clone(CloneContext* ctx) const { return ctx->dst->create(src, cond, b); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/switch_statement.h b/src/tint/ast/switch_statement.h index aa0cc77e26..34394c83d1 100644 --- a/src/tint/ast/switch_statement.h +++ b/src/tint/ast/switch_statement.h @@ -18,8 +18,7 @@ #include "src/tint/ast/case_statement.h" #include "src/tint/ast/expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A switch statement class SwitchStatement final : public Castable { @@ -54,7 +53,6 @@ class SwitchStatement final : public Castable { SwitchStatement(const SwitchStatement&) = delete; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_SWITCH_STATEMENT_H_ diff --git a/src/tint/ast/switch_statement_test.cc b/src/tint/ast/switch_statement_test.cc index ecbf68c4c4..3b927ce39d 100644 --- a/src/tint/ast/switch_statement_test.cc +++ b/src/tint/ast/switch_statement_test.cc @@ -17,8 +17,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using SwitchStatementTest = TestHelper; @@ -114,5 +113,4 @@ TEST_F(SwitchStatementTest, Assert_DifferentProgramID_CaseStatement) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/test_helper.h b/src/tint/ast/test_helper.h index 2c3be987cc..cf9474d1b0 100644 --- a/src/tint/ast/test_helper.h +++ b/src/tint/ast/test_helper.h @@ -18,8 +18,7 @@ #include "gtest/gtest.h" #include "src/tint/program_builder.h" -namespace tint { -namespace ast { +namespace tint::ast { /// Helper base class for testing template @@ -32,7 +31,6 @@ using TestHelper = TestHelperBase; template using TestParamHelper = TestHelperBase>; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_TEST_HELPER_H_ diff --git a/src/tint/ast/texture.cc b/src/tint/ast/texture.cc index 38d16e4c3b..d88db6e438 100644 --- a/src/tint/ast/texture.cc +++ b/src/tint/ast/texture.cc @@ -16,8 +16,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Texture); -namespace tint { -namespace ast { +namespace tint::ast { std::ostream& operator<<(std::ostream& out, TextureDimension dim) { switch (dim) { @@ -85,5 +84,4 @@ Texture::Texture(Texture&&) = default; Texture::~Texture() = default; -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/texture.h b/src/tint/ast/texture.h index 41e893a8a1..716cdf07a9 100644 --- a/src/tint/ast/texture.h +++ b/src/tint/ast/texture.h @@ -17,8 +17,7 @@ #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// The dimensionality of the texture enum class TextureDimension { @@ -77,7 +76,6 @@ class Texture : public Castable { const TextureDimension dim; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_TEXTURE_H_ diff --git a/src/tint/ast/texture_test.cc b/src/tint/ast/texture_test.cc index 017d56ec81..84298b8981 100644 --- a/src/tint/ast/texture_test.cc +++ b/src/tint/ast/texture_test.cc @@ -27,8 +27,7 @@ #include "src/tint/ast/u32.h" #include "src/tint/ast/vector.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstTextureTypeTest = TestHelper; @@ -54,5 +53,4 @@ TEST_F(AstTextureTypeTest, NumCoordinateAxes) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/traverse_expressions.h b/src/tint/ast/traverse_expressions.h index 084a201673..77f27a2673 100644 --- a/src/tint/ast/traverse_expressions.h +++ b/src/tint/ast/traverse_expressions.h @@ -27,8 +27,7 @@ #include "src/tint/ast/unary_op_expression.h" #include "src/tint/utils/reverse.h" -namespace tint { -namespace ast { +namespace tint::ast { /// The action to perform after calling the TraverseExpressions() callback /// function. @@ -148,7 +147,6 @@ bool TraverseExpressions(const ast::Expression* root, return true; } -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_TRAVERSE_EXPRESSIONS_H_ diff --git a/src/tint/ast/traverse_expressions_test.cc b/src/tint/ast/traverse_expressions_test.cc index ae839baf81..cacc93f875 100644 --- a/src/tint/ast/traverse_expressions_test.cc +++ b/src/tint/ast/traverse_expressions_test.cc @@ -16,8 +16,7 @@ #include "gmock/gmock.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using ::testing::ElementsAre; @@ -233,5 +232,4 @@ TEST_F(TraverseExpressionsTest, Stop) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/type.h b/src/tint/ast/type.h index 815498808f..f9c8e3146a 100644 --- a/src/tint/ast/type.h +++ b/src/tint/ast/type.h @@ -20,14 +20,13 @@ #include "src/tint/ast/node.h" #include "src/tint/clone_context.h" -namespace tint { - // Forward declarations +namespace tint { class ProgramBuilder; class SymbolTable; +} // namespace tint -namespace ast { - +namespace tint::ast { /// Base class for a type in the system class Type : public Castable { public: @@ -47,7 +46,6 @@ class Type : public Castable { Type(ProgramID pid, const Source& src); }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_TYPE_H_ diff --git a/src/tint/ast/type_decl.cc b/src/tint/ast/type_decl.cc index 6d0b30113e..04c221c1db 100644 --- a/src/tint/ast/type_decl.cc +++ b/src/tint/ast/type_decl.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::TypeDecl); -namespace tint { -namespace ast { +namespace tint::ast { TypeDecl::TypeDecl(ProgramID pid, const Source& src, Symbol n) : Base(pid, src), name(n) { @@ -30,5 +29,4 @@ TypeDecl::TypeDecl(TypeDecl&&) = default; TypeDecl::~TypeDecl() = default; -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/type_decl.h b/src/tint/ast/type_decl.h index 0e290cdea2..de3bd0a1d8 100644 --- a/src/tint/ast/type_decl.h +++ b/src/tint/ast/type_decl.h @@ -19,8 +19,7 @@ #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// The base class for type declarations. class TypeDecl : public Castable { @@ -39,7 +38,6 @@ class TypeDecl : public Castable { const Symbol name; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_TYPE_DECL_H_ diff --git a/src/tint/ast/type_name.cc b/src/tint/ast/type_name.cc index 1f58b9e1c6..8e84a555d0 100644 --- a/src/tint/ast/type_name.cc +++ b/src/tint/ast/type_name.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::TypeName); -namespace tint { -namespace ast { +namespace tint::ast { TypeName::TypeName(ProgramID pid, const Source& src, Symbol n) : Base(pid, src), name(n) {} @@ -38,5 +37,4 @@ const TypeName* TypeName::Clone(CloneContext* ctx) const { return ctx->dst->create(src, n); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/type_name.h b/src/tint/ast/type_name.h index 9bae5d0574..bd3968aa69 100644 --- a/src/tint/ast/type_name.h +++ b/src/tint/ast/type_name.h @@ -19,8 +19,7 @@ #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A named type (i.e. struct or alias) class TypeName final : public Castable { @@ -49,7 +48,6 @@ class TypeName final : public Castable { Symbol name; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_TYPE_NAME_H_ diff --git a/src/tint/ast/u32.cc b/src/tint/ast/u32.cc index 892289a6d9..6cabe5b630 100644 --- a/src/tint/ast/u32.cc +++ b/src/tint/ast/u32.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::U32); -namespace tint { -namespace ast { +namespace tint::ast { U32::U32(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -36,5 +35,4 @@ const U32* U32::Clone(CloneContext* ctx) const { return ctx->dst->create(src); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/u32.h b/src/tint/ast/u32.h index a31222b1f3..ede477b42b 100644 --- a/src/tint/ast/u32.h +++ b/src/tint/ast/u32.h @@ -19,8 +19,7 @@ #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A unsigned int 32 type. class U32 final : public Castable { @@ -44,7 +43,6 @@ class U32 final : public Castable { const U32* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_U32_H_ diff --git a/src/tint/ast/u32_test.cc b/src/tint/ast/u32_test.cc index 9e8e5a64ea..30a8840b55 100644 --- a/src/tint/ast/u32_test.cc +++ b/src/tint/ast/u32_test.cc @@ -16,8 +16,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstU32Test = TestHelper; @@ -28,5 +27,4 @@ TEST_F(AstU32Test, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/uint_literal_expression.cc b/src/tint/ast/uint_literal_expression.cc index d53e3eb454..7af3325128 100644 --- a/src/tint/ast/uint_literal_expression.cc +++ b/src/tint/ast/uint_literal_expression.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::UintLiteralExpression); -namespace tint { -namespace ast { +namespace tint::ast { UintLiteralExpression::UintLiteralExpression(ProgramID pid, const Source& src, @@ -39,5 +38,4 @@ const UintLiteralExpression* UintLiteralExpression::Clone( return ctx->dst->create(src, value); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/uint_literal_expression.h b/src/tint/ast/uint_literal_expression.h index 58fdb9607d..35ef5fa5a2 100644 --- a/src/tint/ast/uint_literal_expression.h +++ b/src/tint/ast/uint_literal_expression.h @@ -19,8 +19,7 @@ #include "src/tint/ast/int_literal_expression.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A uint literal class UintLiteralExpression final @@ -46,7 +45,6 @@ class UintLiteralExpression final const uint32_t value; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_UINT_LITERAL_EXPRESSION_H_ diff --git a/src/tint/ast/uint_literal_expression_test.cc b/src/tint/ast/uint_literal_expression_test.cc index 1732dde180..f37816f438 100644 --- a/src/tint/ast/uint_literal_expression_test.cc +++ b/src/tint/ast/uint_literal_expression_test.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using UintLiteralExpressionTest = TestHelper; @@ -27,5 +26,4 @@ TEST_F(UintLiteralExpressionTest, Value) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/unary_op.cc b/src/tint/ast/unary_op.cc index 4b363f5ac1..b90c71dc9f 100644 --- a/src/tint/ast/unary_op.cc +++ b/src/tint/ast/unary_op.cc @@ -14,8 +14,7 @@ #include "src/tint/ast/unary_op.h" -namespace tint { -namespace ast { +namespace tint::ast { std::ostream& operator<<(std::ostream& out, UnaryOp mod) { switch (mod) { @@ -43,5 +42,4 @@ std::ostream& operator<<(std::ostream& out, UnaryOp mod) { return out; } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/unary_op.h b/src/tint/ast/unary_op.h index 33fdbbff72..93b6722205 100644 --- a/src/tint/ast/unary_op.h +++ b/src/tint/ast/unary_op.h @@ -17,8 +17,7 @@ #include -namespace tint { -namespace ast { +namespace tint::ast { /// The unary op enum class UnaryOp { @@ -34,7 +33,6 @@ enum class UnaryOp { /// @return the std::ostream so calls can be chained std::ostream& operator<<(std::ostream& out, UnaryOp mod); -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_UNARY_OP_H_ diff --git a/src/tint/ast/unary_op_expression.cc b/src/tint/ast/unary_op_expression.cc index 032fa02996..7636a5450a 100644 --- a/src/tint/ast/unary_op_expression.cc +++ b/src/tint/ast/unary_op_expression.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::UnaryOpExpression); -namespace tint { -namespace ast { +namespace tint::ast { UnaryOpExpression::UnaryOpExpression(ProgramID pid, const Source& src, @@ -41,5 +40,4 @@ const UnaryOpExpression* UnaryOpExpression::Clone(CloneContext* ctx) const { return ctx->dst->create(src, op, e); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/unary_op_expression.h b/src/tint/ast/unary_op_expression.h index 9b19a77552..1164108490 100644 --- a/src/tint/ast/unary_op_expression.h +++ b/src/tint/ast/unary_op_expression.h @@ -18,8 +18,7 @@ #include "src/tint/ast/expression.h" #include "src/tint/ast/unary_op.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A unary op expression class UnaryOpExpression final : public Castable { @@ -50,7 +49,6 @@ class UnaryOpExpression final : public Castable { const Expression* const expr; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_UNARY_OP_EXPRESSION_H_ diff --git a/src/tint/ast/unary_op_expression_test.cc b/src/tint/ast/unary_op_expression_test.cc index 3f1b1cf525..5baf5daf6a 100644 --- a/src/tint/ast/unary_op_expression_test.cc +++ b/src/tint/ast/unary_op_expression_test.cc @@ -17,8 +17,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using UnaryOpExpressionTest = TestHelper; @@ -66,5 +65,4 @@ TEST_F(UnaryOpExpressionTest, Assert_DifferentProgramID_Expression) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/variable.cc b/src/tint/ast/variable.cc index 62d8dd9e98..cea9f847f5 100644 --- a/src/tint/ast/variable.cc +++ b/src/tint/ast/variable.cc @@ -19,8 +19,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Variable); -namespace tint { -namespace ast { +namespace tint::ast { Variable::Variable(ProgramID pid, const Source& src, @@ -75,5 +74,4 @@ const Variable* Variable::Clone(CloneContext* ctx) const { is_overridable, ctor, attrs); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/variable.h b/src/tint/ast/variable.h index 88b6ad28f3..27a55644b8 100644 --- a/src/tint/ast/variable.h +++ b/src/tint/ast/variable.h @@ -23,8 +23,7 @@ #include "src/tint/ast/expression.h" #include "src/tint/ast/storage_class.h" -namespace tint { -namespace ast { +namespace tint::ast { // Forward declarations class BindingAttribute; @@ -180,7 +179,6 @@ class Variable final : public Castable { /// A list of variables using VariableList = std::vector; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_VARIABLE_H_ diff --git a/src/tint/ast/variable_decl_statement.cc b/src/tint/ast/variable_decl_statement.cc index 6adf183330..16d1106836 100644 --- a/src/tint/ast/variable_decl_statement.cc +++ b/src/tint/ast/variable_decl_statement.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::VariableDeclStatement); -namespace tint { -namespace ast { +namespace tint::ast { VariableDeclStatement::VariableDeclStatement(ProgramID pid, const Source& src, @@ -41,5 +40,4 @@ const VariableDeclStatement* VariableDeclStatement::Clone( return ctx->dst->create(src, var); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/variable_decl_statement.h b/src/tint/ast/variable_decl_statement.h index 47fb8ab36d..2edee63637 100644 --- a/src/tint/ast/variable_decl_statement.h +++ b/src/tint/ast/variable_decl_statement.h @@ -18,8 +18,7 @@ #include "src/tint/ast/statement.h" #include "src/tint/ast/variable.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A variable declaration statement class VariableDeclStatement final @@ -46,7 +45,6 @@ class VariableDeclStatement final const Variable* const variable; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_VARIABLE_DECL_STATEMENT_H_ diff --git a/src/tint/ast/variable_decl_statement_test.cc b/src/tint/ast/variable_decl_statement_test.cc index 9881c666e0..e628d96b83 100644 --- a/src/tint/ast/variable_decl_statement_test.cc +++ b/src/tint/ast/variable_decl_statement_test.cc @@ -17,8 +17,7 @@ #include "gtest/gtest-spi.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using VariableDeclStatementTest = TestHelper; @@ -68,5 +67,4 @@ TEST_F(VariableDeclStatementTest, Assert_DifferentProgramID_Variable) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/variable_test.cc b/src/tint/ast/variable_test.cc index b053c0fa56..334bcb30ae 100644 --- a/src/tint/ast/variable_test.cc +++ b/src/tint/ast/variable_test.cc @@ -17,8 +17,7 @@ #include "src/tint/ast/id_attribute.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using VariableTest = TestHelper; @@ -152,5 +151,4 @@ TEST_F(VariableTest, BindingPointMissingBindingAttribute) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/vector.cc b/src/tint/ast/vector.cc index d63a61b9f5..d47aad3a8c 100644 --- a/src/tint/ast/vector.cc +++ b/src/tint/ast/vector.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Vector); -namespace tint { -namespace ast { +namespace tint::ast { Vector::Vector(ProgramID pid, Source const& src, @@ -51,5 +50,4 @@ const Vector* Vector::Clone(CloneContext* ctx) const { return ctx->dst->create(src, ty, width); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/vector.h b/src/tint/ast/vector.h index bfc4908376..dfa2ac24b2 100644 --- a/src/tint/ast/vector.h +++ b/src/tint/ast/vector.h @@ -19,8 +19,7 @@ #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A vector type. class Vector final : public Castable { @@ -56,7 +55,6 @@ class Vector final : public Castable { const uint32_t width; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_VECTOR_H_ diff --git a/src/tint/ast/vector_test.cc b/src/tint/ast/vector_test.cc index a029e73171..19c7c4ef86 100644 --- a/src/tint/ast/vector_test.cc +++ b/src/tint/ast/vector_test.cc @@ -17,8 +17,7 @@ #include "src/tint/ast/i32.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using AstVectorTest = TestHelper; @@ -37,5 +36,4 @@ TEST_F(AstVectorTest, FriendlyName) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/void.cc b/src/tint/ast/void.cc index 1abb83cd9e..34314ae595 100644 --- a/src/tint/ast/void.cc +++ b/src/tint/ast/void.cc @@ -18,8 +18,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::Void); -namespace tint { -namespace ast { +namespace tint::ast { Void::Void(ProgramID pid, const Source& src) : Base(pid, src) {} @@ -36,5 +35,4 @@ const Void* Void::Clone(CloneContext* ctx) const { return ctx->dst->create(src); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/void.h b/src/tint/ast/void.h index 94d382fbfb..55ddb35c72 100644 --- a/src/tint/ast/void.h +++ b/src/tint/ast/void.h @@ -19,8 +19,7 @@ #include "src/tint/ast/type.h" -namespace tint { -namespace ast { +namespace tint::ast { /// A void type class Void final : public Castable { @@ -44,7 +43,6 @@ class Void final : public Castable { const Void* Clone(CloneContext* ctx) const override; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_VOID_H_ diff --git a/src/tint/ast/workgroup_attribute.cc b/src/tint/ast/workgroup_attribute.cc index 7ff69540fa..1f7a112a03 100644 --- a/src/tint/ast/workgroup_attribute.cc +++ b/src/tint/ast/workgroup_attribute.cc @@ -20,8 +20,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::ast::WorkgroupAttribute); -namespace tint { -namespace ast { +namespace tint::ast { WorkgroupAttribute::WorkgroupAttribute(ProgramID pid, const Source& src, @@ -45,5 +44,4 @@ const WorkgroupAttribute* WorkgroupAttribute::Clone(CloneContext* ctx) const { return ctx->dst->create(src, x_, y_, z_); } -} // namespace ast -} // namespace tint +} // namespace tint::ast diff --git a/src/tint/ast/workgroup_attribute.h b/src/tint/ast/workgroup_attribute.h index 5ffc7c644e..116c731b44 100644 --- a/src/tint/ast/workgroup_attribute.h +++ b/src/tint/ast/workgroup_attribute.h @@ -20,8 +20,7 @@ #include "src/tint/ast/attribute.h" -namespace tint { -namespace ast { +namespace tint::ast { // Forward declaration class Expression; @@ -64,7 +63,6 @@ class WorkgroupAttribute final const ast::Expression* const z = nullptr; }; -} // namespace ast -} // namespace tint +} // namespace tint::ast #endif // SRC_TINT_AST_WORKGROUP_ATTRIBUTE_H_ diff --git a/src/tint/ast/workgroup_attribute_test.cc b/src/tint/ast/workgroup_attribute_test.cc index ecf718623a..928b5fea2c 100644 --- a/src/tint/ast/workgroup_attribute_test.cc +++ b/src/tint/ast/workgroup_attribute_test.cc @@ -17,8 +17,7 @@ #include "src/tint/ast/stage_attribute.h" #include "src/tint/ast/test_helper.h" -namespace tint { -namespace ast { +namespace tint::ast { namespace { using WorkgroupAttributeTest = TestHelper; @@ -76,5 +75,4 @@ TEST_F(WorkgroupAttributeTest, Creation_WithIdentifier) { } } // namespace -} // namespace ast -} // namespace tint +} // namespace tint::ast