|
Intel SPMD Program Compiler
1.3.0
|
Interface class that defines the type abstraction. More...
#include <type.h>


Public Member Functions | |
| virtual bool | IsBoolType () const =0 |
| virtual bool | IsFloatType () const =0 |
| virtual bool | IsIntType () const =0 |
| virtual bool | IsUnsignedType () const =0 |
| bool | IsPointerType () const |
| bool | IsArrayType () const |
| bool | IsReferenceType () const |
| bool | IsVoidType () const |
| virtual bool | IsConstType () const =0 |
| bool | IsNumericType () const |
| virtual Variability | GetVariability () const =0 |
| bool | IsUniformType () const |
| bool | IsVaryingType () const |
| bool | IsSOAType () const |
| int | GetSOAWidth () const |
| bool | HasUnboundVariability () const |
| virtual const Type * | ResolveUnboundVariability (Variability v) const =0 |
| virtual const Type * | GetAsUniformType () const =0 |
| virtual const Type * | GetAsVaryingType () const =0 |
| virtual const Type * | GetAsUnboundVariabilityType () const =0 |
| virtual const Type * | GetAsSOAType (int width) const =0 |
| virtual const Type * | GetAsUnsignedType () const |
| virtual const Type * | GetBaseType () const =0 |
| virtual const Type * | GetReferenceTarget () const |
| virtual const Type * | GetAsConstType () const =0 |
| virtual const Type * | GetAsNonConstType () const =0 |
| virtual std::string | GetString () const =0 |
| virtual std::string | Mangle () const =0 |
| virtual std::string | GetCDeclaration (const std::string &name) const =0 |
| virtual llvm::Type * | LLVMType (llvm::LLVMContext *ctx) const =0 |
| virtual llvm::DIType | GetDIType (llvm::DIDescriptor scope) const =0 |
Static Public Member Functions | |
| static bool | Equal (const Type *a, const Type *b) |
| static bool | EqualIgnoringConst (const Type *a, const Type *b) |
| static const Type * | MoreGeneralType (const Type *type0, const Type *type1, SourcePos pos, const char *reason, bool forceVarying=false, int vecSize=0) |
| static bool | IsBasicType (const Type *type) |
Public Attributes | |
| const TypeId | typeId |
Protected Member Functions | |
| Type (TypeId id) | |
Interface class that defines the type abstraction.
Abstract base class that defines the interface that must be implemented for all types in the language.
Checks two types for equality. Returns true if they are exactly the same, false otherwise.
Definition at line 3303 of file type.cpp.
References lCheckTypeEquality().
Referenced by Module::AddFunctionDeclaration(), Module::AddGlobalVariable(), ArrayType::ArrayType(), FunctionSymbolExpr::computeOverloadCost(), ConstExpr::ConstExpr(), FunctionEmitContext::CurrentLanesReturned(), ForeachActiveStmt::EmitCode(), FunctionEmitContext::FunctionEmitContext(), ConstExpr::GetConstant(), FunctionSymbolExpr::GetConstant(), GetStructTypesNamesPositions(), StructMemberExpr::GetType(), SelectExpr::GetValue(), FunctionCallExpr::GetValue(), TypeCastExpr::GetValue(), Declaration::GetVariableDeclarations(), VectorType::getVectorMemoryCount(), Declarator::InitFromType(), InitSymbol(), lAddTypeIfNew(), lApplyTypeQualifiers(), lCreateISPCSymbol(), lDoTypeConv(), lEmitBinaryPointerArith(), lEncodeType(), lIsMatchToNonConstReference(), lIsMatchToNonConstReferenceUnifToVarying(), FunctionType::LLVMFunctionType(), SymbolTable::LookupFunction(), lProcessPrintArg(), FunctionEmitContext::maskedStore(), MoreGeneralType(), DeclStmt::Optimize(), UnaryExpr::Optimize(), BinaryExpr::Optimize(), SelectExpr::Optimize(), FunctionEmitContext::ReturnInst(), FunctionCallExpr::TypeCheck(), IndexExpr::TypeCheck(), TypeCastExpr::TypeCheck(), and PtrDerefExpr::TypeCheck().
Checks two types for equality. Returns true if they are exactly the same (ignoring const-ness of the type), false otherwise.
Definition at line 3309 of file type.cpp.
References lCheckTypeEquality().
Referenced by TypeCastExpr::GetValue(), PointerType::IsVoidPointer(), lDoTypeConv(), lEmitBinaryArith(), lEmitStructDecl(), lIsMatchWithUniformToVarying(), MoreGeneralType(), UnaryExpr::Optimize(), BinaryExpr::Optimize(), FunctionEmitContext::storeUniformToSOA(), IndexExpr::TypeCheck(), and SwitchStmt::TypeCheck().
| virtual const Type* Type::GetAsConstType | ( | ) | const [pure virtual] |
Get a const version of this type. If it's already const, then the old Type pointer is returned.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by ConstExpr::ConstExpr(), ArrayType::GetAsConstType(), ReferenceType::GetAsConstType(), StructType::GetElementType(), TypeCastExpr::GetValue(), lApplyTypeQualifiers(), lDoTypeConv(), and SwitchStmt::TypeCheck().
| virtual const Type* Type::GetAsNonConstType | ( | ) | const [pure virtual] |
Get a non-const version of this type. If it's already not const, then the old Type pointer is returned.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by FunctionSymbolExpr::computeOverloadCost(), emitOffloadParamStruct(), ArrayType::GetAsNonConstType(), ReferenceType::GetAsNonConstType(), ReferenceType::GetCDeclaration(), ConstExpr::GetConstant(), SelectExpr::GetValue(), lAddTypeIfNew(), lDeconstifyType(), lDoTypeConv(), lEmitStructDecl(), lProcessPrintArg(), MoreGeneralType(), UnaryExpr::Optimize(), BinaryExpr::Optimize(), SelectExpr::Optimize(), and Module::writeDevStub().
| virtual const Type* Type::GetAsSOAType | ( | int | width | ) | const [pure virtual] |
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by ArrayType::GetAsSOAType().
| virtual const Type* Type::GetAsUnboundVariabilityType | ( | ) | const [pure virtual] |
Get an instance of the type with unbound variability.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by ArrayType::GetAsUnboundVariabilityType(), ReferenceType::GetAsUnboundVariabilityType(), lApplyTypeQualifiers(), and lDeclareSizeAndPtrIntTypes().
| virtual const Type* Type::GetAsUniformType | ( | ) | const [pure virtual] |
Return a "uniform" instance of this type. If the type is already uniform, its "this" pointer will be returned.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by FunctionEmitContext::addVaryingOffsetsIfNeeded(), ArrayType::GetAsUniformType(), ReferenceType::GetAsUniformType(), ArrayType::GetCDeclaration(), TypeCastExpr::GetConstant(), IndexExpr::GetType(), StructMemberExpr::GetType(), VectorMemberExpr::GetType(), NewExpr::GetValue(), InitSymbol(), PointerType::IsVoidPointer(), lAddVaryingOffsetsIfNeeded(), lApplyTypeQualifiers(), lDoTypeConv(), lFinalSliceOffset(), FunctionEmitContext::loadUniformFromSOA(), lProcessPrintArg(), UnaryExpr::Optimize(), FunctionEmitContext::storeUniformToSOA(), IndexExpr::TypeCheck(), SwitchStmt::TypeCheck(), and TypeCastExpr::TypeCheck().
| const Type * Type::GetAsUnsignedType | ( | ) | const [virtual] |
If this is a signed integer type, return the unsigned version of the type. Otherwise, return the original type.
Reimplemented in ArrayType, and AtomicType.
Definition at line 2992 of file type.cpp.
References NULL.
Referenced by ArrayType::GetAsUnsignedType(), lApplyTypeQualifiers(), and lDeclareSizeAndPtrIntTypes().
| virtual const Type* Type::GetAsVaryingType | ( | ) | const [pure virtual] |
Return a "varying" instance of this type. If the type is already varying, its "this" pointer will be returned.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by FunctionEmitContext::gather(), ArrayType::GetAsVaryingType(), ReferenceType::GetAsVaryingType(), BinaryExpr::GetType(), IndexExpr::GetType(), PtrDerefExpr::GetType(), StructMemberExpr::GetType(), VectorMemberExpr::GetType(), TypeCastExpr::GetValue(), lApplyTypeQualifiers(), lIsMatchToNonConstReferenceUnifToVarying(), lIsMatchWithUniformToVarying(), lUniformValueToVarying(), lVaryingStructHasUniformMember(), MoreGeneralType(), FunctionEmitContext::scatter(), BinaryExpr::TypeCheck(), AssignExpr::TypeCheck(), and NewExpr::TypeCheck().
| virtual const Type* Type::GetBaseType | ( | ) | const [pure virtual] |
Returns the basic root type of the given type. For example, for an array or short-vector, this returns the element type. For a struct or atomic type, it returns itself.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by FunctionEmitContext::addVaryingOffsetsIfNeeded(), FunctionEmitContext::applyVaryingGEP(), FunctionCallExpr::EstimateCost(), ReferenceType::GetBaseType(), IndexExpr::GetLValueType(), VectorMemberExpr::GetLValueType(), PtrDerefExpr::GetType(), StructMemberExpr::GetType(), SelectExpr::GetValue(), TypeCastExpr::GetValue(), lCheckForVaryingParameter(), lCheckTypeEquality(), lDoTypeConv(), lFinalSliceOffset(), lGetExportedTypes(), lGetFunctionType(), lLLVMConstantValue(), FunctionEmitContext::maskedStore(), PossiblyResolveFunctionOverloads(), AssignExpr::TypeCheck(), and FunctionCallExpr::TypeCheck().
| virtual std::string Type::GetCDeclaration | ( | const std::string & | name | ) | const [pure virtual] |
Returns a string that is the declaration of the same type in C syntax.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by emitOffloadParamStruct(), PointerType::GetCDeclaration(), ArrayType::GetCDeclaration(), ReferenceType::GetCDeclaration(), FunctionType::GetCDeclaration(), lEmitStructDecl(), lEmitVectorTypedefs(), and Module::writeDevStub().
| virtual llvm::DIType Type::GetDIType | ( | llvm::DIDescriptor | scope | ) | const [pure virtual] |
Returns the DIType (LLVM's debugging information structure), corresponding to this type.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by Module::AddGlobalVariable(), FunctionEmitContext::EmitFunctionParameterDebugInfo(), FunctionEmitContext::EmitVariableDebugInfo(), PointerType::GetDIType(), ArrayType::GetDIType(), StructType::GetDIType(), ReferenceType::GetDIType(), FunctionType::GetDIType(), lDefineConstantInt(), and lDefineProgramIndex().
| const Type * Type::GetReferenceTarget | ( | ) | const [virtual] |
If this is a reference type, returns the type it is referring to. For all other types, just returns its own type.
Reimplemented in ReferenceType.
Definition at line 2985 of file type.cpp.
Referenced by FunctionEmitContext::AddElementOffset(), MemberExpr::create(), FunctionEmitContext::GetElementPtrInst(), IndexExpr::GetLValue(), IndexExpr::GetLValueType(), SymbolExpr::GetLValueType(), VectorMemberExpr::GetLValueType(), IndexExpr::GetType(), RefDerefExpr::GetType(), AddressOfExpr::GetType(), TypeCastExpr::GetValue(), lCheckTypeEquality(), lDoTypeConv(), lEmitPrePostIncDec(), lGetExportedTypes(), lIsMatchToNonConstReference(), lIsMatchToNonConstReferenceUnifToVarying(), FunctionEmitContext::LoadInst(), MoreGeneralType(), FunctionEmitContext::StoreInst(), IndexExpr::TypeCheck(), and VectorMemberExpr::VectorMemberExpr().
| int Type::GetSOAWidth | ( | ) | const [inline] |
Returns the structure of arrays width for SOA types. This method returns zero for types with non-SOA variability.
Definition at line 155 of file type.h.
References GetVariability(), and Variability::soaWidth.
Referenced by EnumType::GetAsSOAType(), PointerType::GetAsSOAType(), StructType::GetAsSOAType(), ArrayType::GetCDeclaration(), FunctionEmitContext::GetElementPtrInst(), GetStructTypesNamesPositions(), InitSymbol(), lCheckIndicesVersusBounds(), lConvertPointerConstant(), lDoTypeConv(), lEmitBinaryPointerArith(), lEmitStructDecl(), and BinaryExpr::TypeCheck().
| virtual std::string Type::GetString | ( | ) | const [pure virtual] |
Returns a text representation of the type (for example, for use in warning and error messages).
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by StructType::checkIfCanBeSOA(), MemberExpr::create(), FunctionEmitContext::CurrentLanesReturned(), ReturnStmt::EmitCode(), emitOffloadParamStruct(), DeclSpecs::GetBaseType(), FunctionType::GetCDeclaration(), ExprList::GetConstant(), ConstExpr::GetConstant(), FunctionSymbolExpr::GetConstant(), FunctionType::GetReturnTypeString(), PointerType::GetString(), ArrayType::GetString(), ReferenceType::GetString(), FunctionCallExpr::GetValue(), Declarator::InitFromDeclSpecs(), Declarator::InitFromType(), InitSymbol(), lApplyTypeQualifiers(), lCheckForConstStructMember(), lDoTypeConv(), lProcessPrintArg(), lVaryingStructHasUniformMember(), lVectorConvert(), MoreGeneralType(), DeclSpecs::Print(), SymbolTable::Print(), ForeachActiveStmt::Print(), ForeachUniqueStmt::Print(), SizeOfExpr::Print(), NewExpr::Print(), UnaryExpr::TypeCheck(), DoStmt::TypeCheck(), BinaryExpr::TypeCheck(), ForStmt::TypeCheck(), AssignExpr::TypeCheck(), SelectExpr::TypeCheck(), FunctionCallExpr::TypeCheck(), IndexExpr::TypeCheck(), ForeachUniqueStmt::TypeCheck(), AssertStmt::TypeCheck(), DeleteStmt::TypeCheck(), TypeCastExpr::TypeCheck(), PtrDerefExpr::TypeCheck(), SizeOfExpr::TypeCheck(), NewExpr::TypeCheck(), TypeConvertExpr(), and Module::writeDevStub().
| virtual Variability Type::GetVariability | ( | ) | const [pure virtual] |
Returns the variability of the type.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by GetSOAWidth(), ArrayType::GetVariability(), ReferenceType::GetVariability(), HasUnboundVariability(), InitSymbol(), IsSOAType(), IsUniformType(), IsVaryingType(), lCheckTypeEquality(), lDoTypeConv(), and lIsMatchWithTypeConvSameVariability().
| bool Type::HasUnboundVariability | ( | ) | const [inline] |
Returns true if the underlying type's uniform/varying-ness is unbound.
Definition at line 159 of file type.h.
References GetVariability(), and Variability::Unbound.
Referenced by StructType::checkIfCanBeSOA(), EnumType::GetAsUnboundVariabilityType(), StructType::GetAsUnboundVariabilityType(), ReferenceType::GetAsUnboundVariabilityType(), TypeCastExpr::GetType(), and TypeCastExpr::TypeCheck().
| bool Type::IsArrayType | ( | ) | const |
Returns true if the underlying type is a array type
Definition at line 210 of file type.cpp.
References NULL.
Referenced by emitOffloadParamStruct(), Module::writeDevStub(), and Module::writeHostStub().
| bool Type::IsBasicType | ( | const Type * | type | ) | [static] |
Returns true if the given type is an atomic, enum, or pointer type (i.e. not an aggregation of multiple instances of a type or types.)
Definition at line 3193 of file type.cpp.
References NULL.
Referenced by FunctionEmitContext::addVaryingOffsetsIfNeeded(), InitSymbol(), lAddVaryingOffsetsIfNeeded(), lFinalSliceOffset(), FunctionEmitContext::maskedStore(), FunctionEmitContext::scatter(), FunctionEmitContext::storeUniformToSOA(), and ForeachUniqueStmt::TypeCheck().
| virtual bool Type::IsBoolType | ( | ) | const [pure virtual] |
Returns true if the underlying type is boolean. In other words, this is true for individual bools and for short-vectors with underlying bool type, but not for arrays of bools.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by TypeCastExpr::GetValue(), ReferenceType::IsBoolType(), lDoTypeConv(), BinaryExpr::TypeCheck(), DoStmt::TypeCheck(), ForStmt::TypeCheck(), and AssertStmt::TypeCheck().
| virtual bool Type::IsConstType | ( | ) | const [pure virtual] |
Returns true if this type is 'const'-qualified.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by Module::AddGlobalVariable(), DeclStmt::EmitCode(), emitOffloadParamStruct(), ArrayType::IsConstType(), ReferenceType::IsConstType(), lCheckForConstStructMember(), lCheckTypeEquality(), lDoTypeConv(), lIsMatchToNonConstReference(), lIsMatchToNonConstReferenceUnifToVarying(), DeclStmt::Optimize(), UnaryExpr::TypeCheck(), AssignExpr::TypeCheck(), and Module::writeDevStub().
| virtual bool Type::IsFloatType | ( | ) | const [pure virtual] |
Returns true if the underlying type is float or double. In other words, this is true for individual floats/doubles and for short-vectors of them, but not for arrays of them.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by ReferenceType::IsFloatType(), IsNumericType(), lEmitBinaryArith(), lEmitBinaryCmp(), lEmitNegate(), lEmitPrePostIncDec(), BinaryExpr::TypeCheck(), and AssignExpr::TypeCheck().
| virtual bool Type::IsIntType | ( | ) | const [pure virtual] |
Returns true if the underlying type is an integer type. In other words, this is true for individual integers and for short-vectors of integer types, but not for arrays of integer types.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by ReferenceType::IsIntType(), IsNumericType(), lApplyTypeQualifiers(), lEmitNegate(), lIsAllIntZeros(), UnaryExpr::TypeCheck(), and BinaryExpr::TypeCheck().
| bool Type::IsNumericType | ( | ) | const [inline] |
Returns true if the underlying type is a float or integer type.
Definition at line 134 of file type.h.
References IsFloatType(), and IsIntType().
Referenced by UnaryExpr::TypeCheck(), BinaryExpr::TypeCheck(), DoStmt::TypeCheck(), ForStmt::TypeCheck(), and AssertStmt::TypeCheck().
| bool Type::IsPointerType | ( | ) | const |
Returns true if the underlying type is either a pointer type
Definition at line 204 of file type.cpp.
References NULL.
Referenced by emitOffloadParamStruct(), Module::writeDevStub(), and Module::writeHostStub().
| bool Type::IsReferenceType | ( | ) | const |
Returns true if the underlying type is a array type
Definition at line 215 of file type.cpp.
References NULL.
Referenced by emitOffloadParamStruct(), and Module::writeDevStub().
| bool Type::IsSOAType | ( | ) | const [inline] |
Returns true if the type is laid out in "structure of arrays" layout.
Definition at line 151 of file type.h.
References GetVariability(), and Variability::SOA.
Referenced by VectorType::GetDIType(), IndexExpr::GetLValueType(), IndexExpr::GetType(), StructMemberExpr::GetType(), VectorType::getVectorMemoryCount(), Declarator::InitFromType(), InitSymbol(), lConvertPointerConstant(), lConvertPtrToSliceIfNeeded(), VectorType::LLVMType(), and UnaryExpr::TypeCheck().
| bool Type::IsUniformType | ( | ) | const [inline] |
Returns true if the underlying type is uniform
Definition at line 140 of file type.h.
References GetVariability(), and Variability::Uniform.
Referenced by FunctionEmitContext::AddElementOffset(), Module::AddFunctionDeclaration(), StructType::checkIfCanBeSOA(), ConstExpr::ConstExpr(), FunctionEmitContext::CurrentLanesReturned(), DeclStmt::EmitCode(), IfStmt::EmitCode(), DoStmt::EmitCode(), ForStmt::EmitCode(), ReturnStmt::EmitCode(), SwitchStmt::EmitCode(), AssertStmt::EmitCode(), DeleteStmt::EmitCode(), IfStmt::EstimateCost(), DoStmt::EstimateCost(), ForStmt::EstimateCost(), FunctionCallExpr::EstimateCost(), EnumType::GetAsUniformType(), StructType::GetAsUniformType(), ReferenceType::GetAsUniformType(), DeclSpecs::GetBaseType(), ExprList::GetConstant(), ConstExpr::GetConstant(), VectorType::GetDIType(), FunctionEmitContext::GetElementPtrInst(), IndexExpr::GetLValueType(), StructMemberExpr::GetLValueType(), VectorMemberExpr::GetLValueType(), GetStructTypesNamesPositions(), IndexExpr::GetType(), PtrDerefExpr::GetType(), StructMemberExpr::GetType(), VectorMemberExpr::GetType(), SelectExpr::GetValue(), TypeCastExpr::GetValue(), VectorMemberExpr::GetValue(), VectorType::getVectorMemoryCount(), lAddVaryingOffsetsIfNeeded(), lCheckTypeEquality(), lConstFoldBinLogicalOp(), lConvertPointerConstant(), lDoTypeConv(), lEmitBinaryPointerArith(), lEmitLogicalOp(), lEmitPrePostIncDec(), lEmitVectorTypedefs(), lEncodeType(), lFinalSliceOffset(), lIsMatchWithTypeWidening(), lIsMatchWithUniformToVarying(), lLLVMConstantValue(), VectorType::LLVMType(), lMatchingBoolType(), FunctionEmitContext::LoadInst(), lProcessPrintArg(), lTypeConvAtomic(), lVaryingStructHasUniformMember(), FunctionEmitContext::maskedStore(), FunctionEmitContext::scatter(), FunctionEmitContext::StoreInst(), IfStmt::TypeCheck(), BinaryExpr::TypeCheck(), DoStmt::TypeCheck(), ForStmt::TypeCheck(), FunctionCallExpr::TypeCheck(), IndexExpr::TypeCheck(), SwitchStmt::TypeCheck(), AssertStmt::TypeCheck(), and TypeCastExpr::TypeCheck().
| virtual bool Type::IsUnsignedType | ( | ) | const [pure virtual] |
Returns true if the underlying type is unsigned. In other words, this is true for unsigned integers and short vectors of unsigned integer types.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by BinaryExpr::GetValue(), ReferenceType::IsUnsignedType(), lEmitBinaryArith(), lEmitBinaryCmp(), and lEmitOpAssign().
| bool Type::IsVaryingType | ( | ) | const [inline] |
Returns true if the underlying type is varying
Definition at line 145 of file type.h.
References GetVariability(), and Variability::Varying.
Referenced by FunctionEmitContext::addVaryingOffsetsIfNeeded(), ConstExpr::Count(), IndexExpr::EstimateCost(), MemberExpr::EstimateCost(), SwitchStmt::EstimateCost(), PtrDerefExpr::EstimateCost(), FunctionEmitContext::gather(), EnumType::GetAsVaryingType(), StructType::GetAsVaryingType(), ReferenceType::GetAsVaryingType(), DeclSpecs::GetBaseType(), ConstExpr::GetConstant(), VectorType::GetDIType(), FunctionEmitContext::GetElementPtrInst(), IndexExpr::GetLValueType(), GetStructTypesNamesPositions(), BinaryExpr::GetType(), SelectExpr::GetType(), StructMemberExpr::GetType(), VectorMemberExpr::GetType(), BinaryExpr::GetValue(), FunctionCallExpr::GetValue(), IndexExpr::GetValue(), ConstExpr::GetValue(), TypeCastExpr::GetValue(), VectorType::getVectorMemoryCount(), lAddVaryingOffsetsIfNeeded(), lConvertPointerConstant(), lDoTypeConv(), lEmitBinaryArith(), lEmitBinaryCmp(), lEmitBinaryPointerArith(), lEmitLogicalOp(), lIsMatchWithUniformToVarying(), lIsVaryingFor(), VectorType::LLVMType(), FunctionEmitContext::LoadInst(), lRecursiveCheckValidParamType(), lTypeConvAtomic(), lUniformValueToVarying(), lVaryingStructHasUniformMember(), FunctionEmitContext::maskedStore(), MoreGeneralType(), SelectExpr::Optimize(), TypeCastExpr::Optimize(), FunctionEmitContext::scatter(), FunctionEmitContext::StoreInst(), BinaryExpr::TypeCheck(), AssignExpr::TypeCheck(), SelectExpr::TypeCheck(), FunctionCallExpr::TypeCheck(), ForeachUniqueStmt::TypeCheck(), and NewExpr::TypeCheck().
| bool Type::IsVoidType | ( | ) | const |
Returns true if the underlying type is either a pointer or an array
Definition at line 220 of file type.cpp.
Referenced by Module::writeDevStub().
| virtual llvm::Type* Type::LLVMType | ( | llvm::LLVMContext * | ctx | ) | const [pure virtual] |
Returns the LLVM type corresponding to this ispc type
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by FunctionEmitContext::AddElementOffset(), Module::AddGlobalVariable(), FunctionEmitContext::addVaryingOffsetsIfNeeded(), FunctionEmitContext::applyVaryingGEP(), FunctionEmitContext::CallInst(), DeclStmt::EmitCode(), ForeachUniqueStmt::EmitCode(), FunctionEmitContext::FunctionEmitContext(), FunctionEmitContext::gather(), ExprList::GetConstant(), ConstExpr::GetConstant(), NullPointerExpr::GetConstant(), SelectExpr::GetValue(), IndexExpr::GetValue(), MemberExpr::GetValue(), TypeCastExpr::GetValue(), ReferenceExpr::GetValue(), SizeOfExpr::GetValue(), NewExpr::GetValue(), InitSymbol(), lEmitBinaryPointerArith(), lEmitLogicalOp(), FunctionType::LLVMFunctionType(), PointerType::LLVMType(), ArrayType::LLVMType(), ReferenceType::LLVMType(), FunctionEmitContext::loadUniformFromSOA(), lProcessPrintArg(), lUniformValueToVarying(), and StructType::StructType().
| virtual std::string Type::Mangle | ( | ) | const [pure virtual] |
Returns a string that represents the mangled type (for use in mangling function symbol names for function overloading). The various Types implementations of this method should collectively ensure that all of them use mangling schemes that are guaranteed not to clash.
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by PointerType::Mangle(), ArrayType::Mangle(), and ReferenceType::Mangle().
| const Type * Type::MoreGeneralType | ( | const Type * | type0, |
| const Type * | type1, | ||
| SourcePos | pos, | ||
| const char * | reason, | ||
| bool | forceVarying = false, |
||
| int | vecSize = 0 |
||
| ) | [static] |
Given two types, returns the least general Type that is more general than both of them. (i.e. that can represent their values without any loss of data.) If there is no such Type, return NULL.
| type0 | First of the two types |
| type1 | Second of the two types |
| pos | Source file position where the general type is needed. |
| reason | String describing the context of why the general type is needed (e.g. "+ operator"). |
| forceVarying | If true, then make sure that the returned type is "varying". |
| vecSize | The vector size of the returned type. If non-zero, the returned type will be a VectorType of the more general type with given length. If zero, this parameter has no effect. |
Definition at line 3027 of file type.cpp.
References Assert, AtomicType::basicType, Equal(), EqualIgnoringConst(), Error(), GetAsNonConstType(), GetAsVaryingType(), VectorType::GetElementCount(), VectorType::GetElementType(), GetReferenceTarget(), GetString(), PointerType::GetUniform(), IsVaryingType(), PointerType::IsVoidPointer(), lVectorConvert(), and NULL.
Referenced by BinaryExpr::GetType(), SelectExpr::GetType(), lEmitLogicalOp(), BinaryExpr::TypeCheck(), and SelectExpr::TypeCheck().
| virtual const Type* Type::ResolveUnboundVariability | ( | Variability | v | ) | const [pure virtual] |
Implemented in FunctionType, ReferenceType, UndefinedStructType, StructType, VectorType, ArrayType, PointerType, EnumType, and AtomicType.
Referenced by StructType::GetElementType(), Declaration::GetVariableDeclarations(), Declarator::InitFromType(), lApplyTypeQualifiers(), NewExpr::NewExpr(), PointerType::ResolveUnboundVariability(), ArrayType::ResolveUnboundVariability(), ReferenceType::ResolveUnboundVariability(), FunctionType::ResolveUnboundVariability(), SizeOfExpr::SizeOfExpr(), and TypeCastExpr::TypeCheck().
| const TypeId Type::typeId |
Indicates which Type implementation this type is. This value can be used to determine the actual type much more efficiently than using dynamic_cast.
Definition at line 266 of file type.h.
Referenced by CastType().
1.7.5.1