tint/sem: Rename sem::Manager to TypeManager
This used to live in a `type` namespace, and wasn't prefixed when types were moved to sem. Change-Id: Ic7a08c2fb40aff034247524c755d9f66157e4da2 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101000 Commit-Queue: Ben Clayton <bclayton@chromium.org> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
ad22c3e7ab
commit
655db07022
|
@ -73,7 +73,7 @@ class Program {
|
|||
ast::NodeID HighestASTNodeID() const { return highest_node_id_; }
|
||||
|
||||
/// @returns a reference to the program's types
|
||||
const sem::Manager& Types() const {
|
||||
const sem::TypeManager& Types() const {
|
||||
AssertNotMoved();
|
||||
return types_;
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ class Program {
|
|||
|
||||
ProgramID id_;
|
||||
ast::NodeID highest_node_id_;
|
||||
sem::Manager types_;
|
||||
sem::TypeManager types_;
|
||||
ASTNodeAllocator ast_nodes_;
|
||||
SemNodeAllocator sem_nodes_;
|
||||
ConstantAllocator constant_nodes_;
|
||||
|
|
|
@ -70,7 +70,7 @@ ProgramBuilder ProgramBuilder::Wrap(const Program* program) {
|
|||
ProgramBuilder builder;
|
||||
builder.id_ = program->ID();
|
||||
builder.last_ast_node_id_ = program->HighestASTNodeID();
|
||||
builder.types_ = sem::Manager::Wrap(program->Types());
|
||||
builder.types_ = sem::TypeManager::Wrap(program->Types());
|
||||
builder.ast_ =
|
||||
builder.create<ast::Module>(program->AST().source, program->AST().GlobalDeclarations());
|
||||
builder.sem_ = sem::Info::Wrap(program->Sem());
|
||||
|
|
|
@ -297,13 +297,13 @@ class ProgramBuilder {
|
|||
ProgramID ID() const { return id_; }
|
||||
|
||||
/// @returns a reference to the program's types
|
||||
sem::Manager& Types() {
|
||||
sem::TypeManager& Types() {
|
||||
AssertNotMoved();
|
||||
return types_;
|
||||
}
|
||||
|
||||
/// @returns a reference to the program's types
|
||||
const sem::Manager& Types() const {
|
||||
const sem::TypeManager& Types() const {
|
||||
AssertNotMoved();
|
||||
return types_;
|
||||
}
|
||||
|
@ -3169,7 +3169,7 @@ class ProgramBuilder {
|
|||
private:
|
||||
ProgramID id_;
|
||||
ast::NodeID last_ast_node_id_ = ast::NodeID{static_cast<decltype(ast::NodeID::value)>(0) - 1};
|
||||
sem::Manager types_;
|
||||
sem::TypeManager types_;
|
||||
ASTNodeAllocator ast_nodes_;
|
||||
SemNodeAllocator sem_nodes_;
|
||||
ConstantAllocator constant_nodes_;
|
||||
|
|
|
@ -48,7 +48,7 @@ std::string StorageTexture::FriendlyName(const SymbolTable&) const {
|
|||
return out.str();
|
||||
}
|
||||
|
||||
sem::Type* StorageTexture::SubtypeFor(ast::TexelFormat format, sem::Manager& type_mgr) {
|
||||
sem::Type* StorageTexture::SubtypeFor(ast::TexelFormat format, sem::TypeManager& type_mgr) {
|
||||
switch (format) {
|
||||
case ast::TexelFormat::kR32Uint:
|
||||
case ast::TexelFormat::kRgba8Uint:
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
// Forward declarations
|
||||
namespace tint::sem {
|
||||
class Manager;
|
||||
class TypeManager;
|
||||
} // namespace tint::sem
|
||||
|
||||
namespace tint::sem {
|
||||
|
@ -67,9 +67,9 @@ class StorageTexture final : public Castable<StorageTexture, Texture> {
|
|||
std::string FriendlyName(const SymbolTable& symbols) const override;
|
||||
|
||||
/// @param format the storage texture image format
|
||||
/// @param type_mgr the sem::Manager used to build the returned type
|
||||
/// @param type_mgr the sem::TypeManager used to build the returned type
|
||||
/// @returns the storage texture subtype for the given TexelFormat
|
||||
static sem::Type* SubtypeFor(ast::TexelFormat format, sem::Manager& type_mgr);
|
||||
static sem::Type* SubtypeFor(ast::TexelFormat format, sem::TypeManager& type_mgr);
|
||||
|
||||
private:
|
||||
ast::TexelFormat const texel_format_;
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
|
||||
namespace tint::sem {
|
||||
|
||||
Manager::Manager() = default;
|
||||
Manager::Manager(Manager&&) = default;
|
||||
Manager& Manager::operator=(Manager&& rhs) = default;
|
||||
Manager::~Manager() = default;
|
||||
TypeManager::TypeManager() = default;
|
||||
TypeManager::TypeManager(TypeManager&&) = default;
|
||||
TypeManager& TypeManager::operator=(TypeManager&& rhs) = default;
|
||||
TypeManager::~TypeManager() = default;
|
||||
|
||||
} // namespace tint::sem
|
||||
|
|
|
@ -25,24 +25,24 @@
|
|||
namespace tint::sem {
|
||||
|
||||
/// The type manager holds all the pointers to the known types.
|
||||
class Manager final : public utils::UniqueAllocator<Type> {
|
||||
class TypeManager final : public utils::UniqueAllocator<Type> {
|
||||
public:
|
||||
/// Iterator is the type returned by begin() and end()
|
||||
using Iterator = utils::BlockAllocator<Type>::ConstIterator;
|
||||
|
||||
/// Constructor
|
||||
Manager();
|
||||
TypeManager();
|
||||
|
||||
/// Move constructor
|
||||
Manager(Manager&&);
|
||||
TypeManager(TypeManager&&);
|
||||
|
||||
/// Move assignment operator
|
||||
/// @param rhs the Manager to move
|
||||
/// @return this Manager
|
||||
Manager& operator=(Manager&& rhs);
|
||||
TypeManager& operator=(TypeManager&& rhs);
|
||||
|
||||
/// Destructor
|
||||
~Manager();
|
||||
~TypeManager();
|
||||
|
||||
/// Wrap returns a new Manager created with the types of `inner`.
|
||||
/// The Manager returned by Wrap is intended to temporarily extend the types
|
||||
|
@ -53,8 +53,8 @@ class Manager final : public utils::UniqueAllocator<Type> {
|
|||
/// function. See crbug.com/tint/460.
|
||||
/// @param inner the immutable Manager to extend
|
||||
/// @return the Manager that wraps `inner`
|
||||
static Manager Wrap(const Manager& inner) {
|
||||
Manager out;
|
||||
static TypeManager Wrap(const TypeManager& inner) {
|
||||
TypeManager out;
|
||||
out.items = inner.items;
|
||||
return out;
|
||||
}
|
||||
|
|
|
@ -34,14 +34,14 @@ size_t count(const T& range_loopable) {
|
|||
using TypeManagerTest = testing::Test;
|
||||
|
||||
TEST_F(TypeManagerTest, GetUnregistered) {
|
||||
Manager tm;
|
||||
TypeManager tm;
|
||||
auto* t = tm.Get<I32>();
|
||||
ASSERT_NE(t, nullptr);
|
||||
EXPECT_TRUE(t->Is<I32>());
|
||||
}
|
||||
|
||||
TEST_F(TypeManagerTest, GetSameTypeReturnsSamePtr) {
|
||||
Manager tm;
|
||||
TypeManager tm;
|
||||
auto* t = tm.Get<I32>();
|
||||
ASSERT_NE(t, nullptr);
|
||||
EXPECT_TRUE(t->Is<I32>());
|
||||
|
@ -51,7 +51,7 @@ TEST_F(TypeManagerTest, GetSameTypeReturnsSamePtr) {
|
|||
}
|
||||
|
||||
TEST_F(TypeManagerTest, GetDifferentTypeReturnsDifferentPtr) {
|
||||
Manager tm;
|
||||
TypeManager tm;
|
||||
Type* t = tm.Get<I32>();
|
||||
ASSERT_NE(t, nullptr);
|
||||
EXPECT_TRUE(t->Is<I32>());
|
||||
|
@ -63,7 +63,7 @@ TEST_F(TypeManagerTest, GetDifferentTypeReturnsDifferentPtr) {
|
|||
}
|
||||
|
||||
TEST_F(TypeManagerTest, Find) {
|
||||
Manager tm;
|
||||
TypeManager tm;
|
||||
auto* created = tm.Get<I32>();
|
||||
|
||||
EXPECT_EQ(tm.Find<U32>(), nullptr);
|
||||
|
@ -71,8 +71,8 @@ TEST_F(TypeManagerTest, Find) {
|
|||
}
|
||||
|
||||
TEST_F(TypeManagerTest, WrapDoesntAffectInner) {
|
||||
Manager inner;
|
||||
Manager outer = Manager::Wrap(inner);
|
||||
TypeManager inner;
|
||||
TypeManager outer = TypeManager::Wrap(inner);
|
||||
|
||||
inner.Get<I32>();
|
||||
|
||||
|
|
Loading…
Reference in New Issue