Avoid descending into Expressions unnecessarily.

We know expressions can't contain @if or @switch statements inside of
them, so we can avoid recursing into them and run this check slightly
faster.

Change-Id: I60cd6dd40ddda74f7af259fd13e5ea0779982384
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370076
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
John Stiles 2021-02-12 16:56:39 -05:00
parent 8dabeac58c
commit 59e3456695

View File

@ -1648,6 +1648,11 @@ void Compiler::verifyStaticTests(const Program& program) {
return INHERITED::visitStatement(stmt);
}
bool visitExpression(const Expression&) override {
// We aren't looking for anything inside an Expression, so skip them entirely.
return false;
}
private:
using INHERITED = ProgramVisitor;
ErrorReporter* fReporter;