Condense namespaces in tint/reader/spirv.

This PR condenses the namespaces in the tint/reader/spirv folder.

Change-Id: I80cf1e7d3587020359d790381d147fde140b0ba5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86033
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair 2022-04-07 19:01:25 +00:00 committed by Dawn LUCI CQ
parent 34323ac069
commit 258cbafdec
52 changed files with 106 additions and 320 deletions

View File

@ -14,9 +14,7 @@
#include "src/tint/reader/spirv/construct.h" #include "src/tint/reader/spirv/construct.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
Construct::Construct(const Construct* the_parent, Construct::Construct(const Construct* the_parent,
int the_depth, int the_depth,
@ -65,6 +63,4 @@ Construct::Construct(const Construct* the_parent,
end_pos(the_end_pos), end_pos(the_end_pos),
scope_end_pos(the_scope_end_pos) {} scope_end_pos(the_scope_end_pos) {}
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -20,9 +20,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
/// A structured control flow construct, consisting of a set of basic blocks. /// A structured control flow construct, consisting of a set of basic blocks.
/// A construct is a span of blocks in the computed block order, /// 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(); return ss.str();
} }
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_CONSTRUCT_H_ #endif // SRC_TINT_READER_SPIRV_CONSTRUCT_H_

View File

@ -16,9 +16,7 @@
#include <utility> #include <utility>
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
EntryPointInfo::EntryPointInfo(std::string the_name, EntryPointInfo::EntryPointInfo(std::string the_name,
ast::PipelineStage the_stage, ast::PipelineStage the_stage,
@ -39,6 +37,4 @@ EntryPointInfo::EntryPointInfo(const EntryPointInfo&) = default;
EntryPointInfo::~EntryPointInfo() = default; EntryPointInfo::~EntryPointInfo() = default;
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -20,9 +20,7 @@
#include "src/tint/ast/pipeline_stage.h" #include "src/tint/ast/pipeline_stage.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
/// The size of an integer-coordinate grid, in the x, y, and z dimensions. /// The size of an integer-coordinate grid, in the x, y, and z dimensions.
struct GridSize { struct GridSize {
@ -88,8 +86,6 @@ struct EntryPointInfo {
GridSize workgroup_size; GridSize workgroup_size;
}; };
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_ENTRY_POINT_INFO_H_ #endif // SRC_TINT_READER_SPIRV_ENTRY_POINT_INFO_H_

View File

@ -14,9 +14,7 @@
#include "src/tint/reader/spirv/enum_converter.h" #include "src/tint/reader/spirv/enum_converter.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
EnumConverter::EnumConverter(const FailStream& fs) : fail_stream_(fs) {} EnumConverter::EnumConverter(const FailStream& fs) : fail_stream_(fs) {}
@ -177,6 +175,4 @@ ast::TexelFormat EnumConverter::ToTexelFormat(SpvImageFormat fmt) {
return ast::TexelFormat::kNone; return ast::TexelFormat::kNone;
} }
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -22,9 +22,7 @@
#include "src/tint/reader/spirv/fail_stream.h" #include "src/tint/reader/spirv/fail_stream.h"
#include "src/tint/sem/storage_texture_type.h" #include "src/tint/sem/storage_texture_type.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
/// A converter from SPIR-V enums to Tint AST enums. /// A converter from SPIR-V enums to Tint AST enums.
class EnumConverter { class EnumConverter {
@ -74,8 +72,6 @@ class EnumConverter {
FailStream fail_stream_; FailStream fail_stream_;
}; };
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_ENUM_CONVERTER_H_ #endif // SRC_TINT_READER_SPIRV_ENUM_CONVERTER_H_

View File

@ -18,9 +18,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
// Pipeline stage // Pipeline stage
@ -424,6 +422,4 @@ INSTANTIATE_TEST_SUITE_P(
TexelFormatCase{SpvImageFormatRg8ui, false, ast::TexelFormat::kNone})); TexelFormatCase{SpvImageFormatRg8ui, false, ast::TexelFormat::kNone}));
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include <ostream> #include <ostream>
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
/// A FailStream object accumulates values onto a given std::ostream, /// A FailStream object accumulates values onto a given std::ostream,
/// and can be used to record failure by writing the false value /// and can be used to record failure by writing the false value
@ -67,8 +65,6 @@ class FailStream {
std::ostream* out_; std::ostream* out_;
}; };
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_FAIL_STREAM_H_ #endif // SRC_TINT_READER_SPIRV_FAIL_STREAM_H_

