mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 08:27:05 +00:00
Replace Type::(Is|As)Void with Castable
Change-Id: If8a27c69c91a968a40a982c02b9fcaf9481e60b7 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34275 Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
@@ -66,10 +66,6 @@ Type* Type::UnwrapAll() {
|
||||
return UnwrapIfNeeded()->UnwrapPtrIfNeeded()->UnwrapIfNeeded();
|
||||
}
|
||||
|
||||
bool Type::IsVoid() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint64_t Type::MinBufferBindingSize(MemoryLayout) const {
|
||||
return 0;
|
||||
}
|
||||
@@ -124,16 +120,6 @@ bool Type::is_integer_scalar_or_vector() {
|
||||
return is_unsigned_scalar_or_vector() || is_signed_scalar_or_vector();
|
||||
}
|
||||
|
||||
const VoidType* Type::AsVoid() const {
|
||||
assert(IsVoid());
|
||||
return static_cast<const VoidType*>(this);
|
||||
}
|
||||
|
||||
VoidType* Type::AsVoid() {
|
||||
assert(IsVoid());
|
||||
return static_cast<VoidType*>(this);
|
||||
}
|
||||
|
||||
} // namespace type
|
||||
} // namespace ast
|
||||
} // namespace tint
|
||||
|
||||
@@ -23,8 +23,6 @@ namespace tint {
|
||||
namespace ast {
|
||||
namespace type {
|
||||
|
||||
class VoidType;
|
||||
|
||||
/// Supported memory layouts for calculating sizes
|
||||
enum class MemoryLayout { kUniformBuffer, kStorageBuffer };
|
||||
|
||||
@@ -35,9 +33,6 @@ class Type : public Castable<Type> {
|
||||
Type(Type&&);
|
||||
~Type() override;
|
||||
|
||||
/// @returns true if the type is a void type
|
||||
virtual bool IsVoid() const;
|
||||
|
||||
/// @returns the name for this type. The |type_name| is unique over all types.
|
||||
virtual std::string type_name() const = 0;
|
||||
|
||||
@@ -92,12 +87,6 @@ class Type : public Castable<Type> {
|
||||
/// @returns true if this type is an integer scalar or vector
|
||||
bool is_integer_scalar_or_vector();
|
||||
|
||||
/// @returns the type as a void type
|
||||
const VoidType* AsVoid() const;
|
||||
|
||||
/// @returns the type as a void type
|
||||
VoidType* AsVoid();
|
||||
|
||||
protected:
|
||||
Type();
|
||||
};
|
||||
|
||||
@@ -24,10 +24,6 @@ VoidType::VoidType(VoidType&&) = default;
|
||||
|
||||
VoidType::~VoidType() = default;
|
||||
|
||||
bool VoidType::IsVoid() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string VoidType::type_name() const {
|
||||
return "__void";
|
||||
}
|
||||
|
||||
@@ -32,9 +32,6 @@ class VoidType : public Castable<VoidType, Type> {
|
||||
VoidType(VoidType&&);
|
||||
~VoidType() override;
|
||||
|
||||
/// @returns true if the type is a void type
|
||||
bool IsVoid() const override;
|
||||
|
||||
/// @returns the name for this type
|
||||
std::string type_name() const override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user