summaryrefslogtreecommitdiffstats
path: root/gfx/skia/skia/src/sksl/ir/SkSLNop.h
blob: f2810ef15f49b65e046ce1b4bec3299ac654b27e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SKSL_NOP
#define SKSL_NOP

#include "include/private/SkSLStatement.h"
#include "src/sksl/ir/SkSLSymbolTable.h"

namespace SkSL {

/**
 * A no-op statement that does nothing.
 */
class Nop final : public Statement {
public:
    inline static constexpr Kind kIRNodeKind = Kind::kNop;

    Nop()
    : INHERITED(Position(), kIRNodeKind) {}

    static std::unique_ptr<Statement> Make() {
        return std::make_unique<Nop>();
    }

    bool isEmpty() const override {
        return true;
    }

    std::string description() const override {
        return ";";
    }

    std::unique_ptr<Statement> clone() const override {
        return std::make_unique<Nop>();
    }

private:
    using INHERITED = Statement;
};

}  // namespace SkSL

#endif