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

#include <type.h>

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

List of all members.

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

Private Attributes

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

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 745 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 2302 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 2310 of file type.cpp.

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

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

Implements Type.

Definition at line 2287 of file type.cpp.

References FATAL, and NULL.

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

Get an instance of the type with unbound variability.

Implements Type.

Definition at line 2279 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 2271 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 2263 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 2257 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 2335 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 2358 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 2318 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 776 of file type.h.

References name.

Variability UndefinedStructType::GetVariability ( ) const [virtual]

Returns the variability of the type.

Implements Type.

Definition at line 2221 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 2227 of file type.cpp.

bool UndefinedStructType::IsConstType ( ) const [virtual]

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

Implements Type.

Definition at line 2251 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 2233 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 2239 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 2245 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 2346 of file type.cpp.

References Assert, Module::errorCount, lMangleStructName(), m, name, NULL, 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 2329 of file type.cpp.

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

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

Implements Type.

Definition at line 2294 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]

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