Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Type representing a reference to another (non-reference) type. More...
#include <type.h>
Public Member Functions | |
ReferenceType (const Type *targetType) | |
Variability | GetVariability () const |
bool | IsBoolType () const |
bool | IsFloatType () const |
bool | IsIntType () const |
bool | IsUnsignedType () const |
bool | IsConstType () const |
const Type * | GetBaseType () const |
const Type * | GetReferenceTarget () const |
const ReferenceType * | GetAsVaryingType () const |
const ReferenceType * | GetAsUniformType () const |
const ReferenceType * | GetAsUnboundVariabilityType () const |
const Type * | GetAsSOAType (int width) const |
const ReferenceType * | ResolveUnboundVariability (Variability v) const |
const ReferenceType * | GetAsConstType () const |
const ReferenceType * | GetAsNonConstType () const |
std::string | GetString () const |
std::string | Mangle () const |
std::string | GetCDeclaration (const std::string &name) const |
llvm::Type * | LLVMType (llvm::LLVMContext *ctx) const |
llvm::DIType * | GetDIType (llvm::DIScope *scope) const |
Public Member Functions inherited from Type | |
bool | IsPointerType () const |
bool | IsArrayType () const |
bool | IsReferenceType () const |
bool | IsVoidType () const |
bool | IsNumericType () const |
bool | IsUniformType () const |
bool | IsVaryingType () const |
bool | IsSOAType () const |
int | GetSOAWidth () const |
bool | HasUnboundVariability () const |
virtual const Type * | GetAsUnsignedType () const |
virtual llvm::Type * | LLVMStorageType (llvm::LLVMContext *ctx) const |
Private Attributes | |
const Type *const | targetType |
const ReferenceType * | asOtherConstType |
Additional Inherited Members | |
Static Public Member Functions inherited from Type | |
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 inherited from Type | |
const TypeId | typeId |
Protected Member Functions inherited from Type | |
Type (TypeId id) | |
Type representing a reference to another (non-reference) type.
ReferenceType::ReferenceType | ( | const Type * | targetType | ) |
Definition at line 2037 of file type.cpp.
References asOtherConstType.
Referenced by GetAsConstType(), GetAsNonConstType(), GetAsUnboundVariabilityType(), GetAsUniformType(), GetAsVaryingType(), and ResolveUnboundVariability().
|
virtual |
Get a const version of this type. If it's already const, then the old Type pointer is returned.
Implements Type.
Definition at line 2140 of file type.cpp.
References asOtherConstType, Assert, Module::errorCount, Type::GetAsConstType(), IsConstType(), m, ReferenceType(), and targetType.
|
virtual |
Get a non-const version of this type. If it's already not const, then the old Type pointer is returned.
Implements Type.
Definition at line 2155 of file type.cpp.
References asOtherConstType, Assert, Module::errorCount, Type::GetAsNonConstType(), IsConstType(), m, ReferenceType(), and targetType.
|
virtual |
|
virtual |
Get an instance of the type with unbound variability.
Implements Type.
Definition at line 2117 of file type.cpp.
References Assert, Module::errorCount, Type::GetAsUnboundVariabilityType(), Type::HasUnboundVariability(), m, ReferenceType(), and targetType.
|
virtual |
Return a "uniform" instance of this type. If the type is already uniform, its "this" pointer will be returned.
Implements Type.
Definition at line 2107 of file type.cpp.
References Assert, Module::errorCount, Type::GetAsUniformType(), Type::IsUniformType(), m, ReferenceType(), and targetType.
|
virtual |
Return a "varying" instance of this type. If the type is already varying, its "this" pointer will be returned.
Implements Type.
Definition at line 2097 of file type.cpp.
References Assert, Module::errorCount, Type::GetAsVaryingType(), Type::IsVaryingType(), m, ReferenceType(), and targetType.
|
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.
Implements Type.
Definition at line 2089 of file type.cpp.
References Assert, Module::errorCount, Type::GetBaseType(), m, and targetType.
|
virtual |
Returns a string that is the declaration of the same type in C syntax.
Implements Type.
Definition at line 2192 of file type.cpp.
References Assert, Module::errorCount, Type::GetAsNonConstType(), Type::GetCDeclaration(), ArrayType::GetElementCount(), ArrayType::GetElementType(), lShouldPrintName(), m, and targetType.
|
virtual |
Returns the DIType (LLVM's debugging information structure), corresponding to this type.
Implements Type.
Definition at line 2235 of file type.cpp.
References Assert, Module::diBuilder, Module::errorCount, Type::GetDIType(), m, and targetType.
|
virtual |
If this is a reference type, returns the type it is referring to. For all other types, just returns its own type.
Reimplemented from Type.
Definition at line 2087 of file type.cpp.
References targetType.
Referenced by emitOffloadParamStruct(), StructMemberExpr::getStructType(), TypeCastExpr::GetValue(), lArgIsPointerType(), lCheckTypeEquality(), and Module::writeDevStub().
|
virtual |
Returns a text representation of the type (for example, for use in warning and error messages).
Implements Type.
Definition at line 2170 of file type.cpp.
References Assert, Module::errorCount, Type::GetString(), m, and targetType.
Referenced by InitSymbol().
|
virtual |
Returns the variability of the type.
Implements Type.
Definition at line 2039 of file type.cpp.
References Assert, Module::errorCount, Type::GetVariability(), m, targetType, and Variability::Unbound.
|
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.
Implements Type.
Definition at line 2047 of file type.cpp.
References Assert, Module::errorCount, Type::IsBoolType(), m, and targetType.
|
virtual |
Returns true if this type is 'const'-qualified.
Implements Type.
Definition at line 2079 of file type.cpp.
References Assert, Module::errorCount, Type::IsConstType(), m, and targetType.
Referenced by GetAsConstType(), and GetAsNonConstType().
|
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.
Implements Type.
Definition at line 2055 of file type.cpp.
References Assert, Module::errorCount, Type::IsFloatType(), m, and targetType.
|
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.
Implements Type.
Definition at line 2063 of file type.cpp.
References Assert, Module::errorCount, Type::IsIntType(), m, and targetType.
|
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.
Implements Type.
Definition at line 2071 of file type.cpp.
References Assert, Module::errorCount, Type::IsUnsignedType(), m, and targetType.
|
virtual |
Returns the LLVM type corresponding to this ispc type.
Implements Type.
Definition at line 2220 of file type.cpp.
References Assert, Module::errorCount, Type::LLVMStorageType(), m, and targetType.
|
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.
Implements Type.
Definition at line 2182 of file type.cpp.
References Assert, Module::errorCount, m, Type::Mangle(), and targetType.
|
virtual |
Implements Type.
Definition at line 2132 of file type.cpp.
References Assert, Module::errorCount, m, ReferenceType(), Type::ResolveUnboundVariability(), and targetType.
|
mutableprivate |
Definition at line 815 of file type.h.
Referenced by GetAsConstType(), GetAsNonConstType(), and ReferenceType().
|
private |
Definition at line 814 of file type.h.
Referenced by GetAsConstType(), GetAsNonConstType(), GetAsUnboundVariabilityType(), GetAsUniformType(), GetAsVaryingType(), GetBaseType(), GetCDeclaration(), GetDIType(), GetReferenceTarget(), GetString(), GetVariability(), IsBoolType(), IsConstType(), IsFloatType(), IsIntType(), IsUnsignedType(), LLVMType(), Mangle(), and ResolveUnboundVariability().