mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-15 08:06:19 +00:00
diag: Add System enumerator to all diagnostics
Describes what Tint system raised the diagnostic. Use this information in the fuzzers to distinguish between expected and unexpected failure cases in the Transform fuzzer tests. Fixed: chromium:1206407 Fixed: chromium:1207154 Change-Id: I3b807acafe384a2fc363d2a4165a29693450b3cf Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55254 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
committed by
Tint LUCI CQ
parent
261643bb9f
commit
ffd28e2e1a
@@ -28,7 +28,7 @@ Alias::Alias(ProgramID program_id,
|
||||
: Base(program_id, source, name),
|
||||
subtype_(subtype),
|
||||
type_name_("__alias_" + name.to_str() + subtype->type_name()) {
|
||||
TINT_ASSERT(subtype_);
|
||||
TINT_ASSERT(AST, subtype_);
|
||||
}
|
||||
|
||||
Alias::Alias(Alias&&) = default;
|
||||
|
||||
@@ -38,7 +38,7 @@ Array::Array(Array&&) = default;
|
||||
Array::~Array() = default;
|
||||
|
||||
std::string Array::type_name() const {
|
||||
TINT_ASSERT(subtype_);
|
||||
TINT_ASSERT(AST, subtype_);
|
||||
|
||||
std::string type_name = "__array" + subtype_->type_name();
|
||||
if (!IsRuntimeArray()) {
|
||||
|
||||
@@ -26,10 +26,10 @@ ArrayAccessorExpression::ArrayAccessorExpression(ProgramID program_id,
|
||||
Expression* array,
|
||||
Expression* idx_expr)
|
||||
: Base(program_id, source), array_(array), idx_expr_(idx_expr) {
|
||||
TINT_ASSERT(array_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(array_, program_id);
|
||||
TINT_ASSERT(idx_expr_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(idx_expr_, program_id);
|
||||
TINT_ASSERT(AST, array_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, array_, program_id);
|
||||
TINT_ASSERT(AST, idx_expr_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, idx_expr_, program_id);
|
||||
}
|
||||
|
||||
ArrayAccessorExpression::ArrayAccessorExpression(ArrayAccessorExpression&&) =
|
||||
|
||||
@@ -26,10 +26,10 @@ AssignmentStatement::AssignmentStatement(ProgramID program_id,
|
||||
Expression* lhs,
|
||||
Expression* rhs)
|
||||
: Base(program_id, source), lhs_(lhs), rhs_(rhs) {
|
||||
TINT_ASSERT(lhs_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(lhs_, program_id);
|
||||
TINT_ASSERT(rhs_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(rhs_, program_id);
|
||||
TINT_ASSERT(AST, lhs_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, lhs_, program_id);
|
||||
TINT_ASSERT(AST, rhs_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, rhs_, program_id);
|
||||
}
|
||||
|
||||
AssignmentStatement::AssignmentStatement(AssignmentStatement&&) = default;
|
||||
|
||||
@@ -27,11 +27,11 @@ BinaryExpression::BinaryExpression(ProgramID program_id,
|
||||
Expression* lhs,
|
||||
Expression* rhs)
|
||||
: Base(program_id, source), op_(op), lhs_(lhs), rhs_(rhs) {
|
||||
TINT_ASSERT(lhs_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(lhs_, program_id);
|
||||
TINT_ASSERT(rhs_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(rhs_, program_id);
|
||||
TINT_ASSERT(op_ != BinaryOp::kNone);
|
||||
TINT_ASSERT(AST, lhs_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, lhs_, program_id);
|
||||
TINT_ASSERT(AST, rhs_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, rhs_, program_id);
|
||||
TINT_ASSERT(AST, op_ != BinaryOp::kNone);
|
||||
}
|
||||
|
||||
BinaryExpression::BinaryExpression(BinaryExpression&&) = default;
|
||||
|
||||
@@ -26,9 +26,9 @@ BitcastExpression::BitcastExpression(ProgramID program_id,
|
||||
ast::Type* type,
|
||||
Expression* expr)
|
||||
: Base(program_id, source), type_(type), expr_(expr) {
|
||||
TINT_ASSERT(type_);
|
||||
TINT_ASSERT(expr_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(expr, program_id);
|
||||
TINT_ASSERT(AST, type_);
|
||||
TINT_ASSERT(AST, expr_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, expr, program_id);
|
||||
}
|
||||
|
||||
BitcastExpression::BitcastExpression(BitcastExpression&&) = default;
|
||||
|
||||
@@ -26,8 +26,8 @@ BlockStatement::BlockStatement(ProgramID program_id,
|
||||
const StatementList& statements)
|
||||
: Base(program_id, source), statements_(std::move(statements)) {
|
||||
for (auto* stmt : *this) {
|
||||
TINT_ASSERT(stmt);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(stmt, program_id);
|
||||
TINT_ASSERT(AST, stmt);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, stmt, program_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ CallExpression::CallExpression(ProgramID program_id,
|
||||
IdentifierExpression* func,
|
||||
ExpressionList params)
|
||||
: Base(program_id, source), func_(func), params_(params) {
|
||||
TINT_ASSERT(func_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(func_, program_id);
|
||||
TINT_ASSERT(AST, func_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, func_, program_id);
|
||||
for (auto* param : params_) {
|
||||
TINT_ASSERT(param);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(param, program_id);
|
||||
TINT_ASSERT(AST, param);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, param, program_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ CallStatement::CallStatement(ProgramID program_id,
|
||||
const Source& source,
|
||||
CallExpression* call)
|
||||
: Base(program_id, source), call_(call) {
|
||||
TINT_ASSERT(call_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(call_, program_id);
|
||||
TINT_ASSERT(AST, call_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, call_, program_id);
|
||||
}
|
||||
|
||||
CallStatement::CallStatement(CallStatement&&) = default;
|
||||
|
||||
@@ -26,11 +26,11 @@ CaseStatement::CaseStatement(ProgramID program_id,
|
||||
CaseSelectorList selectors,
|
||||
BlockStatement* body)
|
||||
: Base(program_id, source), selectors_(selectors), body_(body) {
|
||||
TINT_ASSERT(body_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(body_, program_id);
|
||||
TINT_ASSERT(AST, body_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, body_, program_id);
|
||||
for (auto* selector : selectors) {
|
||||
TINT_ASSERT(selector);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(selector, program_id);
|
||||
TINT_ASSERT(AST, selector);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, selector, program_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ DepthTexture::DepthTexture(ProgramID program_id,
|
||||
const Source& source,
|
||||
TextureDimension dim)
|
||||
: Base(program_id, source, dim) {
|
||||
TINT_ASSERT(IsValidDepthDimension(dim));
|
||||
TINT_ASSERT(AST, IsValidDepthDimension(dim));
|
||||
}
|
||||
|
||||
DepthTexture::DepthTexture(DepthTexture&&) = default;
|
||||
|
||||
@@ -26,9 +26,9 @@ ElseStatement::ElseStatement(ProgramID program_id,
|
||||
Expression* condition,
|
||||
BlockStatement* body)
|
||||
: Base(program_id, source), condition_(condition), body_(body) {
|
||||
TINT_ASSERT(body_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(body_, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(condition_, program_id);
|
||||
TINT_ASSERT(AST, body_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, body_, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, condition_, program_id);
|
||||
}
|
||||
|
||||
ElseStatement::ElseStatement(ElseStatement&&) = default;
|
||||
|
||||
@@ -38,19 +38,19 @@ Function::Function(ProgramID program_id,
|
||||
body_(body),
|
||||
decorations_(std::move(decorations)),
|
||||
return_type_decorations_(std::move(return_type_decorations)) {
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(symbol_, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(body, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, symbol_, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, body, program_id);
|
||||
for (auto* param : params_) {
|
||||
TINT_ASSERT(param && param->is_const());
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(param, program_id);
|
||||
TINT_ASSERT(AST, param && param->is_const());
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, param, program_id);
|
||||
}
|
||||
TINT_ASSERT(symbol_.IsValid());
|
||||
TINT_ASSERT(return_type_);
|
||||
TINT_ASSERT(AST, symbol_.IsValid());
|
||||
TINT_ASSERT(AST, return_type_);
|
||||
for (auto* deco : decorations_) {
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(deco, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, deco, program_id);
|
||||
}
|
||||
for (auto* deco : return_type_decorations_) {
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(deco, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, deco, program_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ IdentifierExpression::IdentifierExpression(ProgramID program_id,
|
||||
const Source& source,
|
||||
Symbol sym)
|
||||
: Base(program_id, source), sym_(sym) {
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(sym_, program_id);
|
||||
TINT_ASSERT(sym_.IsValid());
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, sym_, program_id);
|
||||
TINT_ASSERT(AST, sym_.IsValid());
|
||||
}
|
||||
|
||||
IdentifierExpression::IdentifierExpression(IdentifierExpression&&) = default;
|
||||
|
||||
@@ -30,13 +30,13 @@ IfStatement::IfStatement(ProgramID program_id,
|
||||
condition_(condition),
|
||||
body_(body),
|
||||
else_statements_(std::move(else_stmts)) {
|
||||
TINT_ASSERT(condition_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(condition_, program_id);
|
||||
TINT_ASSERT(body_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(body_, program_id);
|
||||
TINT_ASSERT(AST, condition_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, condition_, program_id);
|
||||
TINT_ASSERT(AST, body_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, body_, program_id);
|
||||
for (auto* el : else_statements_) {
|
||||
TINT_ASSERT(el);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(el, program_id);
|
||||
TINT_ASSERT(AST, el);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, el, program_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ ast::Type* TextureOverloadCase::buildResultVectorComponentType(
|
||||
return b->ty.i32();
|
||||
}
|
||||
|
||||
TINT_UNREACHABLE(b->Diagnostics());
|
||||
TINT_UNREACHABLE(AST, b->Diagnostics());
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ ast::Variable* TextureOverloadCase::buildTextureVariable(
|
||||
}
|
||||
}
|
||||
|
||||
TINT_UNREACHABLE(b->Diagnostics());
|
||||
TINT_UNREACHABLE(AST, b->Diagnostics());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ LoopStatement::LoopStatement(ProgramID program_id,
|
||||
BlockStatement* body,
|
||||
BlockStatement* continuing)
|
||||
: Base(program_id, source), body_(body), continuing_(continuing) {
|
||||
TINT_ASSERT(body_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(body_, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(continuing_, program_id);
|
||||
TINT_ASSERT(AST, body_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, body_, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, continuing_, program_id);
|
||||
}
|
||||
|
||||
LoopStatement::LoopStatement(LoopStatement&&) = default;
|
||||
|
||||
@@ -30,10 +30,10 @@ Matrix::Matrix(ProgramID program_id,
|
||||
subtype_(subtype),
|
||||
rows_(rows),
|
||||
columns_(columns) {
|
||||
TINT_ASSERT(rows > 1);
|
||||
TINT_ASSERT(rows < 5);
|
||||
TINT_ASSERT(columns > 1);
|
||||
TINT_ASSERT(columns < 5);
|
||||
TINT_ASSERT(AST, rows > 1);
|
||||
TINT_ASSERT(AST, rows < 5);
|
||||
TINT_ASSERT(AST, columns > 1);
|
||||
TINT_ASSERT(AST, columns < 5);
|
||||
}
|
||||
|
||||
Matrix::Matrix(Matrix&&) = default;
|
||||
|
||||
@@ -26,10 +26,10 @@ MemberAccessorExpression::MemberAccessorExpression(ProgramID program_id,
|
||||
Expression* structure,
|
||||
IdentifierExpression* member)
|
||||
: Base(program_id, source), struct_(structure), member_(member) {
|
||||
TINT_ASSERT(struct_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(struct_, program_id);
|
||||
TINT_ASSERT(member_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(member_, program_id);
|
||||
TINT_ASSERT(AST, struct_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, struct_, program_id);
|
||||
TINT_ASSERT(AST, member_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, member_, program_id);
|
||||
}
|
||||
|
||||
MemberAccessorExpression::MemberAccessorExpression(MemberAccessorExpression&&) =
|
||||
|
||||
@@ -44,7 +44,7 @@ Module::Module(ProgramID program_id,
|
||||
global_variables_.push_back(var);
|
||||
} else {
|
||||
diag::List diagnostics;
|
||||
TINT_ICE(diagnostics) << "Unknown global declaration type";
|
||||
TINT_ICE(AST, diagnostics) << "Unknown global declaration type";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,22 +61,22 @@ const ast::TypeDecl* Module::LookupType(Symbol name) const {
|
||||
}
|
||||
|
||||
void Module::AddGlobalVariable(ast::Variable* var) {
|
||||
TINT_ASSERT(var);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(var, program_id());
|
||||
TINT_ASSERT(AST, var);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, var, program_id());
|
||||
global_variables_.push_back(var);
|
||||
global_declarations_.push_back(var);
|
||||
}
|
||||
|
||||
void Module::AddTypeDecl(ast::TypeDecl* type) {
|
||||
TINT_ASSERT(type);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(type, program_id());
|
||||
TINT_ASSERT(AST, type);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, type, program_id());
|
||||
type_decls_.push_back(type);
|
||||
global_declarations_.push_back(type);
|
||||
}
|
||||
|
||||
void Module::AddFunction(ast::Function* func) {
|
||||
TINT_ASSERT(func);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(func, program_id());
|
||||
TINT_ASSERT(AST, func);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, func, program_id());
|
||||
functions_.push_back(func);
|
||||
global_declarations_.push_back(func);
|
||||
}
|
||||
@@ -98,20 +98,22 @@ void Module::Copy(CloneContext* ctx, const Module* src) {
|
||||
|
||||
for (auto* decl : global_declarations_) {
|
||||
if (!decl) {
|
||||
TINT_ICE(ctx->dst->Diagnostics()) << "src global declaration was nullptr";
|
||||
TINT_ICE(AST, ctx->dst->Diagnostics())
|
||||
<< "src global declaration was nullptr";
|
||||
continue;
|
||||
}
|
||||
if (auto* type = decl->As<ast::TypeDecl>()) {
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(type, program_id());
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, type, program_id());
|
||||
type_decls_.push_back(type);
|
||||
} else if (auto* func = decl->As<Function>()) {
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(func, program_id());
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, func, program_id());
|
||||
functions_.push_back(func);
|
||||
} else if (auto* var = decl->As<Variable>()) {
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(var, program_id());
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, var, program_id());
|
||||
global_variables_.push_back(var);
|
||||
} else {
|
||||
TINT_ICE(ctx->dst->Diagnostics()) << "Unknown global declaration type";
|
||||
TINT_ICE(AST, ctx->dst->Diagnostics())
|
||||
<< "Unknown global declaration type";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ MultisampledTexture::MultisampledTexture(ProgramID program_id,
|
||||
TextureDimension dim,
|
||||
Type* type)
|
||||
: Base(program_id, source, dim), type_(type) {
|
||||
TINT_ASSERT(type_);
|
||||
TINT_ASSERT(AST, type_);
|
||||
}
|
||||
|
||||
MultisampledTexture::MultisampledTexture(MultisampledTexture&&) = default;
|
||||
|
||||
@@ -28,7 +28,7 @@ ReturnStatement::ReturnStatement(ProgramID program_id,
|
||||
const Source& source,
|
||||
Expression* value)
|
||||
: Base(program_id, source), value_(value) {
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(value_, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, value_, program_id);
|
||||
}
|
||||
|
||||
ReturnStatement::ReturnStatement(ReturnStatement&&) = default;
|
||||
|
||||
@@ -26,7 +26,7 @@ SampledTexture::SampledTexture(ProgramID program_id,
|
||||
TextureDimension dim,
|
||||
Type const* type)
|
||||
: Base(program_id, source, dim), type_(type) {
|
||||
TINT_ASSERT(type_);
|
||||
TINT_ASSERT(AST, type_);
|
||||
}
|
||||
|
||||
SampledTexture::SampledTexture(SampledTexture&&) = default;
|
||||
|
||||
@@ -25,8 +25,8 @@ ScalarConstructorExpression::ScalarConstructorExpression(ProgramID program_id,
|
||||
const Source& source,
|
||||
Literal* literal)
|
||||
: Base(program_id, source), literal_(literal) {
|
||||
TINT_ASSERT(literal);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(literal, program_id);
|
||||
TINT_ASSERT(AST, literal);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, literal, program_id);
|
||||
}
|
||||
|
||||
ScalarConstructorExpression::ScalarConstructorExpression(
|
||||
|
||||
@@ -33,12 +33,12 @@ Struct::Struct(ProgramID program_id,
|
||||
members_(std::move(members)),
|
||||
decorations_(std::move(decorations)) {
|
||||
for (auto* mem : members_) {
|
||||
TINT_ASSERT(mem);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(mem, program_id);
|
||||
TINT_ASSERT(AST, mem);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, mem, program_id);
|
||||
}
|
||||
for (auto* deco : decorations_) {
|
||||
TINT_ASSERT(deco);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(deco, program_id);
|
||||
TINT_ASSERT(AST, deco);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, deco, program_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@ StructMember::StructMember(ProgramID program_id,
|
||||
symbol_(sym),
|
||||
type_(type),
|
||||
decorations_(std::move(decorations)) {
|
||||
TINT_ASSERT(type);
|
||||
TINT_ASSERT(symbol_.IsValid());
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(symbol_, program_id);
|
||||
TINT_ASSERT(AST, type);
|
||||
TINT_ASSERT(AST, symbol_.IsValid());
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, symbol_, program_id);
|
||||
for (auto* deco : decorations_) {
|
||||
TINT_ASSERT(deco);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(deco, program_id);
|
||||
TINT_ASSERT(AST, deco);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, deco, program_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ SwitchStatement::SwitchStatement(ProgramID program_id,
|
||||
Expression* condition,
|
||||
CaseStatementList body)
|
||||
: Base(program_id, source), condition_(condition), body_(body) {
|
||||
TINT_ASSERT(condition_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(condition_, program_id);
|
||||
TINT_ASSERT(AST, condition_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, condition_, program_id);
|
||||
for (auto* stmt : body_) {
|
||||
TINT_ASSERT(stmt);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(stmt, program_id);
|
||||
TINT_ASSERT(AST, stmt);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, stmt, program_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ TypeConstructorExpression::TypeConstructorExpression(ProgramID program_id,
|
||||
ast::Type* type,
|
||||
ExpressionList values)
|
||||
: Base(program_id, source), type_(type), values_(std::move(values)) {
|
||||
TINT_ASSERT(type_);
|
||||
TINT_ASSERT(AST, type_);
|
||||
for (auto* val : values_) {
|
||||
TINT_ASSERT(val);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(val, program_id);
|
||||
TINT_ASSERT(AST, val);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, val, program_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace ast {
|
||||
|
||||
TypeDecl::TypeDecl(ProgramID program_id, const Source& source, Symbol name)
|
||||
: Base(program_id, source), name_(name) {
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(name, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, name, program_id);
|
||||
}
|
||||
|
||||
TypeDecl::TypeDecl(TypeDecl&&) = default;
|
||||
|
||||
@@ -26,8 +26,8 @@ UnaryOpExpression::UnaryOpExpression(ProgramID program_id,
|
||||
UnaryOp op,
|
||||
Expression* expr)
|
||||
: Base(program_id, source), op_(op), expr_(expr) {
|
||||
TINT_ASSERT(expr_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(expr_, program_id);
|
||||
TINT_ASSERT(AST, expr_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, expr_, program_id);
|
||||
}
|
||||
|
||||
UnaryOpExpression::UnaryOpExpression(UnaryOpExpression&&) = default;
|
||||
|
||||
@@ -40,9 +40,9 @@ Variable::Variable(ProgramID program_id,
|
||||
decorations_(std::move(decorations)),
|
||||
declared_storage_class_(declared_storage_class),
|
||||
declared_access_(declared_access) {
|
||||
TINT_ASSERT(symbol_.IsValid());
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(symbol_, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(constructor, program_id);
|
||||
TINT_ASSERT(AST, symbol_.IsValid());
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, symbol_, program_id);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, constructor, program_id);
|
||||
}
|
||||
|
||||
Variable::Variable(Variable&&) = default;
|
||||
|
||||
@@ -25,8 +25,8 @@ VariableDeclStatement::VariableDeclStatement(ProgramID program_id,
|
||||
const Source& source,
|
||||
Variable* variable)
|
||||
: Base(program_id, source), variable_(variable) {
|
||||
TINT_ASSERT(variable_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(variable_, program_id);
|
||||
TINT_ASSERT(AST, variable_);
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, variable_, program_id);
|
||||
}
|
||||
|
||||
VariableDeclStatement::VariableDeclStatement(VariableDeclStatement&&) = default;
|
||||
|
||||
@@ -26,8 +26,8 @@ Vector::Vector(ProgramID program_id,
|
||||
Type const* subtype,
|
||||
uint32_t size)
|
||||
: Base(program_id, source), subtype_(subtype), size_(size) {
|
||||
TINT_ASSERT(size_ > 1);
|
||||
TINT_ASSERT(size_ < 5);
|
||||
TINT_ASSERT(AST, size_ > 1);
|
||||
TINT_ASSERT(AST, size_ < 5);
|
||||
}
|
||||
|
||||
Vector::Vector(Vector&&) = default;
|
||||
|
||||
Reference in New Issue
Block a user