Intel SPMD Program Compiler  1.9.1
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
DerefExpr Class Reference

Common base class that provides shared functionality for PtrDerefExpr and RefDerefExpr. More...

#include <expr.h>

Inheritance diagram for DerefExpr:
Inheritance graph
[legend]
Collaboration diagram for DerefExpr:
Collaboration graph
[legend]

Public Member Functions

 DerefExpr (Expr *e, SourcePos p, unsigned scid=DerefExprID)
 
llvm::Value * GetValue (FunctionEmitContext *ctx) const
 
llvm::Value * GetLValue (FunctionEmitContext *ctx) const
 
const TypeGetLValueType () const
 
SymbolGetBaseSymbol () const
 
ExprOptimize ()
 
- Public Member Functions inherited from Expr
 Expr (SourcePos p, unsigned scid)
 
virtual const TypeGetType () const =0
 
virtual llvm::Constant * GetConstant (const Type *type) const
 
virtual ExprTypeCheck ()=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

Exprexpr
 
- 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
}
 

Detailed Description

Common base class that provides shared functionality for PtrDerefExpr and RefDerefExpr.

Definition at line 560 of file expr.h.

Constructor & Destructor Documentation

DerefExpr::DerefExpr ( Expr e,
SourcePos  p,
unsigned  scid = DerefExprID 
)

Definition at line 7517 of file expr.cpp.

References expr.

Member Function Documentation

static bool DerefExpr::classof ( DerefExpr const *  )
inlinestatic

Definition at line 564 of file expr.h.

static bool DerefExpr::classof ( ASTNode const *  N)
inlinestatic
Symbol * DerefExpr::GetBaseSymbol ( ) const
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 7563 of file expr.cpp.

References expr, and Expr::GetBaseSymbol().

llvm::Value * DerefExpr::GetLValue ( FunctionEmitContext ctx) const
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 7547 of file expr.cpp.

References expr, and Expr::GetValue().

const Type * DerefExpr::GetLValueType ( ) const
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 7555 of file expr.cpp.

References expr, and Expr::GetType().

llvm::Value * DerefExpr::GetValue ( FunctionEmitContext ctx) const
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 7524 of file expr.cpp.

References expr, Expr::GetBaseSymbol(), FunctionEmitContext::GetFullMask(), Expr::GetType(), Expr::GetValue(), lMaskForSymbol(), FunctionEmitContext::LoadInst(), lVaryingStructHasUniformMember(), and FunctionEmitContext::SetDebugPos().

Expr * DerefExpr::Optimize ( )
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 7569 of file expr.cpp.

References expr.

Member Data Documentation

Expr* DerefExpr::expr

The documentation for this class was generated from the following files: