Condense namespaces in tint/writer/msl.

This PR condenses the namespaces in the tint/writer/msl folder.

Change-Id: I9def76a6527b6780f9d1008a928070e64f63806d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86023
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair 2022-04-07 13:58:14 +00:00 committed by Dawn LUCI CQ
parent d68d3a9809
commit 9fe8260dbb
33 changed files with 73 additions and 204 deletions

View File

@ -18,9 +18,7 @@
#include "src/tint/writer/msl/generator_impl.h" #include "src/tint/writer/msl/generator_impl.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
Options::Options() = default; Options::Options() = default;
Options::~Options() = default; Options::~Options() = default;
@ -61,6 +59,4 @@ Result Generate(const Program* program, const Options& options) {
return result; return result;
} }
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -24,15 +24,15 @@
#include "src/tint/writer/array_length_from_uniform_options.h" #include "src/tint/writer/array_length_from_uniform_options.h"
#include "src/tint/writer/text.h" #include "src/tint/writer/text.h"
namespace tint {
// Forward declarations // Forward declarations
namespace tint {
class Program; class Program;
namespace writer::msl {
namespace writer {
namespace msl {
class GeneratorImpl; class GeneratorImpl;
} // namespace writer::msl
} // namespace tint
namespace tint::writer::msl {
/// Configuration options used for generating MSL. /// Configuration options used for generating MSL.
struct Options { struct Options {
@ -116,8 +116,6 @@ struct Result {
/// @returns the resulting MSL and supplementary information /// @returns the resulting MSL and supplementary information
Result Generate(const Program* program, const Options& options); Result Generate(const Program* program, const Options& options);
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint
#endif // SRC_TINT_WRITER_MSL_GENERATOR_H_ #endif // SRC_TINT_WRITER_MSL_GENERATOR_H_

View File

@ -79,9 +79,7 @@
#include "src/tint/writer/float_to_string.h" #include "src/tint/writer/float_to_string.h"
#include "src/tint/writer/generate_external_texture_bindings.h" #include "src/tint/writer/generate_external_texture_bindings.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
bool last_is_break_or_fallthrough(const ast::BlockStatement* stmts) { bool last_is_break_or_fallthrough(const ast::BlockStatement* stmts) {
@ -3050,6 +3048,4 @@ bool GeneratorImpl::CallBuiltinHelper(std::ostream& out,
return true; return true;
} }
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -41,18 +41,15 @@
#include "src/tint/writer/array_length_from_uniform_options.h" #include "src/tint/writer/array_length_from_uniform_options.h"
#include "src/tint/writer/text_generator.h" #include "src/tint/writer/text_generator.h"
namespace tint {
// Forward declarations // Forward declarations
namespace sem { namespace tint::sem {
class Call; class Call;
class Builtin; class Builtin;
class TypeConstructor; class TypeConstructor;
class TypeConversion; class TypeConversion;
} // namespace sem } // namespace tint::sem
namespace writer { namespace tint::writer::msl {
namespace msl {
/// The result of sanitizing a program for generation. /// The result of sanitizing a program for generation.
struct SanitizedResult { struct SanitizedResult {
@ -444,8 +441,6 @@ class GeneratorImpl : public TextGenerator {
std::unordered_map<uint32_t, std::string> int_dot_funcs_; std::unordered_map<uint32_t, std::string> int_dot_funcs_;
}; };
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint
#endif // SRC_TINT_WRITER_MSL_GENERATOR_IMPL_H_ #endif // SRC_TINT_WRITER_MSL_GENERATOR_IMPL_H_

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -48,6 +46,4 @@ TEST_F(MslGeneratorImplTest, IndexAccessor_OfDref) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -36,6 +34,4 @@ TEST_F(MslGeneratorImplTest, Emit_Assign) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
struct BinaryData { struct BinaryData {
@ -182,6 +180,4 @@ TEST_F(MslBinaryTest, ModVec3F32) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -33,6 +31,4 @@ TEST_F(MslGeneratorImplTest, EmitExpression_Bitcast) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -52,6 +50,4 @@ TEST_F(MslGeneratorImplTest, Emit_Block_WithoutNewline) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -34,6 +32,4 @@ TEST_F(MslGeneratorImplTest, Emit_Break) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "src/tint/sem/call.h" #include "src/tint/sem/call.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using BuiltinType = sem::BuiltinType; using BuiltinType = sem::BuiltinType;
@ -495,6 +493,4 @@ kernel void func() {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "src/tint/ast/call_statement.h" #include "src/tint/ast/call_statement.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
std::string expected_texture_overload( std::string expected_texture_overload(
@ -300,6 +298,4 @@ INSTANTIATE_TEST_SUITE_P(
testing::ValuesIn(ast::builtin::test::TextureOverloadCase::ValidCases())); testing::ValuesIn(ast::builtin::test::TextureOverloadCase::ValidCases()));
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -15,9 +15,7 @@
#include "src/tint/ast/call_statement.h" #include "src/tint/ast/call_statement.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -77,6 +75,4 @@ TEST_F(MslGeneratorImplTest, EmitStatement_Call) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -15,9 +15,7 @@
#include "src/tint/ast/fallthrough_statement.h" #include "src/tint/ast/fallthrough_statement.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -103,6 +101,4 @@ TEST_F(MslGeneratorImplTest, Emit_Case_Default) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -55,6 +53,4 @@ TEST_F(MslGeneratorImplTest, EmitExpression_Cast_IntMin) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -15,9 +15,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using ::testing::HasSubstr; using ::testing::HasSubstr;
@ -185,6 +183,4 @@ TEST_F(MslGeneratorImplTest, EmitConstructor_Type_Struct_Empty) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -41,6 +39,4 @@ TEST_F(MslGeneratorImplTest, Emit_Continue) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -34,6 +32,4 @@ TEST_F(MslGeneratorImplTest, Emit_Discard) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "src/tint/ast/variable_decl_statement.h" #include "src/tint/ast/variable_decl_statement.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -708,6 +706,4 @@ kernel void b(device Data* tint_symbol_1 [[buffer(0)]]) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -35,6 +33,4 @@ TEST_F(MslGeneratorImplTest, EmitIdentifierExpression) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -101,6 +99,4 @@ TEST_F(MslGeneratorImplTest, Emit_IfWithMultiple) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -15,9 +15,7 @@
#include "src/tint/sem/call.h" #include "src/tint/sem/call.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -253,6 +251,4 @@ TEST_F(MslGeneratorImplTest, MslImportData_Determinant) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -15,9 +15,7 @@
#include "src/tint/ast/variable_decl_statement.h" #include "src/tint/ast/variable_decl_statement.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -347,6 +345,4 @@ TEST_F(MslGeneratorImplTest, Emit_ForLoopWithMultiStmtInitCondCont) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -59,6 +57,4 @@ TEST_F(MslGeneratorImplTest, EmitExpression_MemberAccessor_Swizzle_gbr) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -15,9 +15,7 @@
#include "src/tint/ast/id_attribute.h" #include "src/tint/ast/id_attribute.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -61,6 +59,4 @@ constant float b [[function_constant(1)]];
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -46,6 +44,4 @@ TEST_F(MslGeneratorImplTest, Emit_ReturnWithValue) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -18,9 +18,7 @@
#include "src/tint/ast/variable_decl_statement.h" #include "src/tint/ast/variable_decl_statement.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using ::testing::HasSubstr; using ::testing::HasSubstr;
@ -256,6 +254,4 @@ TEST_F(MslSanitizerTest,
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -57,6 +55,4 @@ TEST_F(MslGeneratorImplTest, Emit_Switch) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -15,9 +15,7 @@
#include "src/tint/ast/stage_attribute.h" #include "src/tint/ast/stage_attribute.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslGeneratorImplTest = TestHelper; using MslGeneratorImplTest = TestHelper;
@ -412,6 +410,4 @@ kernel void main4_no_usages() {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -24,9 +24,7 @@
#include "src/tint/sem/storage_texture_type.h" #include "src/tint/sem/storage_texture_type.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using ::testing::HasSubstr; using ::testing::HasSubstr;
@ -842,6 +840,4 @@ INSTANTIATE_TEST_SUITE_P(
"texture3d<float, access::write>"})); "texture3d<float, access::write>"}));
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using MslUnaryOpTest = TestHelper; using MslUnaryOpTest = TestHelper;
@ -101,6 +99,4 @@ TEST_F(MslUnaryOpTest, NegationOfIntMin) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "src/tint/ast/variable_decl_statement.h" #include "src/tint/ast/variable_decl_statement.h"
#include "src/tint/writer/msl/test_helper.h" #include "src/tint/writer/msl/test_helper.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
namespace { namespace {
using ::testing::HasSubstr; using ::testing::HasSubstr;
@ -164,6 +162,4 @@ TEST_F(MslGeneratorImplTest, Emit_VariableDeclStatement_Initializer_ZeroVec) {
} }
} // namespace } // namespace
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint

View File

@ -24,9 +24,7 @@
#include "src/tint/writer/msl/generator.h" #include "src/tint/writer/msl/generator.h"
#include "src/tint/writer/msl/generator_impl.h" #include "src/tint/writer/msl/generator_impl.h"
namespace tint { namespace tint::writer::msl {
namespace writer {
namespace msl {
/// Helper class for testing /// Helper class for testing
template <typename BASE> template <typename BASE>
@ -101,8 +99,6 @@ using TestHelper = TestHelperBase<testing::Test>;
template <typename T> template <typename T>
using TestParamHelper = TestHelperBase<testing::TestWithParam<T>>; using TestParamHelper = TestHelperBase<testing::TestWithParam<T>>;
} // namespace msl } // namespace tint::writer::msl
} // namespace writer
} // namespace tint
#endif // SRC_TINT_WRITER_MSL_TEST_HELPER_H_ #endif // SRC_TINT_WRITER_MSL_TEST_HELPER_H_