Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
SkSL::EmptyExpression Class Reference

#include <SkSLEmptyExpression.h>

Inheritance diagram for SkSL::EmptyExpression:
SkSL::Expression SkSL::IRNode SkSL::Poolable

Public Member Functions

 EmptyExpression (Position pos, const Type *type)
 
std::unique_ptr< Expressionclone (Position pos) const override
 
std::string description (OperatorPrecedence) const override
 
- Public Member Functions inherited from SkSL::Expression
 Expression (Position pos, Kind kind, const Type *type)
 
Kind kind () const
 
const Typetype () const
 
bool isAnyConstructor () const
 
bool isIntLiteral () const
 
bool isFloatLiteral () const
 
bool isBoolLiteral () const
 
AnyConstructorasAnyConstructor ()
 
const AnyConstructorasAnyConstructor () const
 
bool isIncomplete (const Context &context) const
 
virtual ComparisonResult compareConstant (const Expression &other) const
 
CoercionCost coercionCost (const Type &target) const
 
virtual bool supportsConstantValues () const
 
virtual std::optional< double > getConstantValue (int n) const
 
virtual std::unique_ptr< Expressionclone (Position pos) const =0
 
std::unique_ptr< Expressionclone () const
 
std::string description () const final
 
virtual std::string description (OperatorPrecedence parentPrecedence) const =0
 
- Public Member Functions inherited from SkSL::IRNode
virtual ~IRNode ()
 
virtual std::string description () const =0
 
 IRNode (const IRNode &)=delete
 
IRNodeoperator= (const IRNode &)=delete
 
Position position () const
 
void setPosition (Position p)
 
template<typename T >
bool is () const
 
template<typename T >
const Tas () const
 
template<typename T >
Tas ()
 

Static Public Member Functions

static std::unique_ptr< ExpressionMake (Position pos, const Context &context)
 
- Static Public Member Functions inherited from SkSL::Poolable
static void * operator new (const size_t size)
 
static void operator delete (void *ptr)
 

Static Public Attributes

static constexpr Kind kIRNodeKind = Kind::kEmpty
 

Additional Inherited Members

- Public Types inherited from SkSL::Expression
enum class  ComparisonResult { kUnknown = -1 , kNotEqual , kEqual }
 
using Kind = ExpressionKind
 
- Public Attributes inherited from SkSL::IRNode
Position fPosition
 
- Protected Member Functions inherited from SkSL::IRNode
 IRNode (Position position, int kind)
 
- Protected Attributes inherited from SkSL::IRNode
int fKind
 

Detailed Description

The EmptyExpression is a void-typed expression with nothing inside. EmptyExpressions can exist inside an ExpressionStatement; this construct is functionally equivalent to a Nop.

Definition at line 21 of file SkSLEmptyExpression.h.

Constructor & Destructor Documentation

◆ EmptyExpression()

SkSL::EmptyExpression::EmptyExpression ( Position  pos,
const Type type 
)
inline

Definition at line 29 of file SkSLEmptyExpression.h.

30 : INHERITED(pos, kIRNodeKind, type) {
32 }
SkPoint pos
#define SkASSERT(cond)
Definition: SkAssert.h:116
static constexpr Kind kIRNodeKind
const Type & type() const
bool isVoid() const
Definition: SkSLType.h:496

Member Function Documentation

◆ clone()

std::unique_ptr< Expression > SkSL::EmptyExpression::clone ( Position  pos) const
inlineoverridevirtual

Implements SkSL::Expression.

Definition at line 34 of file SkSLEmptyExpression.h.

34 {
35 return std::make_unique<EmptyExpression>(pos, &this->type());
36 }

◆ description()

std::string SkSL::EmptyExpression::description ( OperatorPrecedence  ) const
inlineoverridevirtual

Implements SkSL::Expression.

Definition at line 38 of file SkSLEmptyExpression.h.

38 {
39 // There's no way in GLSL to directly emit a void-typed expression.
40 // `false` is used here as a placeholder expression; the value of a void-typed expression is
41 // never meaningful, so this should be a decent substitute.
42 return "false";
43 }

◆ Make()

static std::unique_ptr< Expression > SkSL::EmptyExpression::Make ( Position  pos,
const Context context 
)
inlinestatic

Definition at line 25 of file SkSLEmptyExpression.h.

25 {
26 return std::make_unique<EmptyExpression>(pos, context.fTypes.fVoid.get());
27 }

Member Data Documentation

◆ kIRNodeKind

constexpr Kind SkSL::EmptyExpression::kIRNodeKind = Kind::kEmpty
inlinestaticconstexpr

Definition at line 23 of file SkSLEmptyExpression.h.


The documentation for this class was generated from the following file: