Flutter Engine
The Flutter Engine
SkSLProgramWriter.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkSLProgramWriter_DEFINED
9#define SkSLProgramWriter_DEFINED
10
12
13namespace SkSL {
14
20 using UniquePtrExpression = std::unique_ptr<SkSL::Expression>;
21 using UniquePtrStatement = std::unique_ptr<SkSL::Statement>;
22};
23
24extern template class TProgramVisitor<ProgramWriterTypes>;
25
27public:
28 // Subclass these methods if you want access to the unique_ptrs of IRNodes in a program.
29 // This will allow statements or expressions to be replaced during a visit.
30 bool visitExpressionPtr(std::unique_ptr<Expression>& e) override {
31 return this->visitExpression(*e);
32 }
33 bool visitStatementPtr(std::unique_ptr<Statement>& s) override {
34 return this->visitStatement(*s);
35 }
36};
37
38} // namespace SkSL
39
40#endif
bool visitExpressionPtr(std::unique_ptr< Expression > &e) override
bool visitStatementPtr(std::unique_ptr< Statement > &s) override
struct MyStruct s
std::unique_ptr< SkSL::Expression > UniquePtrExpression
std::unique_ptr< SkSL::Statement > UniquePtrStatement