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

A list of expressions. More...

#include <expr.h>

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

Public Member Functions

 ExprList (SourcePos p)
 
 ExprList (Expr *e, SourcePos p)
 
llvm::Value * GetValue (FunctionEmitContext *ctx) const
 
const TypeGetType () const
 
void Print () const
 
llvm::Constant * GetConstant (const Type *type) const
 
ExprListOptimize ()
 
ExprListTypeCheck ()
 
int EstimateCost () const
 
- Public Member Functions inherited from Expr
 Expr (SourcePos p, unsigned scid)
 
virtual llvm::Value * GetLValue (FunctionEmitContext *ctx) const
 
virtual const TypeGetLValueType () const
 
virtual SymbolGetBaseSymbol () const
 
- Public Member Functions inherited from ASTNode
 ASTNode (SourcePos p, unsigned scid)
 
virtual ~ASTNode ()
 
unsigned getValueID () const
 

Static Public Member Functions

static bool classof (ExprList 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

std::vector< Expr * > exprs
 
- 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

A list of expressions.

These are mostly used for representing curly-brace delimited initializers for initializers for complex types and for representing the arguments passed to a function call.

Definition at line 252 of file expr.h.

Constructor & Destructor Documentation

ExprList::ExprList ( SourcePos  p)
inline

Definition at line 254 of file expr.h.

ExprList::ExprList ( Expr e,
SourcePos  p 
)
inline

Definition at line 255 of file expr.h.

References exprs.

Member Function Documentation

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

Definition at line 257 of file expr.h.

static bool ExprList::classof ( ASTNode const *  N)
inlinestatic

Definition at line 258 of file expr.h.

References ASTNode::ExprListID, and ASTNode::getValueID().

int ExprList::EstimateCost ( ) const
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 4102 of file expr.cpp.

llvm::Constant * ExprList::GetConstant ( const Type type) const
virtual

If this is a constant expression that can be converted to a constant of the given type, this method should return the corresponding llvm::Constant value. Otherwise it should return NULL.

Reimplemented from Expr.

Definition at line 3978 of file expr.cpp.

References AssertPos, Globals::ctx, Type::Equal(), Error(), Module::errorCount, exprs, FATAL, g, Expr::GetConstant(), CollectionType::GetElementCount(), CollectionType::GetElementType(), VectorType::GetElementType(), Target::getNativeVectorWidth(), Type::GetString(), Type::IsUniformType(), Type::LLVMType(), m, Optimize(), Globals::target, TypeConvertExpr(), AtomicType::UniformDouble, AtomicType::UniformInt64, and AtomicType::UniformUInt64.

const Type * ExprList::GetType ( ) const
virtual

Returns the Type of the expression.

Implements Expr.

Definition at line 3959 of file expr.cpp.

References FATAL.

llvm::Value * ExprList::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 3952 of file expr.cpp.

References FATAL.

ExprList * ExprList::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 3966 of file expr.cpp.

Referenced by GetConstant().

void ExprList::Print ( ) const
virtual

Prints the expression to standard output (used for debugging).

Implements Expr.

Definition at line 4108 of file expr.cpp.

References exprs, and SourcePos::Print().

Referenced by FunctionCallExpr::Print().

ExprList * ExprList::TypeCheck ( )
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 3972 of file expr.cpp.

Member Data Documentation

std::vector<Expr *> ExprList::exprs

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