Flutter Engine
The Flutter Engine
SkSLPoison.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#ifndef SkSLPoison_DEFINED
8#define SkSLPoison_DEFINED
9
14
15namespace SkSL {
16
17class Poison : public Expression {
18public:
19 inline static constexpr Kind kIRNodeKind = Kind::kPoison;
20
21 static std::unique_ptr<Expression> Make(Position pos, const Context& context) {
22 return std::make_unique<Poison>(pos, context.fTypes.fPoison.get());
23 }
24
27
28 std::unique_ptr<Expression> clone(Position pos) const override {
29 return std::make_unique<Poison>(pos, &this->type());
30 }
31
32 std::string description(OperatorPrecedence) const override {
34 }
35
36private:
37 using INHERITED = Expression;
38};
39
40} // namespace SkSL
41
42#endif // SkSLPoison_DEFINED
SkPoint pos
const std::unique_ptr< Type > fPoison
static constexpr const char POISON_TAG[]
Definition: SkSLCompiler.h:74
const BuiltinTypes & fTypes
Definition: SkSLContext.h:30
Expression(Position pos, Kind kind, const Type *type)
const Type & type() const
static std::unique_ptr< Expression > Make(Position pos, const Context &context)
Definition: SkSLPoison.h:21
Poison(Position pos, const Type *type)
Definition: SkSLPoison.h:25
std::string description(OperatorPrecedence) const override
Definition: SkSLPoison.h:32
static constexpr Kind kIRNodeKind
Definition: SkSLPoison.h:19
std::unique_ptr< Expression > clone(Position pos) const override
Definition: SkSLPoison.h:28
OperatorPrecedence
Definition: SkSLOperator.h:57
ExpressionKind
Definition: SkSLIRNode.h:62