| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
#ifndef SkSLEmptyExpression_DEFINED |
| 8 |
#define SkSLEmptyExpression_DEFINED |
| 9 |
|
| 10 |
#include "src/sksl/SkSLBuiltinTypes.h" |
| 11 |
#include "src/sksl/SkSLCompiler.h" |
| 12 |
#include "src/sksl/SkSLContext.h" |
| 13 |
#include "src/sksl/ir/SkSLExpression.h" |
| 14 |
|
| 15 |
namespace SkSL { |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
class EmptyExpression : public Expression { |
| 22 |
public: |
| 23 |
inline static constexpr Kind kIRNodeKind = Kind::kEmpty; |
| 24 |
|
| 25 |
static std::unique_ptr<Expression> Make(Position pos, const Context& context) { |
| 26 |
return std::make_unique<EmptyExpression>(pos, context.fTypes.fVoid.get()); |
| 27 |
} |
| 28 |
|
| 29 |
EmptyExpression(Position pos, const Type* type) |
| 30 |
: INHERITED(pos, kIRNodeKind, type) { |
| 31 |
SkASSERT(type->isVoid()); |
| 32 |
} |
| 33 |
|
| 34 |
std::unique_ptr<Expression> clone(Position pos) const override { |
| 35 |
return std::make_unique<EmptyExpression>(pos, &this->type()); |
| 36 |
} |
| 37 |
|
| 38 |
std::string description(OperatorPrecedence) const override { |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
return "false"; |
| 43 |
} |
| 44 |
|
| 45 |
private: |
| 46 |
using INHERITED = Expression; |
| 47 |
}; |
| 48 |
|
| 49 |
} |
| 50 |
|
| 51 |
#endif |