Condense namespaces in tint/resolver.

This PR condenses the namespaces in the tint/resolver folder.

Change-Id: I7ed4d677a3d1dd39a672fc2d4e6721a6a4f6157d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86031
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 17:45:45 +00:00 committed by Dawn LUCI CQ
parent 7bc9ba13bd
commit d209379cd1
45 changed files with 96 additions and 181 deletions

View File

@ -18,8 +18,7 @@
#include "src/tint/resolver/resolver_test_helper.h"
#include "src/tint/sem/reference_type.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverIndexAccessorTest = ResolverTest;
@ -308,5 +307,4 @@ TEST_F(ResolverIndexAccessorTest, Exr_Deref_BadParent) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/resolver/resolver_test_helper.h"
#include "src/tint/sem/storage_texture_type.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverAssignmentValidationTest = ResolverTest;
@ -389,5 +388,4 @@ TEST_F(ResolverAssignmentValidationTest, AssignToPhony_Pass) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -19,8 +19,7 @@
#include "gmock/gmock.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
struct ResolverAtomicTest : public resolver::TestHelper,
@ -69,5 +68,4 @@ TEST_F(ResolverAtomicTest, GlobalStorageStruct) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -19,8 +19,7 @@
#include "gmock/gmock.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
struct ResolverAtomicValidationTest : public resolver::TestHelper,
@ -334,5 +333,4 @@ TEST_F(ResolverAtomicValidationTest, Local) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -19,8 +19,7 @@
#include "gmock/gmock.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
// Helpers and typedefs
template <typename T>
@ -1367,5 +1366,4 @@ TEST_F(InterpolateTest, MissingLocationAttribute_Struct) {
} // namespace
} // namespace InterpolateTests
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "gmock/gmock.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
struct Type {
@ -224,5 +223,4 @@ INSTANTIATE_TEST_SUITE_P(
testing::ValuesIn(kNumericScalars)));
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -39,8 +39,7 @@
using ::testing::ElementsAre;
using ::testing::HasSubstr;
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using BuiltinType = sem::BuiltinType;
@ -1987,5 +1986,4 @@ TEST_P(ResolverBuiltinTest_Texture, Call) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -15,8 +15,7 @@
#include "src/tint/ast/builtin_texture_helper_test.h"
#include "src/tint/resolver/resolver_test_helper.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverBuiltinValidationTest = ResolverTest;
@ -398,5 +397,4 @@ INSTANTIATE_TEST_SUITE_P(
} // namespace texture_constexpr_args
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -15,8 +15,7 @@
#include "src/tint/ast/call_statement.h"
#include "src/tint/resolver/resolver_test_helper.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
template <typename T>
@ -1288,5 +1287,4 @@ INSTANTIATE_TEST_SUITE_P(ResolverBuiltinsValidationTest,
"pack2x16float"));
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/ast/call_statement.h"
#include "src/tint/resolver/resolver_test_helper.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
// Helpers and typedefs
template <typename T>
@ -114,5 +113,4 @@ TEST_F(ResolverCallTest, OutOfOrder) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/ast/call_statement.h"
#include "src/tint/resolver/resolver_test_helper.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverCallValidationTest = ResolverTest;
@ -284,5 +283,4 @@ TEST_F(ResolverCallValidationTest, CallVariableShadowsFunction) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/resolver/resolver_test_helper.h"
#include "src/tint/sem/storage_texture_type.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverCompoundAssignmentValidationTest = ResolverTest;
@ -296,5 +295,4 @@ TEST_F(ResolverCompoundAssignmentValidationTest, LhsAtomic) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -22,8 +22,7 @@
#include "src/tint/sem/loop_statement.h"
#include "src/tint/sem/switch_statement.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverCompoundStatementTest = ResolverTest;
@ -376,5 +375,4 @@ TEST_F(ResolverCompoundStatementTest, Switch) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,10 +18,10 @@
#include "src/tint/ast/switch_statement.h"
#include "src/tint/resolver/resolver_test_helper.h"
namespace tint {
namespace tint::resolver {
namespace {
class ResolverControlBlockValidationTest : public resolver::TestHelper,
class ResolverControlBlockValidationTest : public TestHelper,
public testing::Test {};
TEST_F(ResolverControlBlockValidationTest,
@ -361,4 +361,4 @@ TEST_F(ResolverControlBlockValidationTest, SwitchCaseAlias_Pass) {
}
} // namespace
} // namespace tint
} // namespace tint::resolver

View File

@ -32,8 +32,7 @@
#define TINT_DUMP_DEPENDENCY_GRAPH 0
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
// Forward declaration
@ -738,5 +737,4 @@ bool DependencyGraph::Build(const ast::Module& module,
return da.Run(module);
}
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -21,8 +21,7 @@
#include "src/tint/ast/module.h"
#include "src/tint/diagnostic/diagnostic.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
/// DependencyGraph holds information about module-scope declaration dependency
/// analysis and symbol resolutions.
@ -60,7 +59,6 @@ struct DependencyGraph {
std::unordered_map<const ast::Variable*, const ast::Node*> shadows;
};
} // namespace resolver
} // namespace tint
} // namespace tint::resolver
#endif // SRC_TINT_RESOLVER_DEPENDENCY_GRAPH_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/resolver/dependency_graph.h"
#include "src/tint/resolver/resolver_test_helper.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ::testing::ElementsAre;
@ -1338,5 +1337,4 @@ TEST_F(ResolverDependencyGraphTraversalTest, chromium_1273451) {
} // namespace ast_traversal
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -21,8 +21,7 @@
#include "gmock/gmock.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
// Helpers and typedefs
@ -793,5 +792,4 @@ TEST_F(LocationAttributeTests, Duplicate_struct) {
} // namespace LocationAttributeTests
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -20,10 +20,10 @@
#include "gmock/gmock.h"
namespace tint {
namespace tint::resolver {
namespace {
class ResolverFunctionValidationTest : public resolver::TestHelper,
class ResolverFunctionValidationTest : public TestHelper,
public testing::Test {};
TEST_F(ResolverFunctionValidationTest, DuplicateParameterName) {
@ -793,7 +793,7 @@ struct TestParams {
bool should_pass;
};
struct TestWithParams : resolver::ResolverTestWithParam<TestParams> {};
struct TestWithParams : ResolverTestWithParam<TestParams> {};
using ResolverFunctionParameterValidationTest = TestWithParams;
TEST_P(ResolverFunctionParameterValidationTest, StorageClass) {
@ -827,4 +827,4 @@ INSTANTIATE_TEST_SUITE_P(
TestParams{ast::StorageClass::kFunction, true}));
} // namespace
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/resolver/resolver_test_helper.h"
#include "src/tint/sem/struct.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverHostShareableValidationTest = ResolverTest;
@ -141,5 +140,4 @@ TEST_F(ResolverHostShareableValidationTest, NoError) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -17,8 +17,7 @@
#include "gmock/gmock.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
// Helpers and typedefs
@ -171,5 +170,4 @@ TEST_F(ResolverInferredTypeTest, InferStruct_Pass) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/resolver/resolver_test_helper.h"
#include "src/tint/sem/atomic_type.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverIsHostShareable = ResolverTest;
@ -120,5 +119,4 @@ TEST_F(ResolverIsHostShareable, ArrayUnsizedOfHostShareable) {
// Note: Structure tests covered in host_shareable_validation_test.cc
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/resolver/resolver_test_helper.h"
#include "src/tint/sem/atomic_type.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverIsStorableTest = ResolverTest;
@ -136,5 +135,4 @@ TEST_F(ResolverIsStorableTest, Struct_NestedNonStorable) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -16,8 +16,7 @@
#include "src/tint/resolver/resolver_test_helper.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
class ResolverPipelineOverridableConstantTest : public ResolverTest {
@ -104,5 +103,4 @@ TEST_F(ResolverPipelineOverridableConstantTest, IdTooLarge) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "gmock/gmock.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
struct ResolverPtrRefTest : public resolver::TestHelper,
@ -120,5 +119,4 @@ TEST_F(ResolverPtrRefTest, DefaultPtrStorageClass) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -19,8 +19,7 @@
#include "gmock/gmock.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
struct ResolverPtrRefValidationTest : public resolver::TestHelper,
@ -170,5 +169,4 @@ TEST_F(ResolverPtrRefValidationTest, InferredPtrAccessMismatch) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -79,8 +79,7 @@
#include "src/tint/utils/scoped_assignment.h"
#include "src/tint/utils/transform.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
Resolver::Resolver(ProgramBuilder* builder)
: builder_(builder),
@ -518,7 +517,7 @@ void Resolver::SetShadows() {
[&](sem::LocalVariable* local) { local->SetShadows(Sem(it.second)); },
[&](sem::Parameter* param) { param->SetShadows(Sem(it.second)); });
}
} // namespace resolver
}
sem::GlobalVariable* Resolver::GlobalVariable(const ast::Variable* var) {
auto* sem = Variable(var, VariableKind::kGlobal);
@ -2928,5 +2927,4 @@ std::size_t Resolver::TypeConstructorSig::Hasher::operator()(
return utils::Hash(sig.type, sig.parameters);
}
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -35,9 +35,8 @@
#include "src/tint/utils/map.h"
#include "src/tint/utils/unique_vector.h"
namespace tint {
// Forward declarations
namespace tint {
namespace ast {
class IndexAccessorExpression;
class BinaryExpression;
@ -69,8 +68,9 @@ class Statement;
class SwitchStatement;
class TypeConstructor;
} // namespace sem
} // namespace tint
namespace resolver {
namespace tint::resolver {
/// Resolves types for all items in the given tint program
class Resolver {
@ -551,7 +551,6 @@ class Resolver {
sem::BlockStatement* current_block_ = nullptr;
};
} // namespace resolver
} // namespace tint
} // namespace tint::resolver
#endif // SRC_TINT_RESOLVER_RESOLVER_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/sem/for_loop_statement.h"
#include "src/tint/sem/if_statement.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
class ResolverBehaviorTest : public ResolverTest {
@ -655,5 +654,4 @@ TEST_F(ResolverBehaviorTest, StmtVarDecl_RHSDiscardOrNext) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/sem/type_constructor.h"
#include "src/tint/utils/map.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using i32 = ProgramBuilder::i32;
@ -140,5 +139,4 @@ sem::Constant Resolver::ConstantCast(const sem::Constant& value,
return sem::Constant(target_type, elems);
}
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/resolver/resolver_test_helper.h"
#include "src/tint/sem/expression.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using Scalar = sem::Constant::Scalar;
@ -429,5 +428,4 @@ TEST_F(ResolverConstantsTest, Vec3_Cast_u32_to_f32) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -47,8 +47,7 @@
using ::testing::ElementsAre;
using ::testing::HasSubstr;
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
// Helpers and typedefs
@ -2179,5 +2178,4 @@ TEST_F(ResolverTest, ModuleDependencyOrderedDeclarations) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -16,12 +16,10 @@
#include <memory>
namespace tint {
namespace resolver {
namespace tint::resolver {
TestHelper::TestHelper() : resolver_(std::make_unique<Resolver>(this)) {}
TestHelper::~TestHelper() = default;
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -26,8 +26,7 @@
#include "src/tint/sem/statement.h"
#include "src/tint/sem/variable.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
/// Helper class for testing
class TestHelper : public ProgramBuilder {
@ -483,7 +482,6 @@ constexpr CreatePtrs CreatePtrsFor() {
} // namespace builder
} // namespace resolver
} // namespace tint
} // namespace tint::resolver
#endif // SRC_TINT_RESOLVER_RESOLVER_TEST_HELPER_H_

View File

@ -77,8 +77,7 @@
#include "src/tint/utils/scoped_assignment.h"
#include "src/tint/utils/transform.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
bool IsValidStorageTextureDimension(ast::TextureDimension dim) {
@ -2426,5 +2425,4 @@ bool Resolver::IsValidationEnabled(const ast::AttributeList& attributes,
return !IsValidationDisabled(attributes, validation);
}
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -17,8 +17,7 @@
#include "gmock/gmock.h"
#include "src/tint/resolver/resolver_test_helper.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverStorageClassLayoutValidationTest = ResolverTest;
@ -539,5 +538,4 @@ TEST_F(ResolverStorageClassLayoutValidationTest,
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/resolver/resolver_test_helper.h"
#include "src/tint/sem/struct.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverStorageClassValidationTest = ResolverTest;
@ -360,5 +359,4 @@ TEST_F(ResolverStorageClassValidationTest, UniformBufferNoError_Aliases) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/resolver/resolver_test_helper.h"
#include "src/tint/sem/struct.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverStructLayoutTest = ResolverTest;
@ -401,5 +400,4 @@ TEST_F(ResolverStructLayoutTest, StructWithLotsOfPadding) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -21,8 +21,7 @@
using ::testing::UnorderedElementsAre;
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverPipelineStageUseTest = ResolverTest;
@ -187,5 +186,4 @@ TEST_F(ResolverPipelineStageUseTest, StructUsedAsShaderReturnTypeViaAlias) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -20,8 +20,7 @@
using ::testing::UnorderedElementsAre;
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverStorageClassUseTest = ResolverTest;
@ -191,5 +190,4 @@ TEST_F(ResolverStorageClassUseTest, StructMultipleStorageClassUses) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -18,8 +18,7 @@
#include "src/tint/sem/type_constructor.h"
#include "src/tint/sem/type_conversion.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ::testing::HasSubstr;
@ -2933,5 +2932,4 @@ TEST_F(ResolverTypeConstructorValidationTest, TypeConversionAsStatement) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -22,8 +22,7 @@
#include "gmock/gmock.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
// Helpers and typedefs
@ -1154,5 +1153,4 @@ INSTANTIATE_TEST_SUITE_P(ResolverTypeValidationTest,
} // namespace VectorTests
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -41,8 +41,7 @@
using ::testing::ElementsAre;
using ::testing::HasSubstr;
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
using ResolverValidationTest = ResolverTest;
@ -1313,8 +1312,7 @@ TEST_F(ResolverTest, Expr_Constructor_Cast_Pointer) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver
TINT_INSTANTIATE_TYPEINFO(tint::resolver::FakeStmt);
TINT_INSTANTIATE_TYPEINFO(tint::resolver::FakeExpr);

View File

@ -18,8 +18,7 @@
#include "gmock/gmock.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
struct ResolverVarLetTest : public resolver::TestHelper,
@ -693,5 +692,4 @@ TEST_F(ResolverVarLetTest, ParamShadowsAlias) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver

View File

@ -17,8 +17,7 @@
#include "gmock/gmock.h"
namespace tint {
namespace resolver {
namespace tint::resolver {
namespace {
struct ResolverVarLetValidationTest : public resolver::TestHelper,
@ -345,5 +344,4 @@ TEST_F(ResolverVarLetValidationTest, MatrixVarNoType) {
}
} // namespace
} // namespace resolver
} // namespace tint
} // namespace tint::resolver