Resolver: Place into a resolver namespace

I'm going to start pulling apart the resolver tests into separate files, and the test helper shouldn't go into the root tint namespace.

Change-Id: Ie7d131c5b92837c6c9df05b2938cf014a0402ce2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44160
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Ben Clayton 2021-03-09 15:08:48 +00:00 committed by Commit Bot service account
parent 9430cb4775
commit c7dcbae41c
4 changed files with 9 additions and 2 deletions

View File

@ -40,7 +40,7 @@ Program::Program(Program&& program)
Program::Program(ProgramBuilder&& builder) {
is_valid_ = builder.IsValid();
if (builder.ResolveOnBuild() && builder.IsValid()) {
Resolver resolver(&builder);
resolver::Resolver resolver(&builder);
if (!resolver.Resolve()) {
diagnostics_.add_error(resolver.error());
is_valid_ = false;

View File

@ -37,6 +37,7 @@
#include "src/semantic/variable.h"
namespace tint {
namespace resolver {
namespace {
using IntrinsicType = tint::semantic::IntrinsicType;
@ -961,4 +962,5 @@ Resolver::FunctionInfo::FunctionInfo(ast::Function* decl) : declaration(decl) {}
Resolver::FunctionInfo::~FunctionInfo() = default;
} // namespace resolver
} // namespace tint

View File

@ -45,6 +45,8 @@ namespace semantic {
class Statement;
} // namespace semantic
namespace resolver {
/// Resolves types for all items in the given tint program
class Resolver {
public:
@ -241,6 +243,7 @@ class Resolver {
BlockAllocator<FunctionInfo> function_infos_;
};
} // namespace resolver
} // namespace tint
#endif // SRC_RESOLVER_RESOLVER_H_

View File

@ -40,6 +40,7 @@ using ::testing::ElementsAre;
using ::testing::HasSubstr;
namespace tint {
namespace resolver {
namespace {
using IntrinsicType = semantic::IntrinsicType;
@ -3774,10 +3775,11 @@ TEST_P(ResolverTextureIntrinsicTest, Call) {
auto* target = call_sem->Target();
ASSERT_NE(target, nullptr);
auto got = ::tint::to_str(param.function, target->Parameters());
auto got = resolver::to_str(param.function, target->Parameters());
auto* expected = expected_texture_overload(param.overload);
EXPECT_EQ(got, expected);
}
} // namespace
} // namespace resolver
} // namespace tint