View File

@ -16,9 +16,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -68,6 +66,4 @@ TEST_F(FailStreamTest, ShiftOperatorAccumulatesValues) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -137,9 +137,7 @@
// constructs // constructs
// //
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
@ -6143,9 +6141,7 @@ bool FunctionEmitter::IsFloatOne(uint32_t value_id) {
FunctionEmitter::FunctionDeclaration::FunctionDeclaration() = default; FunctionEmitter::FunctionDeclaration::FunctionDeclaration() = default;
FunctionEmitter::FunctionDeclaration::~FunctionDeclaration() = default; FunctionEmitter::FunctionDeclaration::~FunctionDeclaration() = default;
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::StatementBuilder); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::StatementBuilder);
TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::SwitchStatementBuilder); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::SwitchStatementBuilder);

View File

@ -26,9 +26,7 @@
#include "src/tint/reader/spirv/construct.h" #include "src/tint/reader/spirv/construct.h"
#include "src/tint/reader/spirv/parser_impl.h" #include "src/tint/reader/spirv/parser_impl.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
/// Kinds of CFG edges. /// Kinds of CFG edges.
// //
@ -1297,8 +1295,6 @@ class FunctionEmitter {
const EntryPointInfo* ep_info_ = nullptr; const EntryPointInfo* ep_info_ = nullptr;
}; };
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_FUNCTION_H_ #endif // SRC_TINT_READER_SPIRV_FUNCTION_H_

View File

@ -17,9 +17,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::HasSubstr; using ::testing::HasSubstr;
@ -1080,6 +1078,4 @@ TEST_F(SpvUnaryArithTest, Transpose_3x2) {
// TODO(dneto): OpSMulExtended // TODO(dneto): OpSMulExtended
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::HasSubstr; using ::testing::HasSubstr;
@ -1046,6 +1044,4 @@ TEST_F(SpvUnaryBitTest, ExtractBits_UintVector) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -197,6 +195,4 @@ fn x_100() {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -13224,6 +13222,4 @@ TEST_F(SpvParserCFGTest,
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -1070,6 +1068,4 @@ TEST_F(SpvParserTest, DISABLED_WorkgroupSize_Overridable) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -650,6 +648,4 @@ OpFunctionEnd
// TODO(dneto): OpSatConvertUToS // Kernel (OpenCL), not in WebGPU // TODO(dneto): OpSatConvertUToS // Kernel (OpenCL), not in WebGPU
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::HasSubstr; using ::testing::HasSubstr;
@ -151,6 +149,4 @@ TEST_F(SpvParserTest, Emit_GenerateParamNames) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::HasSubstr; using ::testing::HasSubstr;
@ -1172,6 +1170,4 @@ TEST_F(SpvParserTest, GlslStd450_Ldexp_Vector_Floatvec_Uintvec) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::HasSubstr; 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 // TODO(dneto): OpSelect over more general types, as in SPIR-V 1.4
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -1290,6 +1288,4 @@ TEST_F(SpvParserMemoryTest, InvalidPointer_ConstantNull_IsError) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -343,6 +341,4 @@ TEST_F(SpvParserTest, ValueFromBlockNotInBlockOrder) {
// TODO(dneto): OpSizeof : requires Kernel (OpenCL) // TODO(dneto): OpSizeof : requires Kernel (OpenCL)
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -1670,6 +1668,4 @@ TEST_F(SpvParserFunctionVarTest, DISABLED_EmitStatement_Hoist_UsedAsPtrArg) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -20,9 +20,7 @@
#include "src/tint/debug.h" #include "src/tint/debug.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
@ -234,6 +232,4 @@ void Namer::ResolveMemberNamesForStruct(uint32_t struct_id,
} }
} }
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -21,9 +21,7 @@
#include "src/tint/reader/spirv/fail_stream.h" #include "src/tint/reader/spirv/fail_stream.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
/// A Namer maps SPIR-V IDs to strings. /// A Namer maps SPIR-V IDs to strings.
/// ///
@ -158,8 +156,6 @@ class Namer {
std::unordered_map<std::string, uint32_t> next_unusued_derived_name_id_; std::unordered_map<std::string, uint32_t> next_unusued_derived_name_id_;
}; };
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_NAMER_H_ #endif // SRC_TINT_READER_SPIRV_NAMER_H_

