mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-08 07:33:33 +00:00
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:
parent
9430cb4775
commit
c7dcbae41c
@ -40,7 +40,7 @@ Program::Program(Program&& program)
|
|||||||
Program::Program(ProgramBuilder&& builder) {
|
Program::Program(ProgramBuilder&& builder) {
|
||||||
is_valid_ = builder.IsValid();
|
is_valid_ = builder.IsValid();
|
||||||
if (builder.ResolveOnBuild() && builder.IsValid()) {
|
if (builder.ResolveOnBuild() && builder.IsValid()) {
|
||||||
Resolver resolver(&builder);
|
resolver::Resolver resolver(&builder);
|
||||||
if (!resolver.Resolve()) {
|
if (!resolver.Resolve()) {
|
||||||
diagnostics_.add_error(resolver.error());
|
diagnostics_.add_error(resolver.error());
|
||||||
is_valid_ = false;
|
is_valid_ = false;
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "src/semantic/variable.h"
|
#include "src/semantic/variable.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
namespace resolver {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using IntrinsicType = tint::semantic::IntrinsicType;
|
using IntrinsicType = tint::semantic::IntrinsicType;
|
||||||
@ -961,4 +962,5 @@ Resolver::FunctionInfo::FunctionInfo(ast::Function* decl) : declaration(decl) {}
|
|||||||
|
|
||||||
Resolver::FunctionInfo::~FunctionInfo() = default;
|
Resolver::FunctionInfo::~FunctionInfo() = default;
|
||||||
|
|
||||||
|
} // namespace resolver
|
||||||
} // namespace tint
|
} // namespace tint
|
||||||
|
@ -45,6 +45,8 @@ namespace semantic {
|
|||||||
class Statement;
|
class Statement;
|
||||||
} // namespace semantic
|
} // namespace semantic
|
||||||
|
|
||||||
|
namespace resolver {
|
||||||
|
|
||||||
/// Resolves types for all items in the given tint program
|
/// Resolves types for all items in the given tint program
|
||||||
class Resolver {
|
class Resolver {
|
||||||
public:
|
public:
|
||||||
@ -241,6 +243,7 @@ class Resolver {
|
|||||||
BlockAllocator<FunctionInfo> function_infos_;
|
BlockAllocator<FunctionInfo> function_infos_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace resolver
|
||||||
} // namespace tint
|
} // namespace tint
|
||||||
|
|
||||||
#endif // SRC_RESOLVER_RESOLVER_H_
|
#endif // SRC_RESOLVER_RESOLVER_H_
|
||||||
|
@ -40,6 +40,7 @@ using ::testing::ElementsAre;
|
|||||||
using ::testing::HasSubstr;
|
using ::testing::HasSubstr;
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
namespace resolver {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using IntrinsicType = semantic::IntrinsicType;
|
using IntrinsicType = semantic::IntrinsicType;
|
||||||
@ -3774,10 +3775,11 @@ TEST_P(ResolverTextureIntrinsicTest, Call) {
|
|||||||
auto* target = call_sem->Target();
|
auto* target = call_sem->Target();
|
||||||
ASSERT_NE(target, nullptr);
|
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);
|
auto* expected = expected_texture_overload(param.overload);
|
||||||
EXPECT_EQ(got, expected);
|
EXPECT_EQ(got, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace resolver
|
||||||
} // namespace tint
|
} // namespace tint
|
||||||
|
Loading…
x
Reference in New Issue
Block a user