• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_NOP
9 #define SKSL_NOP
10 
11 #include "include/private/SkSLStatement.h"
12 #include "src/sksl/ir/SkSLSymbolTable.h"
13 
14 namespace SkSL {
15 
16 /**
17  * A no-op statement that does nothing.
18  */
19 class Nop final : public Statement {
20 public:
21     inline static constexpr Kind kStatementKind = Kind::kNop;
22 
Nop()23     Nop()
24     : INHERITED(/*line=*/-1, kStatementKind) {}
25 
Make()26     static std::unique_ptr<Statement> Make() {
27         return std::make_unique<Nop>();
28     }
29 
isEmpty()30     bool isEmpty() const override {
31         return true;
32     }
33 
description()34     String description() const override {
35         return String(";");
36     }
37 
clone()38     std::unique_ptr<Statement> clone() const override {
39         return std::make_unique<Nop>();
40     }
41 
42 private:
43     using INHERITED = Statement;
44 };
45 
46 }  // namespace SkSL
47 
48 #endif
49