Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
#include <expr.h>
Public Member Functions | |
NewExpr (int typeQual, const Type *type, Expr *initializer, Expr *count, SourcePos tqPos, SourcePos p) | |
llvm::Value * | GetValue (FunctionEmitContext *ctx) const |
const Type * | GetType () const |
Expr * | TypeCheck () |
Expr * | Optimize () |
void | Print () const |
int | EstimateCost () const |
Public Member Functions inherited from Expr | |
Expr (SourcePos p, unsigned scid) | |
virtual llvm::Value * | GetLValue (FunctionEmitContext *ctx) const |
virtual const Type * | GetLValueType () const |
virtual Symbol * | GetBaseSymbol () 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 (NewExpr 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 | |
const Type * | allocType |
Expr * | countExpr |
Expr * | initExpr |
bool | isVarying |
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 } |
An expression representing a "new" expression, used for dynamically allocating memory.
NewExpr::NewExpr | ( | int | typeQual, |
const Type * | type, | ||
Expr * | initializer, | ||
Expr * | count, | ||
SourcePos | tqPos, | ||
SourcePos | p | ||
) |
Definition at line 8099 of file expr.cpp.
References allocType, countExpr, Error(), initExpr, isVarying, Type::ResolveUnboundVariability(), TYPEQUAL_UNIFORM, TYPEQUAL_VARYING, and Variability::Uniform.
|
inlinestatic |
|
inlinestatic |
Definition at line 750 of file expr.h.
References ASTNode::EstimateCost(), Expr::GetType(), Expr::GetValue(), ASTNode::getValueID(), ASTNode::NewExprID, Expr::Optimize(), Expr::Print(), and Expr::TypeCheck().
|
virtual |
|
virtual |
Returns the Type of the expression.
Implements Expr.
Definition at line 8240 of file expr.cpp.
References allocType, PointerType::GetUniform(), PointerType::GetVarying(), and isVarying.
Referenced by GetValue().
|
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 8125 of file expr.cpp.
References allocType, AssertPos, FunctionEmitContext::BinaryOperator(), FunctionEmitContext::BitCastInst(), FunctionEmitContext::BranchInst(), FunctionEmitContext::CallInst(), FunctionEmitContext::CmpInst(), countExpr, FunctionEmitContext::CreateBasicBlock(), Globals::ctx, Module::errorCount, FunctionEmitContext::ExtractInst(), Opt::force32BitAddressing, g, Type::GetAsUniformType(), FunctionEmitContext::GetCurrentBasicBlock(), GetType(), Expr::GetValue(), Target::getVectorWidth(), initExpr, InitSymbol(), LLVMTypes::Int64Type, FunctionEmitContext::IntToPtrInst(), Target::is32Bit(), isVarying, LLVMGetName(), LLVMInt32(), LLVMInt32Vector(), LLVMInt64(), LLVMInt64Vector(), Type::LLVMType(), m, Module::module, Globals::opt, FunctionEmitContext::SetCurrentBasicBlock(), FunctionEmitContext::SExtInst(), Target::SizeOf(), FunctionEmitContext::SmearUniform(), Globals::target, FunctionEmitContext::TruncInst(), and LLVMTypes::VoidPointerVectorType.
|
virtual |
|
virtual |
Prints the expression to standard output (used for debugging).
Implements Expr.
Definition at line 8300 of file expr.cpp.
References allocType, and Type::GetString().
|
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 8247 of file expr.cpp.
References allocType, AssertPos, countExpr, Error(), Module::errorCount, Opt::force32BitAddressing, g, Type::GetAsVaryingType(), Type::GetString(), Expr::GetType(), Target::is32Bit(), StructType::IsDefined(), isVarying, Type::IsVaryingType(), m, Globals::opt, Globals::target, TypeConvertExpr(), AtomicType::UniformUInt32, and AtomicType::UniformUInt64.
const Type* NewExpr::allocType |
Type of object to allocate storage for.
Definition at line 760 of file expr.h.
Referenced by GetType(), GetValue(), NewExpr(), Print(), and TypeCheck().
Expr* NewExpr::countExpr |
Expression giving the number of elements to allocate, when the "new Foo[expr]" form is used. This may be NULL, in which case a single element of the given type will be allocated.
Definition at line 764 of file expr.h.
Referenced by GetValue(), NewExpr(), TypeCheck(), and WalkAST().
Expr* NewExpr::initExpr |
Optional initializer expression used to initialize the allocated memory.
Definition at line 767 of file expr.h.
Referenced by GetValue(), NewExpr(), and WalkAST().
bool NewExpr::isVarying |
Indicates whether this is a "varying new" or "uniform new" (i.e. whether a separate allocation is performed per program instance, or whether a single allocation is performed for the entire gang of program instances.)
Definition at line 772 of file expr.h.
Referenced by GetType(), GetValue(), NewExpr(), and TypeCheck().