mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
Program: Remove deprecated symbol methods
Fixup all usages Bug: tint:390 Change-Id: If861b044eae006af2fd86d348de6ba62f448bc6a Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38549 Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
@@ -99,7 +99,7 @@ bool ValidatorImpl::ValidateConstructedTypes(
|
||||
add_error(member->source(), "v-0031",
|
||||
"a struct containing a runtime-sized array "
|
||||
"must be in the 'storage' storage class: '" +
|
||||
program_->SymbolToName(st->symbol()) + "'");
|
||||
program_->Symbols().NameFor(st->symbol()) + "'");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ bool ValidatorImpl::ValidateGlobalVariables(
|
||||
if (variable_stack_.has(var->symbol())) {
|
||||
add_error(var->source(), "v-0011",
|
||||
"redeclared global identifier '" +
|
||||
program_->SymbolToName(var->symbol()) + "'");
|
||||
program_->Symbols().NameFor(var->symbol()) + "'");
|
||||
return false;
|
||||
}
|
||||
if (!var->is_const() && var->storage_class() == ast::StorageClass::kNone) {
|
||||
@@ -140,7 +140,7 @@ bool ValidatorImpl::ValidateFunctions(const ast::FunctionList& funcs) {
|
||||
if (function_stack_.has(func->symbol())) {
|
||||
add_error(func->source(), "v-0016",
|
||||
"function names must be unique '" +
|
||||
program_->SymbolToName(func->symbol()) + "'");
|
||||
program_->Symbols().NameFor(func->symbol()) + "'");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -163,14 +163,14 @@ bool ValidatorImpl::ValidateEntryPoint(const ast::FunctionList& funcs) {
|
||||
if (!func->params().empty()) {
|
||||
add_error(func->source(), "v-0023",
|
||||
"Entry point function must accept no parameters: '" +
|
||||
program_->SymbolToName(func->symbol()) + "'");
|
||||
program_->Symbols().NameFor(func->symbol()) + "'");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!func->return_type()->Is<type::Void>()) {
|
||||
add_error(func->source(), "v-0024",
|
||||
"Entry point function must return void: '" +
|
||||
program_->SymbolToName(func->symbol()) + "'");
|
||||
program_->Symbols().NameFor(func->symbol()) + "'");
|
||||
return false;
|
||||
}
|
||||
auto stage_deco_count = 0;
|
||||
@@ -274,8 +274,9 @@ bool ValidatorImpl::ValidateDeclStatement(
|
||||
if (is_global) {
|
||||
error_code = "v-0013";
|
||||
}
|
||||
add_error(decl->source(), error_code,
|
||||
"redeclared identifier '" + program_->SymbolToName(symbol) + "'");
|
||||
add_error(
|
||||
decl->source(), error_code,
|
||||
"redeclared identifier '" + program_->Symbols().NameFor(symbol) + "'");
|
||||
return false;
|
||||
}
|
||||
// TODO(dneto): Check type compatibility of the initializer.
|
||||
@@ -415,13 +416,13 @@ bool ValidatorImpl::ValidateCallExpr(const ast::CallExpression* expr) {
|
||||
if (!function_stack_.has(symbol)) {
|
||||
add_error(expr->source(), "v-0005",
|
||||
"function must be declared before use: '" +
|
||||
program_->SymbolToName(symbol) + "'");
|
||||
program_->Symbols().NameFor(symbol) + "'");
|
||||
return false;
|
||||
}
|
||||
if (symbol == current_function_->symbol()) {
|
||||
add_error(expr->source(), "v-0004",
|
||||
"recursion is not allowed: '" +
|
||||
program_->SymbolToName(symbol) + "'");
|
||||
program_->Symbols().NameFor(symbol) + "'");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -447,15 +448,15 @@ bool ValidatorImpl::ValidateBadAssignmentToIdentifier(
|
||||
if (var->is_const()) {
|
||||
add_error(assign->source(), "v-0021",
|
||||
"cannot re-assign a constant: '" +
|
||||
program_->SymbolToName(ident->symbol()) + "'");
|
||||
program_->Symbols().NameFor(ident->symbol()) + "'");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// The identifier is not defined. This should already have been caught
|
||||
// when validating the subexpression.
|
||||
add_error(
|
||||
ident->source(), "v-0006",
|
||||
"'" + program_->SymbolToName(ident->symbol()) + "' is not declared");
|
||||
add_error(ident->source(), "v-0006",
|
||||
"'" + program_->Symbols().NameFor(ident->symbol()) +
|
||||
"' is not declared");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -525,9 +526,9 @@ bool ValidatorImpl::ValidateExpression(const ast::Expression* expr) {
|
||||
bool ValidatorImpl::ValidateIdentifier(const ast::IdentifierExpression* ident) {
|
||||
ast::Variable* var;
|
||||
if (!variable_stack_.get(ident->symbol(), &var)) {
|
||||
add_error(
|
||||
ident->source(), "v-0006",
|
||||
"'" + program_->SymbolToName(ident->symbol()) + "' is not declared");
|
||||
add_error(ident->source(), "v-0006",
|
||||
"'" + program_->Symbols().NameFor(ident->symbol()) +
|
||||
"' is not declared");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user