Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Assignment expression. More...
#include <expr.h>
Public Types | |
enum | Op { Assign, MulAssign, DivAssign, ModAssign, AddAssign, SubAssign, ShlAssign, ShrAssign, AndAssign, XorAssign, OrAssign } |
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 Member Functions | |
AssignExpr (Op o, Expr *a, Expr *b, SourcePos p) | |
llvm::Value * | GetValue (FunctionEmitContext *ctx) const |
const Type * | GetType () const |
void | Print () const |
Expr * | Optimize () |
Expr * | TypeCheck () |
int | EstimateCost () const |
Public Member Functions inherited from Expr | |
Expr (SourcePos p, unsigned scid) | |
virtual llvm::Value * | GetLValue (FunctionEmitContext *ctx) const |
virtual const Type * | GetLValueType () const |
virtual Symbol * | GetBaseSymbol () const |
virtual std::pair< llvm::Constant *, bool > | GetStorageConstant (const Type *type) const |
virtual std::pair< llvm::Constant *, bool > | GetConstant (const Type *type) const |
Public Member Functions inherited from ASTNode | |
ASTNode (SourcePos p, unsigned scid) | |
virtual | ~ASTNode () |
unsigned | getValueID () const |
Static Public Member Functions | |
static bool | classof (AssignExpr const *) |
static bool | classof (ASTNode const *N) |
Static Public Member Functions inherited from Expr | |
static bool | classof (Expr const *) |
static bool | classof (ASTNode const *N) |
Static Public Member Functions inherited from ASTNode | |
static bool | classof (ASTNode const *) |
Public Attributes | |
const Op | op |
Expr * | lvalue |
Expr * | rvalue |
Public Attributes inherited from ASTNode | |
SourcePos | pos |
enum AssignExpr::Op |
AssignExpr::AssignExpr | ( | AssignExpr::Op | o, |
Expr * | a, | ||
Expr * | b, | ||
SourcePos | p | ||
) |
|
inlinestatic |
|
inlinestatic |
Definition at line 207 of file expr.h.
References ASTNode::AssignExprID, ASTNode::EstimateCost(), Expr::GetType(), Expr::GetValue(), ASTNode::getValueID(), Expr::Optimize(), Expr::Print(), and Expr::TypeCheck().
|
virtual |
Estimate the execution cost of the node (not including the cost of the children. The value returned should be based on the COST_* enumerant values defined in ispc.h.
Implements ASTNode.
Definition at line 3059 of file expr.cpp.
References Assign, COST_ASSIGN, COST_COMPLEX_ARITH_OP, COST_SIMPLE_ARITH_LOGIC_OP, DivAssign, ModAssign, and op.
|
virtual |
Returns the Type of the expression.
Implements Expr.
Definition at line 2947 of file expr.cpp.
References Expr::GetType(), and lvalue.
Referenced by GetValue(), lCheckAllOffSafety(), and Print().
|
virtual |
This is the main method for Expr implementations to implement. It should call methods in the FunctionEmitContext to emit LLVM IR instructions to the current basic block in order to generate an llvm::Value that represents the expression's value.
Implements Expr.
Definition at line 2886 of file expr.cpp.
References AddAssign, AndAssign, AssertPos, Assign, DivAssign, Error(), Module::errorCount, FATAL, Expr::GetBaseSymbol(), Expr::GetLValue(), Expr::GetLValueType(), Expr::GetType(), GetType(), Expr::GetValue(), lEmitOpAssign(), lStoreAssignResult(), lvalue, m, ModAssign, MulAssign, op, OrAssign, ASTNode::pos, rvalue, FunctionEmitContext::SetDebugPos(), ShlAssign, ShrAssign, SubAssign, and XorAssign.
|
virtual |
|
virtual |
Prints the expression to standard output (used for debugging).
Implements Expr.
Definition at line 3068 of file expr.cpp.
References GetType(), lOpString(), lvalue, op, Expr::Print(), SourcePos::Print(), and rvalue.
|
virtual |
This method should perform type checking of the expression and return a pointer to the resulting expression. If an error is encountered, NULL should be returned.
Implements Expr.
Definition at line 2976 of file expr.cpp.
References AddAssign, AndAssign, AssertPos, Assign, Error(), Module::errorCount, g, Type::GetAsVaryingType(), Type::GetString(), StructType::GetString(), Expr::GetType(), Target::is32Bit(), Type::IsConstType(), Type::IsFloatType(), Type::IsVaryingType(), PointerType::IsVoidPointer(), lCheckForConstStructMember(), lOpString(), lvalue, m, op, OrAssign, ASTNode::pos, PossiblyResolveFunctionOverloads(), rvalue, ShlAssign, ShrAssign, SubAssign, Globals::target, TypeConvertExpr(), AtomicType::UniformInt32, AtomicType::UniformInt64, and XorAssign.
Expr* AssignExpr::lvalue |
Definition at line 218 of file expr.h.
Referenced by AssignExpr(), GetType(), GetValue(), Optimize(), Print(), TypeCheck(), and WalkAST().
const Op AssignExpr::op |
Definition at line 217 of file expr.h.
Referenced by EstimateCost(), GetValue(), Print(), and TypeCheck().
Expr * AssignExpr::rvalue |
Definition at line 218 of file expr.h.
Referenced by AssignExpr(), GetValue(), Optimize(), Print(), TypeCheck(), and WalkAST().