Intel SPMD Program Compiler  1.9.1
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::DIDescriptor 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
 

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 832 of file type.h.

Constructor & Destructor Documentation

ReferenceType::ReferenceType ( const Type targetType)

Member Function Documentation

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 2736 of file type.cpp.

References asOtherConstType, Assert, Module::errorCount, Type::GetAsConstType(), IsConstType(), m, ReferenceType(), and targetType.

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 2753 of file type.cpp.

References asOtherConstType, Assert, Module::errorCount, Type::GetAsNonConstType(), IsConstType(), m, ReferenceType(), and targetType.

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

Implements Type.

Definition at line 2719 of file type.cpp.

const ReferenceType * ReferenceType::GetAsUnboundVariabilityType ( ) const
virtual

Get an instance of the type with unbound variability.

Implements Type.

Definition at line 2707 of file type.cpp.

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

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 2695 of file type.cpp.

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

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 2683 of file type.cpp.

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

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 2673 of file type.cpp.

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

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 2796 of file type.cpp.

References Assert, Module::errorCount, Type::GetAsNonConstType(), Type::GetCDeclaration(), ArrayType::GetElementCount(), ArrayType::GetElementType(), lShouldPrintName(), m, and targetType.

llvm::DIType ReferenceType::GetDIType ( llvm::DIDescriptor  scope) const
virtual

Returns the DIType (LLVM's debugging information structure), corresponding to this type.

Implements Type.

Definition at line 2846 of file type.cpp.

References Assert, Module::diBuilder, Module::errorCount, Type::GetDIType(), m, and targetType.

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 2667 of file type.cpp.

References targetType.

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

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 2770 of file type.cpp.

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

Referenced by InitSymbol().

Variability ReferenceType::GetVariability ( ) const
virtual

Returns the variability of the type.

Implements Type.

Definition at line 2607 of file type.cpp.

References Assert, Module::errorCount, Type::GetVariability(), m, targetType, and Variability::Unbound.

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 2617 of file type.cpp.

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

bool ReferenceType::IsConstType ( ) const
virtual

Returns true if this type is 'const'-qualified.

Implements Type.

Definition at line 2657 of file type.cpp.

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

Referenced by GetAsConstType(), and GetAsNonConstType().

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 2627 of file type.cpp.

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

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 2637 of file type.cpp.

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

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 2647 of file type.cpp.

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

llvm::Type * ReferenceType::LLVMType ( llvm::LLVMContext *  ctx) const
virtual

Returns the LLVM type corresponding to this ispc type

Implements Type.

Definition at line 2829 of file type.cpp.

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

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 2784 of file type.cpp.

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

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

Implements Type.

Definition at line 2726 of file type.cpp.

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

Member Data Documentation

const ReferenceType* ReferenceType::asOtherConstType
mutableprivate

Definition at line 868 of file type.h.

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

const Type* const ReferenceType::targetType
private

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