30 bool visitExpressionPtr(std::unique_ptr<Expression>& expr)
override {
35 bool visitStatementPtr(std::unique_ptr<Statement>& stmt)
override {
37 INHERITED::visitStatementPtr(stmt);
39 if (stmt->is<
Block>()) {
41 auto iter = std::remove_if(children.
begin(), children.
end(),
42 [](std::unique_ptr<Statement>& stmt) {
43 return stmt->isEmpty();
55 for (std::unique_ptr<ProgramElement>& pe : elements) {
57 EmptyStatementEliminator visitor;
#define INHERITED(method,...)
SkSpan(Container &&) -> SkSpan< std::remove_pointer_t< decltype(std::data(std::declval< Container >()))> >
std::unique_ptr< Statement > & body()
void resize(size_t count)
static void eliminate_empty_statements(SkSpan< std::unique_ptr< ProgramElement > > elements)
std::vector< std::unique_ptr< ProgramElement > > fElements