Condense namespaces in tint/writer/wgsl.

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

Change-Id: I24895f6296a9c8b4a01eac9b80f9117edc7f7535
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86021
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
dan sinclair 2022-04-07 11:08:24 +00:00 committed by Dawn LUCI CQ
parent 51723bd904
commit 9f54a51b3d
33 changed files with 66 additions and 196 deletions

View File

@ -15,9 +15,7 @@
#include "src/tint/writer/wgsl/generator.h"
#include "src/tint/writer/wgsl/generator_impl.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
Result::Result() = default;
Result::~Result() = default;
@ -35,6 +33,4 @@ Result Generate(const Program* program, const Options&) {
return result;
}
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -25,8 +25,7 @@ namespace tint {
// Forward declarations
class Program;
namespace writer {
namespace wgsl {
namespace writer::wgsl {
class GeneratorImpl;
@ -62,8 +61,7 @@ struct Result {
/// @returns the resulting WGSL and supplementary information
Result Generate(const Program* program, const Options& options);
} // namespace wgsl
} // namespace writer
} // namespace writer::wgsl
} // namespace tint
#endif // SRC_TINT_WRITER_WGSL_GENERATOR_H_

View File

@ -56,9 +56,7 @@
#include "src/tint/utils/scoped_assignment.h"
#include "src/tint/writer/float_to_string.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
GeneratorImpl::GeneratorImpl(const Program* program) : TextGenerator(program) {}
@ -1212,6 +1210,4 @@ bool GeneratorImpl::EmitSwitch(const ast::SwitchStatement* stmt) {
return true;
}
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -38,9 +38,7 @@
#include "src/tint/sem/struct.h"
#include "src/tint/writer/text_generator.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
/// Implementation class for WGSL generator
class GeneratorImpl : public TextGenerator {
@ -209,8 +207,6 @@ class GeneratorImpl : public TextGenerator {
bool EmitAttributes(std::ostream& out, const ast::AttributeList& attrs);
};
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl
#endif // SRC_TINT_WRITER_WGSL_GENERATOR_IMPL_H_

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -67,6 +65,4 @@ TEST_F(WgslGeneratorImplTest, EmitAlias_ToStruct) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

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

View File

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

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
struct BinaryData {
@ -78,6 +76,4 @@ INSTANTIATE_TEST_SUITE_P(
BinaryData{"(left % right)", ast::BinaryOp::kModulo}));
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

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

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -37,6 +35,4 @@ TEST_F(WgslGeneratorImplTest, Emit_Block) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

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

View File

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

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -70,6 +68,4 @@ TEST_F(WgslGeneratorImplTest, Emit_Case_Default) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -44,6 +42,4 @@ TEST_F(WgslGeneratorImplTest, EmitExpression_Cast_Vector) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -15,9 +15,7 @@
#include "gmock/gmock.h"
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using ::testing::HasSubstr;
@ -131,6 +129,4 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Array) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

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

View File

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

View File

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

View File

@ -17,9 +17,7 @@
#include "src/tint/ast/workgroup_attribute.h"
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -229,6 +227,4 @@ fn b() {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -17,9 +17,7 @@
#include "src/tint/sem/sampled_texture_type.h"
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -147,6 +145,4 @@ TEST_F(WgslGeneratorImplTest, Emit_OverridableConstants) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

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

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -127,6 +125,4 @@ TEST_F(WgslGeneratorImplTest, Emit_IfWithMultiple) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -16,9 +16,7 @@
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
// Makes an IEEE 754 binary32 floating point number with
@ -127,6 +125,4 @@ INSTANTIATE_TEST_SUITE_P(
{MakeFloat(1, 255, 0x40101f), "-0x1.80203ep+128"}}));
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -200,6 +198,4 @@ TEST_F(WgslGeneratorImplTest, Emit_ForLoopWithMultiStmtInitCondCont) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -51,6 +49,4 @@ TEST_F(WgslGeneratorImplTest, EmitExpression_MemberAccessor_OfDref) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

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

View File

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

View File

@ -15,9 +15,7 @@
#include "src/tint/sem/variable.h"
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -35,6 +33,4 @@ TEST_F(WgslGeneratorImplTest, Generate) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -17,9 +17,7 @@
#include "src/tint/sem/sampled_texture_type.h"
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -519,6 +517,4 @@ TEST_F(WgslGeneratorImplTest, EmitType_SamplerComparison) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslUnaryOpTest = TestHelper;
@ -89,6 +87,4 @@ TEST_F(WgslUnaryOpTest, Negation) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -15,9 +15,7 @@
#include "src/tint/ast/variable_decl_statement.h"
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -51,6 +49,4 @@ TEST_F(WgslGeneratorImplTest, Emit_VariableDeclStatement_InferredType) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/wgsl/test_helper.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
namespace {
using WgslGeneratorImplTest = TestHelper;
@ -127,6 +125,4 @@ TEST_F(WgslGeneratorImplTest, EmitVariable_Const) {
}
} // namespace
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl

View File

@ -22,9 +22,7 @@
#include "src/tint/program_builder.h"
#include "src/tint/writer/wgsl/generator_impl.h"
namespace tint {
namespace writer {
namespace wgsl {
namespace tint::writer::wgsl {
/// Helper class for testing
template <typename BASE>
@ -63,8 +61,6 @@ using TestHelper = TestHelperBase<testing::Test>;
template <typename T>
using TestParamHelper = TestHelperBase<testing::TestWithParam<T>>;
} // namespace wgsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::wgsl
#endif // SRC_TINT_WRITER_WGSL_TEST_HELPER_H_