View File

@ -16,9 +16,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -402,6 +400,4 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_ReservedWords,
})); }));
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -24,9 +24,7 @@
#include "src/tint/transform/simplify_pointers.h" #include "src/tint/transform/simplify_pointers.h"
#include "src/tint/transform/unshadow.h" #include "src/tint/transform/unshadow.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
Program Parse(const std::vector<uint32_t>& input) { Program Parse(const std::vector<uint32_t>& input) {
ParserImpl parser(input); ParserImpl parser(input);
@ -60,6 +58,4 @@ Program Parse(const std::vector<uint32_t>& input) {
return manager.Run(&program).program; return manager.Run(&program).program;
} }
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -19,9 +19,7 @@
#include "src/tint/program.h" #include "src/tint/program.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
/// Parses the SPIR-V source data, returning the parsed program. /// Parses the SPIR-V source data, returning the parsed program.
/// If the source data fails to parse then the returned /// If the source data fails to parse then the returned
@ -31,8 +29,6 @@ namespace spirv {
/// @returns the parsed program /// @returns the parsed program
Program Parse(const std::vector<uint32_t>& input); Program Parse(const std::vector<uint32_t>& input);
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_PARSER_H_ #endif // SRC_TINT_READER_SPIRV_PARSER_H_

View File

@ -32,9 +32,7 @@
#include "src/tint/sem/sampled_texture_type.h" #include "src/tint/sem/sampled_texture_type.h"
#include "src/tint/utils/unique_vector.h" #include "src/tint/utils/unique_vector.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
@ -2791,6 +2789,4 @@ WorkgroupSizeInfo::WorkgroupSizeInfo() = default;
WorkgroupSizeInfo::~WorkgroupSizeInfo() = default; WorkgroupSizeInfo::~WorkgroupSizeInfo() = default;
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -51,9 +51,7 @@
/// familiar to Vulkan SPIR-V developers. We will tend to use "image" /// familiar to Vulkan SPIR-V developers. We will tend to use "image"
/// and "sampler" instead of "handle". /// and "sampler" instead of "handle".
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
/// The binary representation of a SPIR-V decoration enum followed by its /// The binary representation of a SPIR-V decoration enum followed by its
/// operands, if any. /// operands, if any.
@ -881,8 +879,6 @@ class ParserImpl : Reader {
WorkgroupSizeInfo workgroup_size_builtin_; WorkgroupSizeInfo workgroup_size_builtin_;
}; };
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_PARSER_IMPL_H_ #endif // SRC_TINT_READER_SPIRV_PARSER_IMPL_H_

View File

@ -19,9 +19,7 @@
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
#include "src/tint/sem/call.h" #include "src/tint/sem/call.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -208,6 +206,4 @@ TEST_F(SpvParserTest, ErrStorageBarrierInvalidMemory) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -15,9 +15,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -152,6 +150,4 @@ TEST_F(SpvParserTest, ConvertMemberDecoration_UnhandledDecoration) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -930,6 +928,4 @@ TEST_F(SpvParserTest, ConvertType_SampledImage_PretendVoid) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::HasSubstr; using ::testing::HasSubstr;
@ -470,6 +468,4 @@ TEST_F(SpvParserTest, EmitFunctions_GenerateParamNames) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -261,6 +259,4 @@ TEST_F(SpvParserGetDecorationsTest, GetDecorationsForMember_RestrictPointer) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -19,9 +19,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -3918,6 +3916,4 @@ return;
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::ElementsAre; using ::testing::ElementsAre;
@ -123,6 +121,4 @@ TEST_F(SpvParserImportTest, Import_NonSemantic_IgnoredExtInsts) {
// imports. // imports.
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -18,9 +18,7 @@
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
#include "src/tint/utils/string.h" #include "src/tint/utils/string.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using SpvModuleScopeVarParserTest = SpvParserTest; using SpvModuleScopeVarParserTest = SpvParserTest;
@ -5284,6 +5282,4 @@ fn main(@location(1) @interpolate(flat) x_1_param : u32, @location(2) @interpola
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::HasSubstr; using ::testing::HasSubstr;
@ -154,6 +152,4 @@ type Arr_1 = @stride(8) array<u32, 5u>;
// Blocked by crbug.com/tint/32 // Blocked by crbug.com/tint/32
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::HasSubstr; using ::testing::HasSubstr;
@ -223,6 +221,4 @@ TEST_F(SpvParserTest, Impl_IsValidIdentifier) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -15,10 +15,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/writer/wgsl/generator_impl.h" #include "src/tint/writer/wgsl/generator_impl.h"
namespace tint { namespace tint::reader::spirv::test {
namespace reader {
namespace spirv {
namespace test {
// Default to not dumping the SPIR-V assembly. // Default to not dumping the SPIR-V assembly.
bool ParserImplWrapperForTest::dump_successfully_converted_spirv_ = false; bool ParserImplWrapperForTest::dump_successfully_converted_spirv_ = false;
@ -79,7 +76,4 @@ std::string ToString(const Program& program, const ast::Node* node) {
return writer.result(); return writer.result();
} }
} // namespace test } // namespace tint::reader::spirv::test
} // namespace spirv
} // namespace reader
} // namespace tint

View File

@ -34,9 +34,7 @@
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
#include "src/tint/reader/spirv/usage.h" #include "src/tint/reader/spirv/usage.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace test { namespace test {
/// A test class that wraps ParseImpl /// 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. // Use this form when you don't need to template any further.
using SpvParserTest = SpvParserTestBase<::testing::Test>; using SpvParserTest = SpvParserTestBase<::testing::Test>;
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_PARSER_IMPL_TEST_HELPER_H_ #endif // SRC_TINT_READER_SPIRV_PARSER_IMPL_TEST_HELPER_H_

View File

@ -16,9 +16,7 @@
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
#include "src/tint/reader/spirv/spirv_tools_helpers_test.h" #include "src/tint/reader/spirv/spirv_tools_helpers_test.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -210,6 +208,4 @@ TEST_F(SpvParserUserNameTest, EntryPointNames_DistinctFromInnerNames) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -16,9 +16,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ParserTest = testing::Test; using ParserTest = testing::Test;
@ -35,6 +33,4 @@ TEST_F(ParserTest, DataEmpty) {
// TODO(dneto): uint32 vec, invalid SPIR-V // TODO(dneto): uint32 vec, invalid SPIR-V
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -45,9 +45,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Named);
TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Alias); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Alias);
TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Struct); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Struct);
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
struct PointerHasher { struct PointerHasher {
@ -638,6 +636,4 @@ std::string Named::String() const {
} }
#endif // NDEBUG #endif // NDEBUG
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -27,17 +27,15 @@
#include "src/tint/castable.h" #include "src/tint/castable.h"
#include "src/tint/utils/block_allocator.h" #include "src/tint/utils/block_allocator.h"
// Forward declarations // Forward Declarations
namespace tint { namespace tint {
class ProgramBuilder; class ProgramBuilder;
namespace ast { namespace ast {
class Type; class Type;
} // namespace ast }
} // namespace tint } // namespace tint
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
/// Type is the base class for all types /// Type is the base class for all types
class Type : public Castable<Type> { class Type : public Castable<Type> {
@ -604,8 +602,6 @@ class TypeManager {
std::unique_ptr<State> state; std::unique_ptr<State> state;
}; };
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_PARSER_TYPE_H_ #endif // SRC_TINT_READER_SPIRV_PARSER_TYPE_H_

View File

@ -16,9 +16,7 @@
#include "src/tint/reader/spirv/parser_type.h" #include "src/tint/reader/spirv/parser_type.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
TEST(SpvParserTypeTest, SameArgumentsGivesSamePointer) { TEST(SpvParserTypeTest, SameArgumentsGivesSamePointer) {
@ -97,6 +95,4 @@ TEST(SpvParserTypeTest, DifferentArgumentsGivesDifferentPointer) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,10 +17,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "spirv-tools/libspirv.hpp" #include "spirv-tools/libspirv.hpp"
namespace tint { namespace tint::reader::spirv::test {
namespace reader {
namespace spirv {
namespace test {
std::vector<uint32_t> Assemble(const std::string& spirv_assembly) { std::vector<uint32_t> Assemble(const std::string& spirv_assembly) {
// TODO(dneto): Use ScopedTrace? // TODO(dneto): Use ScopedTrace?
@ -61,7 +58,4 @@ std::string Disassemble(const std::vector<uint32_t>& spirv_module) {
return result; return result;
} }
} // namespace test } // namespace tint::reader::spirv::test
} // namespace spirv
} // namespace reader
} // namespace tint

View File

@ -18,10 +18,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace tint { namespace tint::reader::spirv::test {
namespace reader {
namespace spirv {
namespace test {
/// @param spirv_assembly SPIR-V assembly text /// @param spirv_assembly SPIR-V assembly text
/// @returns the SPIR-V module assembled from the given text. Numeric IDs /// @returns the SPIR-V module assembled from the given text. Numeric IDs
@ -32,9 +29,6 @@ std::vector<uint32_t> Assemble(const std::string& spirv_assembly);
/// @returns the disassembled module /// @returns the disassembled module
std::string Disassemble(const std::vector<uint32_t>& spirv_module); std::string Disassemble(const std::vector<uint32_t>& spirv_module);
} // namespace test } // namespace tint::reader::spirv::test
} // namespace spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_SPIRV_TOOLS_HELPERS_TEST_H_ #endif // SRC_TINT_READER_SPIRV_SPIRV_TOOLS_HELPERS_TEST_H_

View File

@ -16,9 +16,7 @@
#include <sstream> #include <sstream>
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
Usage::Usage() {} Usage::Usage() {}
Usage::Usage(const Usage& other) = default; Usage::Usage(const Usage& other) = default;
@ -189,6 +187,4 @@ std::string Usage::to_str() const {
return ss.str(); return ss.str();
} }
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint

View File

@ -17,9 +17,7 @@
#include <string> #include <string>
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
/// Records the properties of a sampler or texture based on how it's used /// Records the properties of a sampler or texture based on how it's used
/// by image instructions inside function bodies. /// by image instructions inside function bodies.
@ -130,8 +128,6 @@ inline std::ostream& operator<<(std::ostream& out, const Usage& u) {
return u.operator<<(out); return u.operator<<(out);
} }
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint
#endif // SRC_TINT_READER_SPIRV_USAGE_H_ #endif // SRC_TINT_READER_SPIRV_USAGE_H_

View File

@ -18,9 +18,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "src/tint/reader/spirv/parser_impl_test_helper.h" #include "src/tint/reader/spirv/parser_impl_test_helper.h"
namespace tint { namespace tint::reader::spirv {
namespace reader {
namespace spirv {
namespace { namespace {
using ::testing::Eq; using ::testing::Eq;
@ -290,6 +288,4 @@ TEST_F(SpvParserTest, Usage_AddStorageWriteTexture) {
} }
} // namespace } // namespace
} // namespace spirv } // namespace tint::reader::spirv
} // namespace reader
} // namespace tint