Intel SPMD Program Compiler  1.3.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes
PointerType Class Reference

Type implementation for pointers to other types. More...

#include <type.h>

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

List of all members.

Public Member Functions

 PointerType (const Type *t, Variability v, bool isConst, bool isSlice=false, bool frozen=false)
Variability GetVariability () const
bool IsBoolType () const
bool IsFloatType () const
bool IsIntType () const
bool IsUnsignedType () const
bool IsConstType () const
bool IsSlice () const
bool IsFrozenSlice () const
const PointerTypeGetAsSlice () const
const PointerTypeGetAsNonSlice () const
const PointerTypeGetAsFrozenSlice () const
const TypeGetBaseType () const
const PointerTypeGetAsVaryingType () const
const PointerTypeGetAsUniformType () const
const PointerTypeGetAsUnboundVariabilityType () const
const PointerTypeGetAsSOAType (int width) const
const PointerTypeResolveUnboundVariability (Variability v) const
const PointerTypeGetAsConstType () const
const PointerTypeGetAsNonConstType () 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

Static Public Member Functions

static PointerTypeGetUniform (const Type *t)
static PointerTypeGetVarying (const Type *t)
static bool IsVoidPointer (const Type *t)

Static Public Attributes

static PointerTypeVoid

Private Attributes

const Variability variability
const bool isConst
const bool isSlice
const bool isFrozen
const TypebaseType

Detailed Description

Type implementation for pointers to other types.

Pointers can have two additional properties beyond their variability and the type of object that they are pointing to. Both of these properties are used for internal bookkeeping and aren't directly accessible from the language.

Definition at line 424 of file type.h.


Constructor & Destructor Documentation

PointerType::PointerType ( const Type t,
Variability  v,
bool  isConst,
bool  isSlice = false,
bool  frozen = false 
)

Member Function Documentation

const PointerType * PointerType::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 1018 of file type.cpp.

References baseType, isConst, isSlice, PointerType(), and variability.

const PointerType * PointerType::GetAsFrozenSlice ( ) const
const PointerType * PointerType::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 1027 of file type.cpp.

References baseType, isConst, isSlice, PointerType(), and variability.

const PointerType * PointerType::GetAsNonSlice ( ) const
const PointerType * PointerType::GetAsSlice ( ) const
const PointerType * PointerType::GetAsSOAType ( int  width) const [virtual]

Implements Type.

Definition at line 967 of file type.cpp.

References baseType, Type::GetSOAWidth(), isConst, isFrozen, isSlice, PointerType(), and Variability::SOA.

const PointerType * PointerType::GetAsUnboundVariabilityType ( ) const [virtual]

Get an instance of the type with unbound variability.

Implements Type.

Definition at line 957 of file type.cpp.

References baseType, isConst, isFrozen, isSlice, PointerType(), Variability::Unbound, and variability.

const PointerType * PointerType::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 947 of file type.cpp.

References baseType, isConst, isFrozen, isSlice, PointerType(), Variability::Uniform, and variability.

Referenced by GetDIType(), and LLVMType().

const PointerType * PointerType::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 937 of file type.cpp.

References baseType, isConst, isFrozen, isSlice, PointerType(), variability, and Variability::Varying.

const Type * PointerType::GetBaseType ( ) const [virtual]
std::string PointerType::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 1072 of file type.cpp.

References Assert, baseType, Module::errorCount, Type::GetCDeclaration(), isConst, isSlice, m, NULL, Variability::SOA, Variability::soaWidth, Variability::Uniform, and variability.

llvm::DIType PointerType::GetDIType ( llvm::DIDescriptor  scope) const [virtual]
std::string PointerType::GetString ( ) const [virtual]

Returns a text representation of the type (for example, for use in warning and error messages).

Implements Type.

Definition at line 1036 of file type.cpp.

References Assert, baseType, Module::errorCount, Variability::GetString(), Type::GetString(), isConst, isFrozen, isSlice, m, NULL, and variability.

Referenced by BinaryExpr::TypeCheck().

PointerType * PointerType::GetUniform ( const Type t) [static]
Variability PointerType::GetVariability ( ) const [virtual]

Returns the variability of the type.

Implements Type.

Definition at line 895 of file type.cpp.

References variability.

Referenced by FunctionEmitContext::AddElementOffset(), and lDeconstifyType().

PointerType * PointerType::GetVarying ( const Type t) [static]
bool PointerType::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 901 of file type.cpp.

bool PointerType::IsConstType ( ) const [virtual]

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

Implements Type.

Definition at line 925 of file type.cpp.

References isConst.

Referenced by FunctionEmitContext::AddElementOffset().

bool PointerType::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 907 of file type.cpp.

bool PointerType::IsFrozenSlice ( ) const [inline]

Definition at line 446 of file type.h.

References isFrozen.

Referenced by FunctionEmitContext::GetElementPtrInst(), and lCheckTypeEquality().

bool PointerType::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 913 of file type.cpp.

bool PointerType::IsSlice ( ) const [inline]
bool PointerType::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 919 of file type.cpp.

bool PointerType::IsVoidPointer ( const Type t) [static]

Returns true if the given type is a void * type.

Definition at line 888 of file type.cpp.

References Type::EqualIgnoringConst(), Type::GetAsUniformType(), and Void.

Referenced by TypeCastExpr::GetValue(), lDoTypeConv(), Type::MoreGeneralType(), UnaryExpr::TypeCheck(), BinaryExpr::TypeCheck(), and AssignExpr::TypeCheck().

llvm::Type * PointerType::LLVMType ( llvm::LLVMContext *  ctx) const [virtual]
std::string PointerType::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 1055 of file type.cpp.

References Assert, baseType, Module::errorCount, isFrozen, isSlice, m, Type::Mangle(), Variability::MangleString(), NULL, Variability::Unbound, and variability.

const PointerType * PointerType::ResolveUnboundVariability ( Variability  v) const [virtual]

Member Data Documentation

const Type* PointerType::baseType [private]
const bool PointerType::isConst [private]
const bool PointerType::isFrozen [private]
const bool PointerType::isSlice [private]
Initial value:

Definition at line 468 of file type.h.

Referenced by NullPointerExpr::GetType(), IsVoidPointer(), and lDoTypeConv().


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