Intel SPMD Program Compiler  1.9.1
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
[legend]
Collaboration diagram for Stmt:
Collaboration graph
[legend]

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 ( SourcePos  p,
unsigned  scid 
)
inline

Definition at line 51 of file stmt.h.

Member Function Documentation

static bool Stmt::classof ( Stmt const *  )
inlinestatic

Definition at line 53 of file stmt.h.

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

Definition at line 54 of file stmt.h.

References ASTNode::getValueID(), and ASTNode::MaxExprID.

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

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 76 of file stmt.cpp.

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

Type checking should be performed by the node when this method is called. In the event of an error, a NULL value may be returned. As with ASTNode::Optimize(), the caller should store the returned pointer in place of the original ASTNode *.

Implements ASTNode.

Implemented in DeleteStmt, AssertStmt, PrintStmt, StmtList, LabeledStmt, GotoStmt, SwitchStmt, DefaultStmt, CaseStmt, ReturnStmt, UnmaskedStmt, ForeachUniqueStmt, ForeachActiveStmt, ForeachStmt, ContinueStmt, BreakStmt, ForStmt, DoStmt, IfStmt, DeclStmt, and ExprStmt.


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