Intel SPMD Program Compiler  1.9.1
Public Member Functions | Private Attributes | List of all members
UndefinedStructType Class Reference

#include <type.h>

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

Public Member Functions

 UndefinedStructType (const std::string &name, const Variability variability, bool isConst, SourcePos pos)
 
Variability GetVariability () const
 
bool IsBoolType () const
 
bool IsFloatType () const
 
bool IsIntType () const
 
bool IsUnsignedType () const
 
bool IsConstType () const
 
const TypeGetBaseType () const
 
const UndefinedStructTypeGetAsVaryingType () const
 
const UndefinedStructTypeGetAsUniformType () const
 
const UndefinedStructTypeGetAsUnboundVariabilityType () const
 
const UndefinedStructTypeGetAsSOAType (int width) const
 
const UndefinedStructTypeResolveUnboundVariability (Variability v) const
 
const UndefinedStructTypeGetAsConstType () const
 
const UndefinedStructTypeGetAsNonConstType () 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
 
const std::string & GetStructName () 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 const TypeGetReferenceTarget () const
 

Private Attributes

const std::string name
 
const Variability variability
 
const bool isConst
 
const SourcePos pos
 

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 implementation representing a struct name that has been declared but where the struct members haven't been defined (i.e. "struct Foo;"). This class doesn't do much besides serve as a placeholder that other code can use to detect the presence of such as truct.

Definition at line 785 of file type.h.

Constructor & Destructor Documentation

UndefinedStructType::UndefinedStructType ( const std::string &  name,
const Variability  variability,
bool  isConst,
SourcePos  pos 
)

Member Function Documentation

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

References isConst, name, pos, UndefinedStructType(), and variability.

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

References isConst, name, pos, UndefinedStructType(), and variability.

const UndefinedStructType * UndefinedStructType::GetAsSOAType ( int  width) const
virtual

Implements Type.

Definition at line 2501 of file type.cpp.

References FATAL.

const UndefinedStructType * UndefinedStructType::GetAsUnboundVariabilityType ( ) const
virtual

Get an instance of the type with unbound variability.

Implements Type.

Definition at line 2493 of file type.cpp.

References isConst, name, pos, Variability::Unbound, UndefinedStructType(), and variability.

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

References isConst, name, pos, UndefinedStructType(), Variability::Uniform, and variability.

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

References isConst, name, pos, UndefinedStructType(), variability, and Variability::Varying.

const Type * UndefinedStructType::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 2471 of file type.cpp.

std::string UndefinedStructType::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 2549 of file type.cpp.

References isConst, lShouldPrintName(), and name.

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

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

Implements Type.

Definition at line 2572 of file type.cpp.

References Module::diBuilder, SourcePos::first_line, SourcePos::GetDIFile(), m, name, and pos.

std::string UndefinedStructType::GetString ( ) const
virtual

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

Implements Type.

Definition at line 2532 of file type.cpp.

References Variability::GetString(), isConst, name, and variability.

const std::string& UndefinedStructType::GetStructName ( ) const
inline

Returns the name of the structure type. (e.g. struct Foo -> "Foo".)

Definition at line 820 of file type.h.

References name.

Variability UndefinedStructType::GetVariability ( ) const
virtual

Returns the variability of the type.

Implements Type.

Definition at line 2435 of file type.cpp.

References variability.

bool UndefinedStructType::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 2441 of file type.cpp.

bool UndefinedStructType::IsConstType ( ) const
virtual

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

Implements Type.

Definition at line 2465 of file type.cpp.

References isConst.

bool UndefinedStructType::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 2447 of file type.cpp.

bool UndefinedStructType::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 2453 of file type.cpp.

bool UndefinedStructType::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 2459 of file type.cpp.

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

Returns the LLVM type corresponding to this ispc type

Implements Type.

Definition at line 2560 of file type.cpp.

References Assert, Module::errorCount, lMangleStructName(), m, name, Variability::Unbound, and variability.

std::string UndefinedStructType::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 2543 of file type.cpp.

References isConst, lMangleStruct(), name, and variability.

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

Implements Type.

Definition at line 2508 of file type.cpp.

References isConst, name, pos, Variability::Unbound, UndefinedStructType(), and variability.

Member Data Documentation

const bool UndefinedStructType::isConst
private
const std::string UndefinedStructType::name
private
const SourcePos UndefinedStructType::pos
private
const Variability UndefinedStructType::variability
private

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