Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Unary expression. More...
#include <expr.h>
Public Types | |
enum | Op { PreInc, PreDec, PostInc, PostDec, Negate, LogicalNot, BitNot } |
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 | |
UnaryExpr (Op op, Expr *expr, SourcePos pos) | |
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 (UnaryExpr 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 * | expr |
Public Attributes inherited from ASTNode | |
SourcePos | pos |
enum UnaryExpr::Op |
|
inlinestatic |
|
inlinestatic |
Definition at line 126 of file expr.h.
References ASTNode::EstimateCost(), Expr::GetType(), Expr::GetValue(), ASTNode::getValueID(), Expr::Optimize(), Expr::Print(), Expr::TypeCheck(), and ASTNode::UnaryExprID.
|
virtual |
|
virtual |
|
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 1029 of file expr.cpp.
References BitNot, expr, FATAL, Expr::GetValue(), lEmitNegate(), lEmitPrePostIncDec(), LLVMGetName(), LogicalNot, Negate, FunctionEmitContext::NotOperator(), op, PostDec, PostInc, PreDec, PreInc, and FunctionEmitContext::SetDebugPos().
|
virtual |
This method should perform early optimizations of the expression (constant folding, etc.) and return a pointer to the resulting expression. If an error is encountered during optimization, NULL should be returned.
Implements Expr.
Definition at line 1100 of file expr.cpp.
References AssertPos, BitNot, Type::EqualIgnoringConst(), expr, FATAL, ConstExpr::GetType(), ConstExpr::GetValues(), ISPC_MAX_NVEC, LogicalNot, Negate, op, ASTNode::pos, PostDec, PostInc, PreDec, PreInc, AtomicType::UniformBool, AtomicType::UniformInt16, AtomicType::UniformInt32, AtomicType::UniformInt64, AtomicType::UniformInt8, AtomicType::UniformUInt16, AtomicType::UniformUInt32, AtomicType::UniformUInt64, AtomicType::UniformUInt8, AtomicType::VaryingBool, AtomicType::VaryingInt16, AtomicType::VaryingInt32, AtomicType::VaryingInt64, AtomicType::VaryingInt8, AtomicType::VaryingUInt16, AtomicType::VaryingUInt32, AtomicType::VaryingUInt64, and AtomicType::VaryingUInt8.
|
virtual |
Prints the expression to standard output (used for debugging).
Implements Expr.
Definition at line 1279 of file expr.cpp.
References BitNot, expr, GetType(), LogicalNot, Negate, op, PostDec, PostInc, PreDec, PreInc, Expr::Print(), and SourcePos::Print().
|
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 1197 of file expr.cpp.
References BitNot, Error(), expr, PointerType::GetBaseType(), Type::GetString(), Expr::GetType(), Type::IsConstType(), Type::IsIntType(), Type::IsNumericType(), Type::IsSOAType(), PointerType::IsVoidPointer(), lMatchingBoolType(), LogicalNot, Negate, op, ASTNode::pos, PostDec, PostInc, PreDec, PreInc, and TypeConvertExpr().
Expr* UnaryExpr::expr |
Definition at line 136 of file expr.h.
Referenced by EstimateCost(), GetType(), GetValue(), Optimize(), Print(), TypeCheck(), UnaryExpr(), and WalkAST().
const Op UnaryExpr::op |
Definition at line 135 of file expr.h.
Referenced by GetType(), GetValue(), Optimize(), Print(), and TypeCheck().