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 8 #include "src/sksl/SkSLCompiler.h" 9 #include "src/sksl/SkSLContext.h" 10 11 namespace SkSL { 12 13 class Poison : public Expression { 14 public: 15 inline static constexpr Kind kExpressionKind = Kind::kPoison; 16 Make(int line,const Context & context)17 static std::unique_ptr<Expression> Make(int line, const Context& context) { 18 return std::make_unique<Poison>(line, context.fTypes.fPoison.get()); 19 } 20 Poison(int line,const Type * type)21 Poison(int line, const Type* type) 22 : INHERITED(line, kExpressionKind, type) {} 23 hasProperty(Property property)24 bool hasProperty(Property property) const override { 25 return false; 26 } 27 clone()28 std::unique_ptr<Expression> clone() const override { 29 return std::make_unique<Poison>(fLine, &this->type()); 30 } 31 description()32 String description() const override { 33 return Compiler::POISON_TAG; 34 } 35 36 private: 37 using INHERITED = Expression; 38 }; 39 40 } // namespace SkSL 41