Resolver: Move logic ValidateFunction() -> Function()
I inserted this non-validation code in the wrong method. Change-Id: I43f6d8a0cbf6f0b5f20e453785b141b50d159044 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/46442 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
5c523f331d
commit
c87ff9c238
|
@ -248,15 +248,6 @@ bool Resolver::ValidateFunction(const ast::Function* func) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto* param : func->params()) {
|
for (auto* param : func->params()) {
|
||||||
if (!ApplyStorageClassUsageToType(param->declared_storage_class(),
|
|
||||||
param->declared_type(),
|
|
||||||
param->source())) {
|
|
||||||
diagnostics_.add_note("while instantiating parameter " +
|
|
||||||
builder_->Symbols().NameFor(param->symbol()),
|
|
||||||
param->source());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ValidateParameter(param)) {
|
if (!ValidateParameter(param)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -294,6 +285,15 @@ bool Resolver::Function(ast::Function* func) {
|
||||||
for (auto* param : func->params()) {
|
for (auto* param : func->params()) {
|
||||||
variable_stack_.set(param->symbol(), CreateVariableInfo(param));
|
variable_stack_.set(param->symbol(), CreateVariableInfo(param));
|
||||||
|
|
||||||
|
if (!ApplyStorageClassUsageToType(param->declared_storage_class(),
|
||||||
|
param->declared_type(),
|
||||||
|
param->source())) {
|
||||||
|
diagnostics_.add_note("while instantiating parameter " +
|
||||||
|
builder_->Symbols().NameFor(param->symbol()),
|
||||||
|
param->source());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (auto* str =
|
if (auto* str =
|
||||||
param->declared_type()->UnwrapAliasIfNeeded()->As<type::Struct>()) {
|
param->declared_type()->UnwrapAliasIfNeeded()->As<type::Struct>()) {
|
||||||
auto* info = Structure(str);
|
auto* info = Structure(str);
|
||||||
|
|
Loading…
Reference in New Issue