Condense namespaces in tint/writer/hlsl.

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

Change-Id: Iecbf1965ade236547e2f5654a66fa8367df9f092
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86024
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
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 14:30:24 +00:00 committed by Dawn LUCI CQ
parent 411d065e2e
commit 6a5bef1912
34 changed files with 75 additions and 211 deletions

View File

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

View File

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

View File

@ -73,9 +73,7 @@
#include "src/tint/writer/float_to_string.h"
#include "src/tint/writer/generate_external_texture_bindings.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
const char kTempNamePrefix[] = "tint_tmp";
@ -4028,6 +4026,4 @@ bool GeneratorImpl::CallBuiltinHelper(std::ostream& out,
return true;
}
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -39,18 +39,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 hlsl {
namespace tint::writer::hlsl {
/// The result of sanitizing a program for generation.
struct SanitizedResult {
@ -539,8 +536,6 @@ class GeneratorImpl : public TextGenerator {
std::unordered_map<const sem::Type*, std::string> value_or_one_if_zero_;
};
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl
#endif // SRC_TINT_WRITER_HLSL_GENERATOR_IMPL_H_

View File

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

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using HlslGeneratorImplTest_Assign = TestHelper;
@ -206,6 +204,4 @@ void fn() {
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -16,9 +16,7 @@
#include "src/tint/ast/variable_decl_statement.h"
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using HlslGeneratorImplTest_Binary = TestHelper;
@ -823,6 +821,4 @@ void fn() {
} // namespace HlslGeneratorDivMod
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

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

View File

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

View File

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

View File

@ -18,9 +18,7 @@
#include "src/tint/sem/call.h"
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using BuiltinType = sem::BuiltinType;
@ -730,6 +728,4 @@ void main() {
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -18,9 +18,7 @@
#include "src/tint/ast/stage_attribute.h"
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using ::testing::HasSubstr;
@ -391,6 +389,4 @@ INSTANTIATE_TEST_SUITE_P(
testing::ValuesIn(ast::builtin::test::TextureOverloadCase::ValidCases()));
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -20,9 +20,7 @@
using ::testing::HasSubstr;
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using HlslGeneratorImplTest_Function = TestHelper;
@ -912,6 +910,4 @@ void b() {
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

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

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using HlslGeneratorImplTest_If = TestHelper;
@ -130,6 +128,4 @@ TEST_F(HlslGeneratorImplTest_If, Emit_IfWithMultiple) {
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using HlslGeneratorImplTest_Import = TestHelper;
@ -278,6 +276,4 @@ TEST_F(HlslGeneratorImplTest_Import, HlslImportData_Determinant) {
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

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

View File

@ -16,9 +16,7 @@
#include "src/tint/ast/stage_attribute.h"
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using ::testing::HasSubstr;
@ -763,6 +761,4 @@ TEST_F(HlslGeneratorImplTest_MemberAccessor, Swizzle_gbr) {
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -15,9 +15,7 @@
#include "src/tint/ast/id_attribute.h"
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using HlslGeneratorImplTest_ModuleConstant = TestHelper;
@ -87,6 +85,4 @@ static const float b = WGSL_SPEC_CONSTANT_1;
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

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

View File

@ -17,9 +17,7 @@
#include "src/tint/ast/variable_decl_statement.h"
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using HlslSanitizerTest = TestHelper;
@ -334,6 +332,4 @@ TEST_F(HlslSanitizerTest, InlinePtrLetsComplexChain) {
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using HlslGeneratorImplTest_Switch = TestHelper;
@ -66,6 +64,4 @@ TEST_F(HlslGeneratorImplTest_Switch, Emit_Switch_OnlyDefaultCase) {
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using HlslGeneratorImplTest = TestHelper;
@ -67,6 +65,4 @@ INSTANTIATE_TEST_SUITE_P(
HlslBuiltinData{ast::Builtin::kSampleMask, "SV_Coverage"}));
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -22,9 +22,7 @@
#include "src/tint/sem/storage_texture_type.h"
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using ::testing::HasSubstr;
@ -566,6 +564,4 @@ INSTANTIATE_TEST_SUITE_P(
"RWTexture1D<int4> tex : register(u1, space2);"}));
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -14,9 +14,7 @@
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using HlslUnaryOpTest = TestHelper;
@ -88,6 +86,4 @@ TEST_F(HlslUnaryOpTest, Negation) {
EXPECT_EQ(out.str(), "-(expr)");
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -16,9 +16,7 @@
#include "src/tint/ast/variable_decl_statement.h"
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using ::testing::HasSubstr;
@ -122,6 +120,4 @@ TEST_F(HlslGeneratorImplTest_VariableDecl,
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -17,9 +17,7 @@
#include "src/tint/ast/stage_attribute.h"
#include "src/tint/writer/hlsl/test_helper.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
namespace {
using ::testing::HasSubstr;
@ -56,6 +54,4 @@ TEST_F(HlslGeneratorImplTest_WorkgroupVar, Aliased) {
}
} // namespace
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl

View File

@ -25,9 +25,7 @@
#include "src/tint/writer/hlsl/generator.h"
#include "src/tint/writer/hlsl/generator_impl.h"
namespace tint {
namespace writer {
namespace hlsl {
namespace tint::writer::hlsl {
/// Helper class for testing
template <typename BODY>
@ -116,8 +114,6 @@ using TestHelper = TestHelperBase<testing::Test>;
template <typename T>
using TestParamHelper = TestHelperBase<testing::TestWithParam<T>>;
} // namespace hlsl
} // namespace writer
} // namespace tint
} // namespace tint::writer::hlsl
#endif // SRC_TINT_WRITER_HLSL_TEST_HELPER_H_