mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 08:27:05 +00:00
Replace all uses of assert() with TINT_ICE macros
Use TINT_ICE() where we have diagnostics, TINT_ASSERT() where we do not. Change-Id: Ic6e842a7afdd957654c3461e5d03ecec7332e6f9 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/46444 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
dba65b7a34
commit
90f43cf87f
@@ -23,8 +23,8 @@ namespace type {
|
||||
|
||||
AccessControl::AccessControl(ast::AccessControl access, Type* subtype)
|
||||
: access_(access), subtype_(subtype) {
|
||||
assert(subtype_);
|
||||
assert(!subtype_->Is<AccessControl>());
|
||||
TINT_ASSERT(subtype_);
|
||||
TINT_ASSERT(!subtype_->Is<AccessControl>());
|
||||
}
|
||||
|
||||
AccessControl::AccessControl(AccessControl&&) = default;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace type {
|
||||
|
||||
Alias::Alias(const Symbol& sym, Type* subtype)
|
||||
: symbol_(sym), subtype_(subtype) {
|
||||
assert(subtype_);
|
||||
TINT_ASSERT(subtype_);
|
||||
}
|
||||
|
||||
Alias::Alias(Alias&&) = default;
|
||||
|
||||
@@ -31,7 +31,7 @@ Array::Array(Array&&) = default;
|
||||
Array::~Array() = default;
|
||||
|
||||
std::string Array::type_name() const {
|
||||
assert(subtype_);
|
||||
TINT_ASSERT(subtype_);
|
||||
|
||||
std::string type_name = "__array" + subtype_->type_name();
|
||||
if (!IsRuntimeArray()) {
|
||||
|
||||
@@ -22,19 +22,15 @@ namespace tint {
|
||||
namespace type {
|
||||
namespace {
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
bool IsValidDepthDimension(TextureDimension dim) {
|
||||
return dim == TextureDimension::k2d || dim == TextureDimension::k2dArray ||
|
||||
dim == TextureDimension::kCube || dim == TextureDimension::kCubeArray;
|
||||
}
|
||||
|
||||
#endif // NDEBUG
|
||||
|
||||
} // namespace
|
||||
|
||||
DepthTexture::DepthTexture(TextureDimension dim) : Base(dim) {
|
||||
assert(IsValidDepthDimension(dim));
|
||||
TINT_ASSERT(IsValidDepthDimension(dim));
|
||||
}
|
||||
|
||||
DepthTexture::DepthTexture(DepthTexture&&) = default;
|
||||
|
||||
@@ -23,10 +23,10 @@ namespace type {
|
||||
|
||||
Matrix::Matrix(Type* subtype, uint32_t rows, uint32_t columns)
|
||||
: subtype_(subtype), rows_(rows), columns_(columns) {
|
||||
assert(rows > 1);
|
||||
assert(rows < 5);
|
||||
assert(columns > 1);
|
||||
assert(columns < 5);
|
||||
TINT_ASSERT(rows > 1);
|
||||
TINT_ASSERT(rows < 5);
|
||||
TINT_ASSERT(columns > 1);
|
||||
TINT_ASSERT(columns < 5);
|
||||
}
|
||||
|
||||
Matrix::Matrix(Matrix&&) = default;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace type {
|
||||
|
||||
MultisampledTexture::MultisampledTexture(TextureDimension dim, Type* type)
|
||||
: Base(dim), type_(type) {
|
||||
assert(type_);
|
||||
TINT_ASSERT(type_);
|
||||
}
|
||||
|
||||
MultisampledTexture::MultisampledTexture(MultisampledTexture&&) = default;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace type {
|
||||
|
||||
SampledTexture::SampledTexture(TextureDimension dim, Type* type)
|
||||
: Base(dim), type_(type) {
|
||||
assert(type_);
|
||||
TINT_ASSERT(type_);
|
||||
}
|
||||
|
||||
SampledTexture::SampledTexture(SampledTexture&&) = default;
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace tint {
|
||||
namespace type {
|
||||
|
||||
Vector::Vector(Type* subtype, uint32_t size) : subtype_(subtype), size_(size) {
|
||||
assert(size_ > 1);
|
||||
assert(size_ < 5);
|
||||
TINT_ASSERT(size_ > 1);
|
||||
TINT_ASSERT(size_ < 5);
|
||||
}
|
||||
|
||||
Vector::Vector(Vector&&) = default;
|
||||
|
||||
Reference in New Issue
Block a user