diff --git a/src/tint/writer/append_vector.cc b/src/tint/writer/append_vector.cc index 18f5ee9d6e..5c02917d47 100644 --- a/src/tint/writer/append_vector.cc +++ b/src/tint/writer/append_vector.cc @@ -23,9 +23,7 @@ #include "src/tint/sem/type_conversion.h" #include "src/tint/utils/transform.h" -namespace tint { -namespace writer { - +namespace tint::writer { namespace { struct VectorConstructorInfo { @@ -172,5 +170,4 @@ const sem::Call* AppendVector(ProgramBuilder* b, return constructor_sem; } -} // namespace writer -} // namespace tint +} // namespace tint::writer diff --git a/src/tint/writer/append_vector.h b/src/tint/writer/append_vector.h index d8613afb77..e6a72382d4 100644 --- a/src/tint/writer/append_vector.h +++ b/src/tint/writer/append_vector.h @@ -17,14 +17,13 @@ #include "src/tint/program_builder.h" -namespace tint { - -namespace ast { +// Forward Declarations +namespace tint::ast { class CallExpression; class Expression; -} // namespace ast +} // namespace tint::ast -namespace writer { +namespace tint::writer { /// A helper function used to append a vector with an additional scalar. /// If the scalar's type does not match the target vector element type, @@ -40,7 +39,6 @@ const sem::Call* AppendVector(ProgramBuilder* builder, const ast::Expression* vector, const ast::Expression* scalar); -} // namespace writer -} // namespace tint +} // namespace tint::writer #endif // SRC_TINT_WRITER_APPEND_VECTOR_H_ diff --git a/src/tint/writer/append_vector_test.cc b/src/tint/writer/append_vector_test.cc index 433f890668..e5b4292da3 100644 --- a/src/tint/writer/append_vector_test.cc +++ b/src/tint/writer/append_vector_test.cc @@ -19,8 +19,7 @@ #include "gtest/gtest.h" -namespace tint { -namespace writer { +namespace tint::writer { namespace { class AppendVectorTest : public ::testing::Test, public ProgramBuilder {}; @@ -484,5 +483,4 @@ TEST_F(AppendVectorTest, ZeroVec3i32_i32) { } } // namespace -} // namespace writer -} // namespace tint +} // namespace tint::writer diff --git a/src/tint/writer/array_length_from_uniform_options.cc b/src/tint/writer/array_length_from_uniform_options.cc index 258eaae785..2fdd43642b 100644 --- a/src/tint/writer/array_length_from_uniform_options.cc +++ b/src/tint/writer/array_length_from_uniform_options.cc @@ -14,8 +14,7 @@ #include "src/tint/writer/array_length_from_uniform_options.h" -namespace tint { -namespace writer { +namespace tint::writer { ArrayLengthFromUniformOptions::ArrayLengthFromUniformOptions() = default; ArrayLengthFromUniformOptions::~ArrayLengthFromUniformOptions() = default; @@ -26,5 +25,4 @@ ArrayLengthFromUniformOptions& ArrayLengthFromUniformOptions::operator=( ArrayLengthFromUniformOptions::ArrayLengthFromUniformOptions( ArrayLengthFromUniformOptions&&) = default; -} // namespace writer -} // namespace tint +} // namespace tint::writer diff --git a/src/tint/writer/array_length_from_uniform_options.h b/src/tint/writer/array_length_from_uniform_options.h index 24a35cbf94..e672dde580 100644 --- a/src/tint/writer/array_length_from_uniform_options.h +++ b/src/tint/writer/array_length_from_uniform_options.h @@ -19,8 +19,7 @@ #include "src/tint/sem/binding_point.h" -namespace tint { -namespace writer { +namespace tint::writer { /// Options used to specify a mapping of binding points to indices into a UBO /// from which to load buffer sizes. @@ -49,7 +48,6 @@ struct ArrayLengthFromUniformOptions { // struct members. }; -} // namespace writer -} // namespace tint +} // namespace tint::writer #endif // SRC_TINT_WRITER_ARRAY_LENGTH_FROM_UNIFORM_OPTIONS_H_ diff --git a/src/tint/writer/float_to_string.cc b/src/tint/writer/float_to_string.cc index 25073c01b3..64885fe9fb 100644 --- a/src/tint/writer/float_to_string.cc +++ b/src/tint/writer/float_to_string.cc @@ -23,8 +23,7 @@ #include "src/tint/debug.h" -namespace tint { -namespace writer { +namespace tint::writer { std::string FloatToString(float f) { // Try printing the float in fixed point, with a smallish limit on the @@ -154,5 +153,4 @@ std::string FloatToBitPreservingString(float f) { return ss.str(); } -} // namespace writer -} // namespace tint +} // namespace tint::writer diff --git a/src/tint/writer/float_to_string.h b/src/tint/writer/float_to_string.h index 44909d4cd3..4a5afd42bf 100644 --- a/src/tint/writer/float_to_string.h +++ b/src/tint/writer/float_to_string.h @@ -17,8 +17,7 @@ #include -namespace tint { -namespace writer { +namespace tint::writer { /// Converts the float `f` to a string using fixed-point notation (not /// scientific). The float will be printed with the full precision required to @@ -33,7 +32,6 @@ std::string FloatToString(float f); /// @return the float f formatted to a string std::string FloatToBitPreservingString(float f); -} // namespace writer -} // namespace tint +} // namespace tint::writer #endif // SRC_TINT_WRITER_FLOAT_TO_STRING_H_ diff --git a/src/tint/writer/float_to_string_test.cc b/src/tint/writer/float_to_string_test.cc index 76806cb02e..50caa59445 100644 --- a/src/tint/writer/float_to_string_test.cc +++ b/src/tint/writer/float_to_string_test.cc @@ -20,8 +20,7 @@ #include "gtest/gtest.h" -namespace tint { -namespace writer { +namespace tint::writer { namespace { // Makes an IEEE 754 binary32 floating point number with @@ -222,5 +221,4 @@ TEST(FloatToBitPreservingStringTest, DISABLED_NaN_NonMsb) { } } // namespace -} // namespace writer -} // namespace tint +} // namespace tint::writer diff --git a/src/tint/writer/text.cc b/src/tint/writer/text.cc index 19d9052ce1..3e41f758e3 100644 --- a/src/tint/writer/text.cc +++ b/src/tint/writer/text.cc @@ -14,10 +14,8 @@ #include "src/tint/writer/text.h" -namespace tint { -namespace writer { +namespace tint::writer { Text::~Text() = default; -} // namespace writer -} // namespace tint +} // namespace tint::writer diff --git a/src/tint/writer/text.h b/src/tint/writer/text.h index 3825d0c62f..71af064b28 100644 --- a/src/tint/writer/text.h +++ b/src/tint/writer/text.h @@ -19,8 +19,7 @@ #include "src/tint/writer/writer.h" -namespace tint { -namespace writer { +namespace tint::writer { /// Class to generate text source class Text : public Writer { @@ -31,7 +30,6 @@ class Text : public Writer { virtual std::string result() const = 0; }; -} // namespace writer -} // namespace tint +} // namespace tint::writer #endif // SRC_TINT_WRITER_TEXT_H_ diff --git a/src/tint/writer/text_generator.cc b/src/tint/writer/text_generator.cc index fcec369aeb..8623fd5dd9 100644 --- a/src/tint/writer/text_generator.cc +++ b/src/tint/writer/text_generator.cc @@ -19,8 +19,7 @@ #include "src/tint/utils/map.h" -namespace tint { -namespace writer { +namespace tint::writer { TextGenerator::TextGenerator(const Program* program) : program_(program), builder_(ProgramBuilder::Wrap(program)) {} @@ -151,5 +150,4 @@ TextGenerator::ScopedIndent::~ScopedIndent() { buffer_->DecrementIndent(); } -} // namespace writer -} // namespace tint +} // namespace tint::writer diff --git a/src/tint/writer/text_generator.h b/src/tint/writer/text_generator.h index d3eb8adddd..67501abda2 100644 --- a/src/tint/writer/text_generator.h +++ b/src/tint/writer/text_generator.h @@ -24,8 +24,7 @@ #include "src/tint/diagnostic/diagnostic.h" #include "src/tint/program_builder.h" -namespace tint { -namespace writer { +namespace tint::writer { /// Helper methods for generators which are creating text output class TextGenerator { @@ -236,7 +235,6 @@ class TextGenerator { std::unordered_map builtin_struct_names_; }; -} // namespace writer -} // namespace tint +} // namespace tint::writer #endif // SRC_TINT_WRITER_TEXT_GENERATOR_H_ diff --git a/src/tint/writer/text_generator_test.cc b/src/tint/writer/text_generator_test.cc index 29ec138af0..fdd74d6c00 100644 --- a/src/tint/writer/text_generator_test.cc +++ b/src/tint/writer/text_generator_test.cc @@ -16,8 +16,7 @@ #include "gtest/gtest.h" -namespace tint { -namespace writer { +namespace tint::writer { namespace { TEST(TextGeneratorTest, UniqueIdentifier) { @@ -44,5 +43,4 @@ TEST(TextGeneratorTest, UniqueIdentifier_ConflictWithExisting) { } } // namespace -} // namespace writer -} // namespace tint +} // namespace tint::writer diff --git a/src/tint/writer/writer.cc b/src/tint/writer/writer.cc index 05d438d7d5..3c7e098e77 100644 --- a/src/tint/writer/writer.cc +++ b/src/tint/writer/writer.cc @@ -14,10 +14,8 @@ #include "src/tint/writer/writer.h" -namespace tint { -namespace writer { +namespace tint::writer { Writer::~Writer() = default; -} // namespace writer -} // namespace tint +} // namespace tint::writer diff --git a/src/tint/writer/writer.h b/src/tint/writer/writer.h index 86d799c9da..d09622b89c 100644 --- a/src/tint/writer/writer.h +++ b/src/tint/writer/writer.h @@ -17,8 +17,7 @@ #include -namespace tint { -namespace writer { +namespace tint::writer { /// Base class for the output writers class Writer { @@ -41,7 +40,6 @@ class Writer { std::string error_; }; -} // namespace writer -} // namespace tint +} // namespace tint::writer #endif // SRC_TINT_WRITER_WRITER_H_