Intel SPMD Program Compiler  1.12.0
Public Member Functions | Static Public Member Functions | List of all members
Stmt Class Referenceabstract

Interface class for statements in the ispc language. More...

#include <stmt.h>

Inheritance diagram for Stmt:
Inheritance graph
Collaboration diagram for Stmt:
Collaboration graph

Public Member Functions

 Stmt (SourcePos p, unsigned scid)
virtual void EmitCode (FunctionEmitContext *ctx) const =0
virtual void Print (int indent) const =0
virtual StmtOptimize ()
virtual StmtTypeCheck ()=0
- Public Member Functions inherited from ASTNode
 ASTNode (SourcePos p, unsigned scid)
virtual ~ASTNode ()
virtual int EstimateCost () const =0
unsigned getValueID () const

Static Public Member Functions

static bool classof (Stmt const *)
static bool classof (ASTNode const *N)
- Static Public Member Functions inherited from ASTNode
static bool classof (ASTNode const *)

Additional Inherited Members

- Public Types inherited from ASTNode
enum  ASTNodeTy {
  AddressOfExprID, AssignExprID, BinaryExprID, ConstExprID,
  DerefExprID, PtrDerefExprID, RefDerefExprID, ExprListID,
  FunctionCallExprID, FunctionSymbolExprID, IndexExprID, StructMemberExprID,
  VectorMemberExprID, NewExprID, NullPointerExprID, ReferenceExprID,
  SelectExprID, SizeOfExprID, SymbolExprID, SyncExprID,
  TypeCastExprID, UnaryExprID, MaxExprID, AssertStmtID,
  BreakStmtID, CaseStmtID, ContinueStmtID, DeclStmtID,
  DefaultStmtID, DeleteStmtID, DoStmtID, ExprStmtID,
  ForeachActiveStmtID, ForeachStmtID, ForeachUniqueStmtID, ForStmtID,
  GotoStmtID, IfStmtID, LabeledStmtID, PrintStmtID,
  ReturnStmtID, StmtListID, SwitchStmtID, UnmaskedStmtID
- Public Attributes inherited from ASTNode
SourcePos pos

Detailed Description

Interface class for statements in the ispc language.

This abstract base-class encapsulates methods that AST nodes for statements in the language must implement.

Definition at line 49 of file stmt.h.

Constructor & Destructor Documentation

◆ Stmt()

Stmt::Stmt ( SourcePos  p,
unsigned  scid 

Definition at line 51 of file stmt.h.

Member Function Documentation

◆ classof() [1/2]

static bool Stmt::classof ( Stmt const *  )

Definition at line 53 of file stmt.h.

◆ classof() [2/2]

static bool Stmt::classof ( ASTNode const *  N)

Definition at line 54 of file stmt.h.

References EmitCode(), ASTNode::getValueID(), ASTNode::MaxExprID, Optimize(), Print(), and TypeCheck().

◆ EmitCode()

virtual void Stmt::EmitCode ( FunctionEmitContext ctx) const
pure virtual

◆ Optimize()

Stmt * Stmt::Optimize ( )

The Optimize() method should perform any appropriate early-stage optimizations on the node (e.g. constant folding). This method will be called after the node's children have already been optimized, and the caller will store the returned ASTNode * in place of the original node. This method should return NULL if an error is encountered during optimization.

Implements ASTNode.

Reimplemented in LabeledStmt, GotoStmt, and DeclStmt.

Definition at line 75 of file stmt.cpp.

Referenced by classof(), DeclStmt::classof(), GotoStmt::classof(), and LabeledStmt::classof().

◆ Print()

virtual void Stmt::Print ( int  indent) const
pure virtual

◆ TypeCheck()

virtual Stmt* Stmt::TypeCheck ( )
pure virtual

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