/src/skia/src/sksl/ir/SkSLStatement.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2016 Google Inc. |
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 SKSL_STATEMENT |
9 | | #define SKSL_STATEMENT |
10 | | |
11 | | #include "src/sksl/ir/SkSLIRNode.h" |
12 | | #include "src/sksl/ir/SkSLSymbol.h" |
13 | | |
14 | | namespace SkSL { |
15 | | |
16 | | /** |
17 | | * Abstract supertype of all statements. |
18 | | */ |
19 | | class Statement : public IRNode { |
20 | | public: |
21 | | using Kind = StatementKind; |
22 | | |
23 | | Statement(Position pos, Kind kind) |
24 | 42.8k | : INHERITED(pos, (int) kind) { |
25 | 42.8k | SkASSERT(kind >= Kind::kFirst && kind <= Kind::kLast); |
26 | 42.8k | } |
27 | | |
28 | 69.4k | Kind kind() const { |
29 | 69.4k | return (Kind) fKind; |
30 | 69.4k | } |
31 | | |
32 | 17.9k | virtual bool isEmpty() const { |
33 | 17.9k | return false; |
34 | 17.9k | } |
35 | | |
36 | | private: |
37 | | using INHERITED = IRNode; |
38 | | }; |
39 | | |
40 | | } // namespace SkSL |
41 | | |
42 | | #endif |