Intel® Implicit SPMD Program Compiler (Intel® ISPC)  1.13.0
Public Member Functions | Private Attributes | List of all members
ReferenceType Class Reference

Type representing a reference to another (non-reference) type. More...

#include <type.h>

Inheritance diagram for ReferenceType:
Inheritance graph
[legend]
Collaboration diagram for ReferenceType:
Collaboration graph
[legend]

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 TypeGetBaseType () const
 
const TypeGetReferenceTarget () const
 
const ReferenceTypeGetAsVaryingType () const
 
const ReferenceTypeGetAsUniformType () const
 
const ReferenceTypeGetAsUnboundVariabilityType () const
 
const TypeGetAsSOAType (int width) const
 
const ReferenceTypeResolveUnboundVariability (Variability v) const
 
const ReferenceTypeGetAsConstType () const
 
const ReferenceTypeGetAsNonConstType () 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 TypeGetAsUnsignedType () const
 
virtual llvm::Type * LLVMStorageType (llvm::LLVMContext *ctx) const
 

Private Attributes

const Type *const targetType
 
const ReferenceTypeasOtherConstType
 

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 TypeMoreGeneralType (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)
 

Detailed Description

Type representing a reference to another (non-reference) type.

Definition at line 782 of file type.h.

Constructor & Destructor Documentation

◆ ReferenceType()

ReferenceType::ReferenceType ( const Type targetType)

Member Function Documentation

◆ GetAsConstType()

const ReferenceType * ReferenceType::GetAsConstType ( ) const
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.

◆ GetAsNonConstType()

const ReferenceType * ReferenceType::GetAsNonConstType ( ) const
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.

◆ GetAsSOAType()

const Type * ReferenceType::GetAsSOAType ( int  width) const
virtual

Implements Type.

Definition at line 2127 of file type.cpp.

◆ GetAsUnboundVariabilityType()

const ReferenceType * ReferenceType::GetAsUnboundVariabilityType ( ) const
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.

◆ GetAsUniformType()

const ReferenceType * ReferenceType::GetAsUniformType ( ) const
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.

◆ GetAsVaryingType()

const ReferenceType * ReferenceType::GetAsVaryingType ( ) const
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.

◆ GetBaseType()

const Type * ReferenceType::GetBaseType ( ) const
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.

◆ GetCDeclaration()

std::string ReferenceType::GetCDeclaration ( const std::string &  name) const
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.

◆ GetDIType()

llvm::DIType * ReferenceType::GetDIType ( llvm::DIScope *  scope) const
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.

◆ GetReferenceTarget()

const Type * ReferenceType::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 from Type.

Definition at line 2087 of file type.cpp.

References targetType.

Referenced by emitOffloadParamStruct(), StructMemberExpr::getStructType(), TypeCastExpr::GetValue(), lArgIsPointerType(), lCheckTypeEquality(), and Module::writeDevStub().

◆ GetString()

std::string ReferenceType::GetString ( ) const
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().

◆ GetVariability()

Variability ReferenceType::GetVariability ( ) const
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.

◆ IsBoolType()

bool ReferenceType::IsBoolType ( ) const
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.

◆ IsConstType()

bool ReferenceType::IsConstType ( ) const
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().

◆ IsFloatType()

bool ReferenceType::IsFloatType ( ) const
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.

◆ IsIntType()

bool ReferenceType::IsIntType ( ) const
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.

◆ IsUnsignedType()

bool ReferenceType::IsUnsignedType ( ) const
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.

◆ LLVMType()

llvm::Type * ReferenceType::LLVMType ( llvm::LLVMContext *  ctx) const
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.

◆ Mangle()

std::string ReferenceType::Mangle ( ) const
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.

◆ ResolveUnboundVariability()

const ReferenceType * ReferenceType::ResolveUnboundVariability ( Variability  v) const
virtual

Implements Type.

Definition at line 2132 of file type.cpp.

References Assert, Module::errorCount, m, ReferenceType(), Type::ResolveUnboundVariability(), and targetType.

Member Data Documentation

◆ asOtherConstType

const ReferenceType* ReferenceType::asOtherConstType
mutableprivate

Definition at line 815 of file type.h.

Referenced by GetAsConstType(), GetAsNonConstType(), and ReferenceType().

◆ targetType

const Type* const ReferenceType::targetType
private

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