[tint] Remove current_function from ValidateFunction.
The ValidateFunction method just required the current pipeline stage. Provide the stage directly instead of using current_function. Bug: tint:1313 Change-Id: I0c12bef4b28b9cecfbd2b9d7d336a8ff3f8c3a77 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87144 Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
parent
d382e20b00
commit
8c67fec731
|
@ -699,7 +699,10 @@ sem::Function* Resolver::Function(const ast::Function* decl) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ValidateFunction(func)) {
|
auto stage = current_function_
|
||||||
|
? current_function_->Declaration()->PipelineStage()
|
||||||
|
: ast::PipelineStage::kNone;
|
||||||
|
if (!ValidateFunction(func, stage)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -260,7 +260,7 @@ class Resolver {
|
||||||
bool ValidateEntryPoint(const sem::Function* func, ast::PipelineStage stage);
|
bool ValidateEntryPoint(const sem::Function* func, ast::PipelineStage stage);
|
||||||
bool ValidateForLoopStatement(const sem::ForLoopStatement* stmt);
|
bool ValidateForLoopStatement(const sem::ForLoopStatement* stmt);
|
||||||
bool ValidateFallthroughStatement(const sem::Statement* stmt);
|
bool ValidateFallthroughStatement(const sem::Statement* stmt);
|
||||||
bool ValidateFunction(const sem::Function* func);
|
bool ValidateFunction(const sem::Function* func, ast::PipelineStage stage);
|
||||||
bool ValidateFunctionCall(const sem::Call* call);
|
bool ValidateFunctionCall(const sem::Call* call);
|
||||||
bool ValidateGlobalVariable(const sem::Variable* var);
|
bool ValidateGlobalVariable(const sem::Variable* var);
|
||||||
bool ValidateIfStatement(const sem::IfStatement* stmt);
|
bool ValidateIfStatement(const sem::IfStatement* stmt);
|
||||||
|
|
|
@ -832,7 +832,8 @@ bool Resolver::ValidateInterpolateAttribute(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Resolver::ValidateFunction(const sem::Function* func) {
|
bool Resolver::ValidateFunction(const sem::Function* func,
|
||||||
|
ast::PipelineStage stage) {
|
||||||
auto* decl = func->Declaration();
|
auto* decl = func->Declaration();
|
||||||
|
|
||||||
auto name = builder_->Symbols().NameFor(decl->symbol);
|
auto name = builder_->Symbols().NameFor(decl->symbol);
|
||||||
|
@ -917,9 +918,6 @@ bool Resolver::ValidateFunction(const sem::Function* func) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decl->IsEntryPoint()) {
|
if (decl->IsEntryPoint()) {
|
||||||
auto stage = current_function_
|
|
||||||
? current_function_->Declaration()->PipelineStage()
|
|
||||||
: ast::PipelineStage::kNone;
|
|
||||||
if (!ValidateEntryPoint(func, stage)) {
|
if (!ValidateEntryPoint(func, stage)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue