Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Expr abstract base class and expression implementations. More...
Go to the source code of this file.
Classes | |
class | Expr |
Expr is the abstract base class that defines the interface that all expression types must implement. More... | |
class | UnaryExpr |
Unary expression. More... | |
class | BinaryExpr |
Binary expression. More... | |
class | AssignExpr |
Assignment expression. More... | |
class | SelectExpr |
Selection expression, corresponding to "test ? a : b". More... | |
class | ExprList |
A list of expressions. More... | |
class | FunctionCallExpr |
Expression representing a function call. More... | |
class | IndexExpr |
Expression representing indexing into something with an integer offset. More... | |
class | MemberExpr |
Expression representing member selection ("foo.bar"). More... | |
class | ConstExpr |
Expression representing a compile-time constant value. More... | |
class | TypeCastExpr |
Expression representing a type cast of the given expression to a probably-different type. More... | |
class | ReferenceExpr |
Expression that represents taking a reference of a (non-reference) variable. More... | |
class | DerefExpr |
Common base class that provides shared functionality for PtrDerefExpr and RefDerefExpr. More... | |
class | PtrDerefExpr |
Expression that represents dereferencing a pointer to get its value. More... | |
class | RefDerefExpr |
Expression that represents dereferencing a reference to get its value. More... | |
class | AddressOfExpr |
class | SizeOfExpr |
class | SymbolExpr |
Expression representing a symbol reference in the program. More... | |
class | FunctionSymbolExpr |
Expression representing a function symbol in the program (generally used for a function call). More... | |
class | SyncExpr |
A sync statement in the program (waits for all launched tasks before proceeding). More... | |
class | NullPointerExpr |
An expression that represents a NULL pointer. More... | |
class | NewExpr |
Functions | |
bool | CanConvertTypes (const Type *fromType, const Type *toType, const char *errorMsgBase=NULL, SourcePos pos=SourcePos()) |
Expr * | TypeConvertExpr (Expr *expr, const Type *toType, const char *errorMsgBase) |
Expr * | MakeBinaryExpr (BinaryExpr::Op o, Expr *a, Expr *b, SourcePos p) |
void | InitSymbol (llvm::Value *lvalue, const Type *symType, Expr *initExpr, FunctionEmitContext *ctx, SourcePos pos) |
bool | PossiblyResolveFunctionOverloads (Expr *expr, const Type *type) |
bool CanConvertTypes | ( | const Type * | fromType, |
const Type * | toType, | ||
const char * | errorMsgBase = NULL , |
||
SourcePos | pos = SourcePos() |
||
) |
This function indicates whether it's legal to convert from fromType to toType. If the optional errorMsgBase and source position parameters are provided, then an error message is issued if the type conversion isn't possible.
Definition at line 544 of file expr.cpp.
References lDoTypeConv().
Referenced by FunctionSymbolExpr::computeOverloadCost(), and FunctionCallExpr::TypeCheck().
void InitSymbol | ( | llvm::Value * | ptr, |
const Type * | symType, | ||
Expr * | initExpr, | ||
FunctionEmitContext * | ctx, | ||
SourcePos | pos | ||
) |
Utility routine that emits code to initialize a symbol given an initializer expression.
lvalue | Memory location of storage for the symbol's data |
symName | Name of symbol (used in error messages) |
symType | Type of variable being initialized |
initExpr | Expression for the initializer |
ctx | FunctionEmitContext to use for generating instructions |
pos | Source file position of the variable being initialized |
Utility routine that emits code to initialize a symbol given an initializer expression.
ptr | Memory location of storage for the symbol's data |
symName | Name of symbol (used in error messages) |
symType | Type of variable being initialized |
initExpr | Expression for the initializer |
ctx | FunctionEmitContext to use for generating instructions |
pos | Source file position of the variable being initialized |
Definition at line 594 of file expr.cpp.
References FunctionEmitContext::AddElementOffset(), AssertPos, Globals::ctx, Type::Equal(), Error(), Module::errorCount, ExprList::exprs, FATAL, g, Type::GetAsUniformType(), FunctionEmitContext::GetCurrentBasicBlock(), CollectionType::GetElementCount(), FunctionEmitContext::GetElementPtrInst(), CollectionType::GetElementType(), Type::GetSOAWidth(), Expr::GetStorageConstant(), Variability::GetString(), Type::GetString(), ReferenceType::GetString(), Expr::GetType(), PointerType::GetUniform(), Expr::GetValue(), Type::GetVariability(), Target::getVectorWidth(), InitSymbol(), Type::IsBasicType(), Type::IsSOAType(), Type::IsVaryingType(), LLVMInt32(), Type::LLVMStorageType(), m, FunctionEmitContext::MemcpyInst(), Module::module, ASTNode::pos, PossiblyResolveFunctionOverloads(), Target::SizeOf(), FunctionEmitContext::StoreInst(), Globals::target, and TypeConvertExpr().
Referenced by DeclStmt::EmitCode(), NewExpr::GetValue(), and InitSymbol().
Expr* MakeBinaryExpr | ( | BinaryExpr::Op | o, |
Expr * | a, | ||
Expr * | b, | ||
SourcePos | p | ||
) |
Definition at line 1617 of file expr.cpp.
References BinaryExpr::BinaryExpr(), lCreateBinaryOperatorCall(), and BinaryExpr::op.
Definition at line 565 of file expr.cpp.
References Type::GetBaseType(), FunctionType::GetNumParameters(), FunctionType::GetParameterType(), ASTNode::pos, and FunctionSymbolExpr::ResolveOverloads().
Referenced by DeclStmt::EmitCode(), InitSymbol(), and AssignExpr::TypeCheck().
This function attempts to convert the given expression to the given type, returning a pointer to a new expression that is the result. If the required type conversion is illegal, it returns NULL and prints an error message using the provided string to indicate the context for which type conversion was being applied (e.g. "function call parameter").
Definition at line 548 of file expr.cpp.
References Debug(), Type::GetString(), Expr::GetType(), lDoTypeConv(), and ASTNode::pos.
Referenced by Module::AddGlobalVariable(), checkInit(), FunctionEmitContext::CurrentLanesReturned(), DeclStmt::EmitCode(), FunctionCallExpr::GetValue(), InitSymbol(), lEmitLogicalOp(), lGetExprListConstant(), IfStmt::TypeCheck(), UnaryExpr::TypeCheck(), DoStmt::TypeCheck(), BinaryExpr::TypeCheck(), ForStmt::TypeCheck(), AssignExpr::TypeCheck(), SelectExpr::TypeCheck(), ForeachStmt::TypeCheck(), FunctionCallExpr::TypeCheck(), IndexExpr::TypeCheck(), SwitchStmt::TypeCheck(), TypeCastExpr::TypeCheck(), AssertStmt::TypeCheck(), and NewExpr::TypeCheck().