Convert IRGenerator::convertDo to DoStatement::Make.
We currently don't have any optimizations for do-statements so the
primary benefit is moving code out of IRGenerator.
Change-Id: Ibc4d1ecd87ebef572e742dfdb15821cf4ac0f047
Bug: skia:11342
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376179
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/sksl/SkSLRehydrator.cpp b/src/sksl/SkSLRehydrator.cpp
index 781827c..95d9f5d 100644
--- a/src/sksl/SkSLRehydrator.cpp
+++ b/src/sksl/SkSLRehydrator.cpp
@@ -363,8 +363,7 @@
case Rehydrator::kDo_Command: {
std::unique_ptr<Statement> stmt = this->statement();
std::unique_ptr<Expression> expr = this->expression();
- return std::unique_ptr<Statement>(new DoStatement(-1, std::move(stmt),
- std::move(expr)));
+ return DoStatement::Make(fContext, std::move(stmt), std::move(expr));
}
case Rehydrator::kExpressionStatement_Command: {
std::unique_ptr<Expression> expr = this->expression();