Intel® Implicit SPMD Program Compiler (Intel® ISPC)  1.13.0
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::DIScope *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
 
virtual llvm::Type * LLVMStorageType (llvm::LLVMContext *ctx) 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 740 of file type.h.

Constructor & Destructor Documentation

◆ UndefinedStructType()

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

Member Function Documentation

◆ GetAsConstType()

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

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

◆ GetAsNonConstType()

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

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

◆ GetAsSOAType()

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

Implements Type.

Definition at line 1968 of file type.cpp.

References FATAL.

◆ GetAsUnboundVariabilityType()

const UndefinedStructType * UndefinedStructType::GetAsUnboundVariabilityType ( ) const
virtual

Get an instance of the type with unbound variability.

Implements Type.

Definition at line 1962 of file type.cpp.

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

◆ GetAsUniformType()

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

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

◆ GetAsVaryingType()

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

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

◆ GetBaseType()

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

◆ GetCDeclaration()

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

References isConst, lShouldPrintName(), and name.

◆ GetDIType()

llvm::DIType * UndefinedStructType::GetDIType ( llvm::DIScope *  scope) const
virtual

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

Implements Type.

Definition at line 2023 of file type.cpp.

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

◆ GetString()

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

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

◆ GetStructName()

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

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

Definition at line 771 of file type.h.

◆ GetVariability()

Variability UndefinedStructType::GetVariability ( ) const
virtual

Returns the variability of the type.

Implements Type.

Definition at line 1936 of file type.cpp.

References variability.

◆ IsBoolType()

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

◆ IsConstType()

bool UndefinedStructType::IsConstType ( ) const
virtual

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

Implements Type.

Definition at line 1946 of file type.cpp.

References isConst.

◆ IsFloatType()

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

◆ IsIntType()

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

◆ IsUnsignedType()

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

◆ LLVMType()

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

Returns the LLVM type corresponding to this ispc type.

Implements Type.

Definition at line 2013 of file type.cpp.

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

◆ Mangle()

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

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

◆ ResolveUnboundVariability()

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

Implements Type.

Definition at line 1973 of file type.cpp.

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

Member Data Documentation

◆ isConst

const bool UndefinedStructType::isConst
private

◆ name

const std::string UndefinedStructType::name
private

◆ pos

const SourcePos UndefinedStructType::pos
private

◆ variability

const Variability UndefinedStructType::variability
private

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