Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Interface class for statements in the ispc language. More...
#include <stmt.h>
Public Member Functions | |
Stmt (SourcePos p, unsigned scid) | |
virtual void | EmitCode (FunctionEmitContext *ctx) const =0 |
virtual void | Print (int indent) const =0 |
virtual Stmt * | Optimize () |
virtual Stmt * | TypeCheck ()=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 |
Interface class for statements in the ispc language.
This abstract base-class encapsulates methods that AST nodes for statements in the language must implement.
|
inlinestatic |
Definition at line 53 of file stmt.h.
References EmitCode(), ASTNode::getValueID(), ASTNode::MaxExprID, Optimize(), Print(), and TypeCheck().
|
pure virtual |
Emit LLVM IR for the statement, using the FunctionEmitContext to create the necessary instructions.
Implemented in DeleteStmt, AssertStmt, PrintStmt, StmtList, LabeledStmt, GotoStmt, SwitchStmt, DefaultStmt, CaseStmt, ReturnStmt, UnmaskedStmt, ForeachUniqueStmt, ForeachActiveStmt, ForeachStmt, ContinueStmt, BreakStmt, ForStmt, DoStmt, IfStmt, DeclStmt, and ExprStmt.
Referenced by classof(), ExprStmt::classof(), DeclStmt::classof(), IfStmt::classof(), DoStmt::classof(), ForStmt::classof(), BreakStmt::classof(), ContinueStmt::classof(), ForeachStmt::classof(), ForeachActiveStmt::classof(), ForeachUniqueStmt::classof(), UnmaskedStmt::classof(), ReturnStmt::classof(), CaseStmt::classof(), DefaultStmt::classof(), SwitchStmt::classof(), GotoStmt::classof(), LabeledStmt::classof(), StmtList::classof(), PrintStmt::classof(), AssertStmt::classof(), DeleteStmt::classof(), Function::emitCode(), DoStmt::EmitCode(), ForStmt::EmitCode(), ForeachStmt::EmitCode(), ForeachActiveStmt::EmitCode(), ForeachUniqueStmt::EmitCode(), UnmaskedStmt::EmitCode(), CaseStmt::EmitCode(), DefaultStmt::EmitCode(), SwitchStmt::EmitCode(), LabeledStmt::EmitCode(), and lEmitIfStatements().
|
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 64 of file stmt.cpp.
Referenced by classof(), DeclStmt::classof(), GotoStmt::classof(), and LabeledStmt::classof().
|
pure virtual |
Print a representation of the statement (and any children AST nodes) to standard output. This method is used for debuggins.
Implemented in DeleteStmt, AssertStmt, PrintStmt, StmtList, LabeledStmt, GotoStmt, SwitchStmt, DefaultStmt, CaseStmt, ReturnStmt, UnmaskedStmt, ForeachUniqueStmt, ForeachActiveStmt, ForeachStmt, ContinueStmt, BreakStmt, ForStmt, DoStmt, IfStmt, DeclStmt, and ExprStmt.
Referenced by classof(), ExprStmt::classof(), DeclStmt::classof(), IfStmt::classof(), DoStmt::classof(), ForStmt::classof(), BreakStmt::classof(), ContinueStmt::classof(), ForeachStmt::classof(), ForeachActiveStmt::classof(), ForeachUniqueStmt::classof(), UnmaskedStmt::classof(), ReturnStmt::classof(), CaseStmt::classof(), DefaultStmt::classof(), SwitchStmt::classof(), GotoStmt::classof(), LabeledStmt::classof(), StmtList::classof(), PrintStmt::classof(), AssertStmt::classof(), DeleteStmt::classof(), Function::Function(), IfStmt::Print(), DoStmt::Print(), ForStmt::Print(), ForeachStmt::Print(), ForeachActiveStmt::Print(), ForeachUniqueStmt::Print(), UnmaskedStmt::Print(), CaseStmt::Print(), DefaultStmt::Print(), SwitchStmt::Print(), and LabeledStmt::Print().
|
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.
Referenced by classof(), ExprStmt::classof(), DeclStmt::classof(), IfStmt::classof(), DoStmt::classof(), ForStmt::classof(), BreakStmt::classof(), ContinueStmt::classof(), ForeachStmt::classof(), ForeachActiveStmt::classof(), ForeachUniqueStmt::classof(), UnmaskedStmt::classof(), ReturnStmt::classof(), CaseStmt::classof(), DefaultStmt::classof(), SwitchStmt::classof(), GotoStmt::classof(), LabeledStmt::classof(), StmtList::classof(), PrintStmt::classof(), AssertStmt::classof(), and DeleteStmt::classof().