Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Expression that represents taking a reference of a (non-reference) variable. More...
#include <expr.h>
Public Member Functions | |
ReferenceExpr (Expr *e, SourcePos p) | |
llvm::Value * | GetValue (FunctionEmitContext *ctx) const |
const Type * | GetType () const |
const Type * | GetLValueType () const |
Symbol * | GetBaseSymbol () const |
void | Print () const |
Expr * | TypeCheck () |
Expr * | Optimize () |
int | EstimateCost () const |
Public Member Functions inherited from Expr | |
Expr (SourcePos p, unsigned scid) | |
virtual llvm::Value * | GetLValue (FunctionEmitContext *ctx) 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 (ReferenceExpr 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 } |
Expression that represents taking a reference of a (non-reference) variable.
|
inlinestatic |
|
inlinestatic |
Definition at line 520 of file expr.h.
References ASTNode::EstimateCost(), Expr::GetBaseSymbol(), Expr::GetLValueType(), Expr::GetType(), Expr::GetValue(), ASTNode::getValueID(), Expr::Optimize(), Expr::Print(), ASTNode::ReferenceExprID, and Expr::TypeCheck().
|
virtual |
|
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 7171 of file expr.cpp.
References expr, and Expr::GetBaseSymbol().
|
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 7184 of file expr.cpp.
References expr, Expr::GetType(), and PointerType::GetUniform().
|
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 7140 of file expr.cpp.
References FunctionEmitContext::AllocaInst(), AssertPos, Globals::ctx, Module::errorCount, expr, g, Expr::GetLValue(), Expr::GetType(), Expr::GetValue(), Type::LLVMType(), m, FunctionEmitContext::SetDebugPos(), and FunctionEmitContext::StoreInst().
|
virtual |
|
virtual |
Prints the expression to standard output (used for debugging).
Implements Expr.
Definition at line 7209 of file expr.cpp.
References expr, GetType(), Expr::Print(), and SourcePos::Print().
|
virtual |
Expr* ReferenceExpr::expr |
Definition at line 531 of file expr.h.
Referenced by GetBaseSymbol(), GetLValueType(), GetType(), GetValue(), Optimize(), Print(), ReferenceExpr(), TypeCheck(), and WalkAST().