Intel SPMD Program Compiler  1.3.0
Public Member Functions | Public Attributes
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]

List of all members.

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 Attributes

std::vector< Expr * > exprs

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 227 of file expr.h.


Constructor & Destructor Documentation

ExprList::ExprList ( SourcePos  p) [inline]

Definition at line 229 of file expr.h.

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

Definition at line 230 of file expr.h.

References exprs.


Member Function Documentation

int ExprList::EstimateCost ( ) const

Definition at line 3794 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 3685 of file expr.cpp.

References AssertPos, Globals::ctx, Error(), Module::errorCount, exprs, FATAL, g, Expr::GetConstant(), CollectionType::GetElementCount(), CollectionType::GetElementType(), Type::GetString(), Type::IsUniformType(), Type::LLVMType(), m, Target::nativeVectorWidth, NULL, Optimize(), Globals::target, and TypeConvertExpr().

const Type * ExprList::GetType ( ) const [virtual]

Returns the Type of the expression.

Implements Expr.

Definition at line 3666 of file expr.cpp.

References FATAL, and NULL.

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 3659 of file expr.cpp.

References FATAL, and NULL.

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 3673 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 3800 of file expr.cpp.

References exprs, NULL, 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 3679 of file expr.cpp.


Member Data Documentation

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

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