Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Common base class that provides shared functionality for PtrDerefExpr and RefDerefExpr. More...
#include <expr.h>
Public Member Functions | |
DerefExpr (Expr *e, SourcePos p, unsigned scid=DerefExprID) | |
llvm::Value * | GetValue (FunctionEmitContext *ctx) const |
llvm::Value * | GetLValue (FunctionEmitContext *ctx) const |
const Type * | GetLValueType () const |
Symbol * | GetBaseSymbol () const |
Expr * | Optimize () |
Public Member Functions inherited from Expr | |
Expr (SourcePos p, unsigned scid) | |
virtual const Type * | GetType () const =0 |
virtual std::pair< llvm::Constant *, bool > | GetStorageConstant (const Type *type) const |
virtual std::pair< llvm::Constant *, bool > | GetConstant (const Type *type) const |
virtual Expr * | TypeCheck ()=0 |
virtual void | Print () const =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 (DerefExpr 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 | |
Expr * | expr |
Public Attributes inherited from ASTNode | |
SourcePos | pos |
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 } |
Common base class that provides shared functionality for PtrDerefExpr and RefDerefExpr.
DerefExpr::DerefExpr | ( | Expr * | e, |
SourcePos | p, | ||
unsigned | scid = DerefExprID |
||
) |
|
inlinestatic |
|
inlinestatic |
Definition at line 541 of file expr.h.
References ASTNode::DerefExprID, Expr::GetBaseSymbol(), Expr::GetLValue(), Expr::GetLValueType(), Expr::GetValue(), ASTNode::getValueID(), Expr::Optimize(), ASTNode::PtrDerefExprID, and ASTNode::RefDerefExprID.
|
virtual |
For expressions that have values based on a symbol (e.g. regular symbol references, array indexing, etc.), this returns a pointer to that symbol.
Reimplemented from Expr.
Definition at line 7259 of file expr.cpp.
References expr, and Expr::GetBaseSymbol().
|
virtual |
For expressions that can provide an lvalue (e.g. array indexing), this function should emit IR that computes the expression's lvalue and returns the corresponding llvm::Value. Expressions that can't provide an lvalue should leave this unimplemented; the default implementation returns NULL.
Reimplemented from Expr.
Definition at line 7247 of file expr.cpp.
References expr, and Expr::GetValue().
|
virtual |
Returns the type of the value returned by GetLValueType(); this should be a pointer type of some sort (uniform or varying).
Reimplemented from Expr.
Definition at line 7253 of file expr.cpp.
References expr, and Expr::GetType().
|
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 7224 of file expr.cpp.
References expr, Expr::GetBaseSymbol(), FunctionEmitContext::GetFullMask(), Expr::GetType(), Expr::GetValue(), lAddVaryingOffsetsIfNeeded(), lMaskForSymbol(), FunctionEmitContext::LoadInst(), lVaryingStructHasUniformMember(), and FunctionEmitContext::SetDebugPos().
Referenced by lEmitPrePostIncDec().
|
virtual |
Expr* DerefExpr::expr |
Definition at line 552 of file expr.h.
Referenced by DerefExpr(), PtrDerefExpr::EstimateCost(), RefDerefExpr::EstimateCost(), GetBaseSymbol(), GetLValue(), GetLValueType(), PtrDerefExpr::GetType(), RefDerefExpr::GetType(), GetValue(), Optimize(), PtrDerefExpr::Print(), RefDerefExpr::Print(), PtrDerefExpr::TypeCheck(), RefDerefExpr::TypeCheck(), and WalkAST().