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"
namespace tint {
namespace writer {
namespace msl {
namespace tint::writer::msl {
Options::Options() = default;
Options::~Options() = default;
@ -61,6 +59,4 @@ Result Generate(const Program* program, const Options& options) {
return result;
}
} // namespace msl
} // namespace writer
} // namespace tint
} // namespace tint::writer::msl

View File

@ -24,15 +24,15 @@
#include "src/tint/writer/array_length_from_uniform_options.h"
#include "src/tint/writer/text.h"
namespace tint {
// Forward declarations
namespace tint {
class Program;
namespace writer {
namespace msl {
namespace writer::msl {
class GeneratorImpl;
} // namespace writer::msl
} // namespace tint
namespace tint::writer::msl {
/// Configuration options used for generating MSL.
struct Options {
@ -116,8 +116,6 @@ struct Result {
/// @returns the resulting MSL and supplementary information
Result Generate(const Program* program, const Options& options);
} // namespace msl
} // namespace writer
} // namespace tint
} // namespace tint::writer::msl
#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/generate_external_texture_bindings.h"
namespace tint {
namespace writer {
namespace msl {
namespace tint::writer::msl {
namespace {
bool last_is_break_or_fallthrough(const ast::BlockStatement* stmts) {
@ -3050,6 +3048,4 @@ bool GeneratorImpl::CallBuiltinHelper(std::ostream& out,
return true;
}
} // namespace msl
} // namespace writer
} // namespace tint
} // namespace tint::writer::msl

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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