Flutter Engine
The Flutter Engine
SkSLDiscardStatement.h
Go to the documentation of this file.
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_DISCARDSTATEMENT
9#define SKSL_DISCARDSTATEMENT
10
14
15#include <memory>
16#include <string>
17
18namespace SkSL {
19
20class Context;
21
22/**
23 * A 'discard' statement.
24 */
25class DiscardStatement final : public Statement {
26public:
27 inline static constexpr Kind kIRNodeKind = Kind::kDiscard;
28
30
31 // Creates a discard-statement; reports errors via ErrorReporter.
32 static std::unique_ptr<Statement> Convert(const Context& context, Position pos);
33
34 // Creates a discard-statement; reports errors via SkASSERT.
35 static std::unique_ptr<Statement> Make(const Context& context, Position pos);
36
37 std::string description() const override {
38 return "discard;";
39 }
40
41private:
42 using INHERITED = Statement;
43};
44
45} // namespace SkSL
46
47#endif
SkPoint pos
static std::unique_ptr< Statement > Make(const Context &context, Position pos)
static std::unique_ptr< Statement > Convert(const Context &context, Position pos)
static constexpr Kind kIRNodeKind
std::string description() const override
Statement(Position pos, Kind kind)
Definition: SkSLStatement.h:23
StatementKind
Definition: SkSLIRNode.h:43