diff --git a/src/tint/reader/spirv/construct.cc b/src/tint/reader/spirv/construct.cc index 23808e1484..2307c24d45 100644 --- a/src/tint/reader/spirv/construct.cc +++ b/src/tint/reader/spirv/construct.cc @@ -14,9 +14,7 @@ #include "src/tint/reader/spirv/construct.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { Construct::Construct(const Construct* the_parent, int the_depth, @@ -65,6 +63,4 @@ Construct::Construct(const Construct* the_parent, end_pos(the_end_pos), scope_end_pos(the_scope_end_pos) {} -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/construct.h b/src/tint/reader/spirv/construct.h index 898b682104..fbefc8fa84 100644 --- a/src/tint/reader/spirv/construct.h +++ b/src/tint/reader/spirv/construct.h @@ -20,9 +20,7 @@ #include #include -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { /// A structured control flow construct, consisting of a set of basic blocks. /// A construct is a span of blocks in the computed block order, @@ -271,8 +269,6 @@ inline std::string ToString(const ConstructList& cl) { return ss.str(); } -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv #endif // SRC_TINT_READER_SPIRV_CONSTRUCT_H_ diff --git a/src/tint/reader/spirv/entry_point_info.cc b/src/tint/reader/spirv/entry_point_info.cc index 5258606d74..2677494a12 100644 --- a/src/tint/reader/spirv/entry_point_info.cc +++ b/src/tint/reader/spirv/entry_point_info.cc @@ -16,9 +16,7 @@ #include -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { EntryPointInfo::EntryPointInfo(std::string the_name, ast::PipelineStage the_stage, @@ -39,6 +37,4 @@ EntryPointInfo::EntryPointInfo(const EntryPointInfo&) = default; EntryPointInfo::~EntryPointInfo() = default; -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/entry_point_info.h b/src/tint/reader/spirv/entry_point_info.h index e65b79d826..374bd8302a 100644 --- a/src/tint/reader/spirv/entry_point_info.h +++ b/src/tint/reader/spirv/entry_point_info.h @@ -20,9 +20,7 @@ #include "src/tint/ast/pipeline_stage.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { /// The size of an integer-coordinate grid, in the x, y, and z dimensions. struct GridSize { @@ -88,8 +86,6 @@ struct EntryPointInfo { GridSize workgroup_size; }; -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv #endif // SRC_TINT_READER_SPIRV_ENTRY_POINT_INFO_H_ diff --git a/src/tint/reader/spirv/enum_converter.cc b/src/tint/reader/spirv/enum_converter.cc index a197bac360..2cd1daa883 100644 --- a/src/tint/reader/spirv/enum_converter.cc +++ b/src/tint/reader/spirv/enum_converter.cc @@ -14,9 +14,7 @@ #include "src/tint/reader/spirv/enum_converter.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { EnumConverter::EnumConverter(const FailStream& fs) : fail_stream_(fs) {} @@ -177,6 +175,4 @@ ast::TexelFormat EnumConverter::ToTexelFormat(SpvImageFormat fmt) { return ast::TexelFormat::kNone; } -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/enum_converter.h b/src/tint/reader/spirv/enum_converter.h index d2caac3357..4a31cfec11 100644 --- a/src/tint/reader/spirv/enum_converter.h +++ b/src/tint/reader/spirv/enum_converter.h @@ -22,9 +22,7 @@ #include "src/tint/reader/spirv/fail_stream.h" #include "src/tint/sem/storage_texture_type.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { /// A converter from SPIR-V enums to Tint AST enums. class EnumConverter { @@ -74,8 +72,6 @@ class EnumConverter { FailStream fail_stream_; }; -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv #endif // SRC_TINT_READER_SPIRV_ENUM_CONVERTER_H_ diff --git a/src/tint/reader/spirv/enum_converter_test.cc b/src/tint/reader/spirv/enum_converter_test.cc index eec14f393c..6f9e2a17e5 100644 --- a/src/tint/reader/spirv/enum_converter_test.cc +++ b/src/tint/reader/spirv/enum_converter_test.cc @@ -18,9 +18,7 @@ #include "gmock/gmock.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { // Pipeline stage @@ -424,6 +422,4 @@ INSTANTIATE_TEST_SUITE_P( TexelFormatCase{SpvImageFormatRg8ui, false, ast::TexelFormat::kNone})); } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/fail_stream.h b/src/tint/reader/spirv/fail_stream.h index a7530ca724..6160de8f00 100644 --- a/src/tint/reader/spirv/fail_stream.h +++ b/src/tint/reader/spirv/fail_stream.h @@ -17,9 +17,7 @@ #include -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { /// A FailStream object accumulates values onto a given std::ostream, /// and can be used to record failure by writing the false value @@ -67,8 +65,6 @@ class FailStream { std::ostream* out_; }; -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv #endif // SRC_TINT_READER_SPIRV_FAIL_STREAM_H_ diff --git a/src/tint/reader/spirv/fail_stream_test.cc b/src/tint/reader/spirv/fail_stream_test.cc index 4c6e9bf9e9..13c35e563c 100644 --- a/src/tint/reader/spirv/fail_stream_test.cc +++ b/src/tint/reader/spirv/fail_stream_test.cc @@ -16,9 +16,7 @@ #include "gmock/gmock.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -68,6 +66,4 @@ TEST_F(FailStreamTest, ShiftOperatorAccumulatesValues) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function.cc b/src/tint/reader/spirv/function.cc index c130e85383..3ee9159c80 100644 --- a/src/tint/reader/spirv/function.cc +++ b/src/tint/reader/spirv/function.cc @@ -137,9 +137,7 @@ // constructs // -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { @@ -6143,9 +6141,7 @@ bool FunctionEmitter::IsFloatOne(uint32_t value_id) { FunctionEmitter::FunctionDeclaration::FunctionDeclaration() = default; FunctionEmitter::FunctionDeclaration::~FunctionDeclaration() = default; -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::StatementBuilder); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::SwitchStatementBuilder); diff --git a/src/tint/reader/spirv/function.h b/src/tint/reader/spirv/function.h index 46b36caedf..e90de21e68 100644 --- a/src/tint/reader/spirv/function.h +++ b/src/tint/reader/spirv/function.h @@ -26,9 +26,7 @@ #include "src/tint/reader/spirv/construct.h" #include "src/tint/reader/spirv/parser_impl.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { /// Kinds of CFG edges. // @@ -1297,8 +1295,6 @@ class FunctionEmitter { const EntryPointInfo* ep_info_ = nullptr; }; -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv #endif // SRC_TINT_READER_SPIRV_FUNCTION_H_ diff --git a/src/tint/reader/spirv/function_arithmetic_test.cc b/src/tint/reader/spirv/function_arithmetic_test.cc index 8b0ed5de7f..c48f86dd39 100644 --- a/src/tint/reader/spirv/function_arithmetic_test.cc +++ b/src/tint/reader/spirv/function_arithmetic_test.cc @@ -17,9 +17,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::HasSubstr; @@ -1080,6 +1078,4 @@ TEST_F(SpvUnaryArithTest, Transpose_3x2) { // TODO(dneto): OpSMulExtended } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function_bit_test.cc b/src/tint/reader/spirv/function_bit_test.cc index 722cc2abb9..ba0e67ea3f 100644 --- a/src/tint/reader/spirv/function_bit_test.cc +++ b/src/tint/reader/spirv/function_bit_test.cc @@ -16,9 +16,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::HasSubstr; @@ -1046,6 +1044,4 @@ TEST_F(SpvUnaryBitTest, ExtractBits_UintVector) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function_call_test.cc b/src/tint/reader/spirv/function_call_test.cc index bfc4eabdcd..6aba922bc1 100644 --- a/src/tint/reader/spirv/function_call_test.cc +++ b/src/tint/reader/spirv/function_call_test.cc @@ -17,9 +17,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -197,6 +195,4 @@ fn x_100() { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function_cfg_test.cc b/src/tint/reader/spirv/function_cfg_test.cc index ce36521a20..bd3c98c896 100644 --- a/src/tint/reader/spirv/function_cfg_test.cc +++ b/src/tint/reader/spirv/function_cfg_test.cc @@ -17,9 +17,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -13224,6 +13222,4 @@ TEST_F(SpvParserCFGTest, } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function_composite_test.cc b/src/tint/reader/spirv/function_composite_test.cc index e11b0f0b8e..8b29a908c9 100644 --- a/src/tint/reader/spirv/function_composite_test.cc +++ b/src/tint/reader/spirv/function_composite_test.cc @@ -17,9 +17,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -1070,6 +1068,4 @@ TEST_F(SpvParserTest, DISABLED_WorkgroupSize_Overridable) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function_conversion_test.cc b/src/tint/reader/spirv/function_conversion_test.cc index 1dffd35702..4d77997159 100644 --- a/src/tint/reader/spirv/function_conversion_test.cc +++ b/src/tint/reader/spirv/function_conversion_test.cc @@ -17,9 +17,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -650,6 +648,4 @@ OpFunctionEnd // TODO(dneto): OpSatConvertUToS // Kernel (OpenCL), not in WebGPU } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function_decl_test.cc b/src/tint/reader/spirv/function_decl_test.cc index e30930ddbe..5fa6330fe4 100644 --- a/src/tint/reader/spirv/function_decl_test.cc +++ b/src/tint/reader/spirv/function_decl_test.cc @@ -17,9 +17,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::HasSubstr; @@ -151,6 +149,4 @@ TEST_F(SpvParserTest, Emit_GenerateParamNames) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function_glsl_std_450_test.cc b/src/tint/reader/spirv/function_glsl_std_450_test.cc index ce16f138a8..7d7a485dcf 100644 --- a/src/tint/reader/spirv/function_glsl_std_450_test.cc +++ b/src/tint/reader/spirv/function_glsl_std_450_test.cc @@ -17,9 +17,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::HasSubstr; @@ -1172,6 +1170,4 @@ TEST_F(SpvParserTest, GlslStd450_Ldexp_Vector_Floatvec_Uintvec) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function_logical_test.cc b/src/tint/reader/spirv/function_logical_test.cc index 23dc5c46d7..2d2e4e9322 100644 --- a/src/tint/reader/spirv/function_logical_test.cc +++ b/src/tint/reader/spirv/function_logical_test.cc @@ -17,9 +17,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::HasSubstr; @@ -987,6 +985,4 @@ TEST_F(SpvLogicalTest, IsInf_Vector) { // TODO(dneto): OpSelect over more general types, as in SPIR-V 1.4 } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function_memory_test.cc b/src/tint/reader/spirv/function_memory_test.cc index 8e722bdf84..33fa2f59d0 100644 --- a/src/tint/reader/spirv/function_memory_test.cc +++ b/src/tint/reader/spirv/function_memory_test.cc @@ -17,9 +17,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -1290,6 +1288,4 @@ TEST_F(SpvParserMemoryTest, InvalidPointer_ConstantNull_IsError) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function_misc_test.cc b/src/tint/reader/spirv/function_misc_test.cc index 582ff8d50d..e64eb2e668 100644 --- a/src/tint/reader/spirv/function_misc_test.cc +++ b/src/tint/reader/spirv/function_misc_test.cc @@ -17,9 +17,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -343,6 +341,4 @@ TEST_F(SpvParserTest, ValueFromBlockNotInBlockOrder) { // TODO(dneto): OpSizeof : requires Kernel (OpenCL) } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/function_var_test.cc b/src/tint/reader/spirv/function_var_test.cc index ddec083ecc..c6c1aa515e 100644 --- a/src/tint/reader/spirv/function_var_test.cc +++ b/src/tint/reader/spirv/function_var_test.cc @@ -17,9 +17,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -1670,6 +1668,4 @@ TEST_F(SpvParserFunctionVarTest, DISABLED_EmitStatement_Hoist_UsedAsPtrArg) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/namer.cc b/src/tint/reader/spirv/namer.cc index ab19bb475c..6e7044f0f2 100644 --- a/src/tint/reader/spirv/namer.cc +++ b/src/tint/reader/spirv/namer.cc @@ -20,9 +20,7 @@ #include "src/tint/debug.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { @@ -234,6 +232,4 @@ void Namer::ResolveMemberNamesForStruct(uint32_t struct_id, } } -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/namer.h b/src/tint/reader/spirv/namer.h index 5491152c9d..fa5fc3a7e9 100644 --- a/src/tint/reader/spirv/namer.h +++ b/src/tint/reader/spirv/namer.h @@ -21,9 +21,7 @@ #include "src/tint/reader/spirv/fail_stream.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { /// A Namer maps SPIR-V IDs to strings. /// @@ -158,8 +156,6 @@ class Namer { std::unordered_map next_unusued_derived_name_id_; }; -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv #endif // SRC_TINT_READER_SPIRV_NAMER_H_ diff --git a/src/tint/reader/spirv/namer_test.cc b/src/tint/reader/spirv/namer_test.cc index 0aee67db10..62cf56d3f4 100644 --- a/src/tint/reader/spirv/namer_test.cc +++ b/src/tint/reader/spirv/namer_test.cc @@ -16,9 +16,7 @@ #include "gmock/gmock.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -402,6 +400,4 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_ReservedWords, })); } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser.cc b/src/tint/reader/spirv/parser.cc index 32f00afec7..ebb5bc4d92 100644 --- a/src/tint/reader/spirv/parser.cc +++ b/src/tint/reader/spirv/parser.cc @@ -24,9 +24,7 @@ #include "src/tint/transform/simplify_pointers.h" #include "src/tint/transform/unshadow.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { Program Parse(const std::vector& input) { ParserImpl parser(input); @@ -60,6 +58,4 @@ Program Parse(const std::vector& input) { return manager.Run(&program).program; } -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser.h b/src/tint/reader/spirv/parser.h index 2e5a5c24e1..3641e08daa 100644 --- a/src/tint/reader/spirv/parser.h +++ b/src/tint/reader/spirv/parser.h @@ -19,9 +19,7 @@ #include "src/tint/program.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { /// Parses the SPIR-V source data, returning the parsed program. /// If the source data fails to parse then the returned @@ -31,8 +29,6 @@ namespace spirv { /// @returns the parsed program Program Parse(const std::vector& input); -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv #endif // SRC_TINT_READER_SPIRV_PARSER_H_ diff --git a/src/tint/reader/spirv/parser_impl.cc b/src/tint/reader/spirv/parser_impl.cc index c2f50d39fc..6cf8e7a998 100644 --- a/src/tint/reader/spirv/parser_impl.cc +++ b/src/tint/reader/spirv/parser_impl.cc @@ -32,9 +32,7 @@ #include "src/tint/sem/sampled_texture_type.h" #include "src/tint/utils/unique_vector.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { @@ -2791,6 +2789,4 @@ WorkgroupSizeInfo::WorkgroupSizeInfo() = default; WorkgroupSizeInfo::~WorkgroupSizeInfo() = default; -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_impl.h b/src/tint/reader/spirv/parser_impl.h index ee31004255..d871452a7a 100644 --- a/src/tint/reader/spirv/parser_impl.h +++ b/src/tint/reader/spirv/parser_impl.h @@ -51,9 +51,7 @@ /// familiar to Vulkan SPIR-V developers. We will tend to use "image" /// and "sampler" instead of "handle". -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { /// The binary representation of a SPIR-V decoration enum followed by its /// operands, if any. @@ -881,8 +879,6 @@ class ParserImpl : Reader { WorkgroupSizeInfo workgroup_size_builtin_; }; -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv #endif // SRC_TINT_READER_SPIRV_PARSER_IMPL_H_ diff --git a/src/tint/reader/spirv/parser_impl_barrier_test.cc b/src/tint/reader/spirv/parser_impl_barrier_test.cc index a718ab3f16..39f267f193 100644 --- a/src/tint/reader/spirv/parser_impl_barrier_test.cc +++ b/src/tint/reader/spirv/parser_impl_barrier_test.cc @@ -19,9 +19,7 @@ #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/sem/call.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -208,6 +206,4 @@ TEST_F(SpvParserTest, ErrStorageBarrierInvalidMemory) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_impl_convert_member_decoration_test.cc b/src/tint/reader/spirv/parser_impl_convert_member_decoration_test.cc index 245e0e84d9..adc33971cf 100644 --- a/src/tint/reader/spirv/parser_impl_convert_member_decoration_test.cc +++ b/src/tint/reader/spirv/parser_impl_convert_member_decoration_test.cc @@ -15,9 +15,7 @@ #include "gmock/gmock.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -152,6 +150,4 @@ TEST_F(SpvParserTest, ConvertMemberDecoration_UnhandledDecoration) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_impl_convert_type_test.cc b/src/tint/reader/spirv/parser_impl_convert_type_test.cc index 7bdae7a068..bbda414377 100644 --- a/src/tint/reader/spirv/parser_impl_convert_type_test.cc +++ b/src/tint/reader/spirv/parser_impl_convert_type_test.cc @@ -16,9 +16,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -930,6 +928,4 @@ TEST_F(SpvParserTest, ConvertType_SampledImage_PretendVoid) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_impl_function_decl_test.cc b/src/tint/reader/spirv/parser_impl_function_decl_test.cc index b664dd1273..4e10725e6d 100644 --- a/src/tint/reader/spirv/parser_impl_function_decl_test.cc +++ b/src/tint/reader/spirv/parser_impl_function_decl_test.cc @@ -16,9 +16,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::HasSubstr; @@ -470,6 +468,4 @@ TEST_F(SpvParserTest, EmitFunctions_GenerateParamNames) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_impl_get_decorations_test.cc b/src/tint/reader/spirv/parser_impl_get_decorations_test.cc index 92652e405c..5f4f971472 100644 --- a/src/tint/reader/spirv/parser_impl_get_decorations_test.cc +++ b/src/tint/reader/spirv/parser_impl_get_decorations_test.cc @@ -16,9 +16,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -261,6 +259,4 @@ TEST_F(SpvParserGetDecorationsTest, GetDecorationsForMember_RestrictPointer) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_impl_handle_test.cc b/src/tint/reader/spirv/parser_impl_handle_test.cc index a2e99adaec..d1938aa91d 100644 --- a/src/tint/reader/spirv/parser_impl_handle_test.cc +++ b/src/tint/reader/spirv/parser_impl_handle_test.cc @@ -19,9 +19,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -3918,6 +3916,4 @@ return; } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_impl_import_test.cc b/src/tint/reader/spirv/parser_impl_import_test.cc index 65fac1c36b..852c08ad06 100644 --- a/src/tint/reader/spirv/parser_impl_import_test.cc +++ b/src/tint/reader/spirv/parser_impl_import_test.cc @@ -16,9 +16,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::ElementsAre; @@ -123,6 +121,4 @@ TEST_F(SpvParserImportTest, Import_NonSemantic_IgnoredExtInsts) { // imports. } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_impl_module_var_test.cc b/src/tint/reader/spirv/parser_impl_module_var_test.cc index 236840b263..d50959dd52 100644 --- a/src/tint/reader/spirv/parser_impl_module_var_test.cc +++ b/src/tint/reader/spirv/parser_impl_module_var_test.cc @@ -18,9 +18,7 @@ #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/utils/string.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using SpvModuleScopeVarParserTest = SpvParserTest; @@ -5284,6 +5282,4 @@ fn main(@location(1) @interpolate(flat) x_1_param : u32, @location(2) @interpola } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_impl_named_types_test.cc b/src/tint/reader/spirv/parser_impl_named_types_test.cc index fcc04c58e8..53366e64a2 100644 --- a/src/tint/reader/spirv/parser_impl_named_types_test.cc +++ b/src/tint/reader/spirv/parser_impl_named_types_test.cc @@ -16,9 +16,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::HasSubstr; @@ -154,6 +152,4 @@ type Arr_1 = @stride(8) array; // Blocked by crbug.com/tint/32 } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_impl_test.cc b/src/tint/reader/spirv/parser_impl_test.cc index f50b73e279..237bb67a3b 100644 --- a/src/tint/reader/spirv/parser_impl_test.cc +++ b/src/tint/reader/spirv/parser_impl_test.cc @@ -16,9 +16,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::HasSubstr; @@ -223,6 +221,4 @@ TEST_F(SpvParserTest, Impl_IsValidIdentifier) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_impl_test_helper.cc b/src/tint/reader/spirv/parser_impl_test_helper.cc index c11304882f..bc62973fdc 100644 --- a/src/tint/reader/spirv/parser_impl_test_helper.cc +++ b/src/tint/reader/spirv/parser_impl_test_helper.cc @@ -15,10 +15,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/writer/wgsl/generator_impl.h" -namespace tint { -namespace reader { -namespace spirv { -namespace test { +namespace tint::reader::spirv::test { // Default to not dumping the SPIR-V assembly. bool ParserImplWrapperForTest::dump_successfully_converted_spirv_ = false; @@ -79,7 +76,4 @@ std::string ToString(const Program& program, const ast::Node* node) { return writer.result(); } -} // namespace test -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv::test diff --git a/src/tint/reader/spirv/parser_impl_test_helper.h b/src/tint/reader/spirv/parser_impl_test_helper.h index f9a6c3efb1..9c270301e0 100644 --- a/src/tint/reader/spirv/parser_impl_test_helper.h +++ b/src/tint/reader/spirv/parser_impl_test_helper.h @@ -34,9 +34,7 @@ #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/usage.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace test { /// A test class that wraps ParseImpl @@ -312,8 +310,6 @@ class SpvParserTestBase : public T { // Use this form when you don't need to template any further. using SpvParserTest = SpvParserTestBase<::testing::Test>; -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv #endif // SRC_TINT_READER_SPIRV_PARSER_IMPL_TEST_HELPER_H_ diff --git a/src/tint/reader/spirv/parser_impl_user_name_test.cc b/src/tint/reader/spirv/parser_impl_user_name_test.cc index a8d821981e..65405127e4 100644 --- a/src/tint/reader/spirv/parser_impl_user_name_test.cc +++ b/src/tint/reader/spirv/parser_impl_user_name_test.cc @@ -16,9 +16,7 @@ #include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -210,6 +208,4 @@ TEST_F(SpvParserUserNameTest, EntryPointNames_DistinctFromInnerNames) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_test.cc b/src/tint/reader/spirv/parser_test.cc index 3ae802f920..304eb3ec5e 100644 --- a/src/tint/reader/spirv/parser_test.cc +++ b/src/tint/reader/spirv/parser_test.cc @@ -16,9 +16,7 @@ #include "gtest/gtest.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ParserTest = testing::Test; @@ -35,6 +33,4 @@ TEST_F(ParserTest, DataEmpty) { // TODO(dneto): uint32 vec, invalid SPIR-V } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_type.cc b/src/tint/reader/spirv/parser_type.cc index 805a10b9f9..7a3c97f1f8 100644 --- a/src/tint/reader/spirv/parser_type.cc +++ b/src/tint/reader/spirv/parser_type.cc @@ -45,9 +45,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Named); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Alias); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Struct); -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { struct PointerHasher { @@ -638,6 +636,4 @@ std::string Named::String() const { } #endif // NDEBUG -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/parser_type.h b/src/tint/reader/spirv/parser_type.h index 2313e9ecfa..578f89fb3c 100644 --- a/src/tint/reader/spirv/parser_type.h +++ b/src/tint/reader/spirv/parser_type.h @@ -27,17 +27,15 @@ #include "src/tint/castable.h" #include "src/tint/utils/block_allocator.h" -// Forward declarations +// Forward Declarations namespace tint { class ProgramBuilder; namespace ast { class Type; -} // namespace ast +} } // namespace tint -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { /// Type is the base class for all types class Type : public Castable { @@ -604,8 +602,6 @@ class TypeManager { std::unique_ptr state; }; -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv #endif // SRC_TINT_READER_SPIRV_PARSER_TYPE_H_ diff --git a/src/tint/reader/spirv/parser_type_test.cc b/src/tint/reader/spirv/parser_type_test.cc index 1e90264812..bddfdc5aff 100644 --- a/src/tint/reader/spirv/parser_type_test.cc +++ b/src/tint/reader/spirv/parser_type_test.cc @@ -16,9 +16,7 @@ #include "src/tint/reader/spirv/parser_type.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { TEST(SpvParserTypeTest, SameArgumentsGivesSamePointer) { @@ -97,6 +95,4 @@ TEST(SpvParserTypeTest, DifferentArgumentsGivesDifferentPointer) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/spirv_tools_helpers_test.cc b/src/tint/reader/spirv/spirv_tools_helpers_test.cc index a4862d0d83..057dffd55b 100644 --- a/src/tint/reader/spirv/spirv_tools_helpers_test.cc +++ b/src/tint/reader/spirv/spirv_tools_helpers_test.cc @@ -17,10 +17,7 @@ #include "gtest/gtest.h" #include "spirv-tools/libspirv.hpp" -namespace tint { -namespace reader { -namespace spirv { -namespace test { +namespace tint::reader::spirv::test { std::vector Assemble(const std::string& spirv_assembly) { // TODO(dneto): Use ScopedTrace? @@ -61,7 +58,4 @@ std::string Disassemble(const std::vector& spirv_module) { return result; } -} // namespace test -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv::test diff --git a/src/tint/reader/spirv/spirv_tools_helpers_test.h b/src/tint/reader/spirv/spirv_tools_helpers_test.h index 929efd61ab..907f02f26e 100644 --- a/src/tint/reader/spirv/spirv_tools_helpers_test.h +++ b/src/tint/reader/spirv/spirv_tools_helpers_test.h @@ -18,10 +18,7 @@ #include #include -namespace tint { -namespace reader { -namespace spirv { -namespace test { +namespace tint::reader::spirv::test { /// @param spirv_assembly SPIR-V assembly text /// @returns the SPIR-V module assembled from the given text. Numeric IDs @@ -32,9 +29,6 @@ std::vector Assemble(const std::string& spirv_assembly); /// @returns the disassembled module std::string Disassemble(const std::vector& spirv_module); -} // namespace test -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv::test #endif // SRC_TINT_READER_SPIRV_SPIRV_TOOLS_HELPERS_TEST_H_ diff --git a/src/tint/reader/spirv/usage.cc b/src/tint/reader/spirv/usage.cc index 28aec49354..2ddb696f16 100644 --- a/src/tint/reader/spirv/usage.cc +++ b/src/tint/reader/spirv/usage.cc @@ -16,9 +16,7 @@ #include -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { Usage::Usage() {} Usage::Usage(const Usage& other) = default; @@ -189,6 +187,4 @@ std::string Usage::to_str() const { return ss.str(); } -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv diff --git a/src/tint/reader/spirv/usage.h b/src/tint/reader/spirv/usage.h index f2686e75f7..df6783f456 100644 --- a/src/tint/reader/spirv/usage.h +++ b/src/tint/reader/spirv/usage.h @@ -17,9 +17,7 @@ #include -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { /// Records the properties of a sampler or texture based on how it's used /// by image instructions inside function bodies. @@ -130,8 +128,6 @@ inline std::ostream& operator<<(std::ostream& out, const Usage& u) { return u.operator<<(out); } -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv #endif // SRC_TINT_READER_SPIRV_USAGE_H_ diff --git a/src/tint/reader/spirv/usage_test.cc b/src/tint/reader/spirv/usage_test.cc index 2c63e5fc23..0ee7f15fa0 100644 --- a/src/tint/reader/spirv/usage_test.cc +++ b/src/tint/reader/spirv/usage_test.cc @@ -18,9 +18,7 @@ #include "gmock/gmock.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h" -namespace tint { -namespace reader { -namespace spirv { +namespace tint::reader::spirv { namespace { using ::testing::Eq; @@ -290,6 +288,4 @@ TEST_F(SpvParserTest, Usage_AddStorageWriteTexture) { } } // namespace -} // namespace spirv -} // namespace reader -} // namespace tint +} // namespace tint::reader::spirv