|
Intel SPMD Program Compiler
1.3.0
|
Type implementation for enumerated types. More...
#include <type.h>


Public Member Functions | |
| EnumType (SourcePos pos) | |
| EnumType (const char *name, SourcePos pos) | |
| Variability | GetVariability () const |
| bool | IsBoolType () const |
| bool | IsFloatType () const |
| bool | IsIntType () const |
| bool | IsUnsignedType () const |
| bool | IsConstType () const |
| const EnumType * | GetBaseType () const |
| const EnumType * | GetAsVaryingType () const |
| const EnumType * | GetAsUniformType () const |
| const EnumType * | GetAsUnboundVariabilityType () const |
| const EnumType * | GetAsSOAType (int width) const |
| const EnumType * | ResolveUnboundVariability (Variability v) const |
| const EnumType * | GetAsConstType () const |
| const EnumType * | GetAsNonConstType () 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 |
| void | SetEnumerators (const std::vector< Symbol * > &enumerators) |
| int | GetEnumeratorCount () const |
| const Symbol * | GetEnumerator (int i) const |
Public Attributes | |
| const SourcePos | pos |
Private Attributes | |
| const std::string | name |
| Variability | variability |
| bool | isConst |
| std::vector< Symbol * > | enumerators |
| EnumType::EnumType | ( | SourcePos | pos | ) |
Constructor for anonymous enumerated types
Definition at line 580 of file type.cpp.
References isConst, Variability::Unbound, and variability.
Referenced by GetAsConstType(), GetAsNonConstType(), GetAsSOAType(), GetAsUnboundVariabilityType(), GetAsUniformType(), GetAsVaryingType(), and ResolveUnboundVariability().
| EnumType::EnumType | ( | const char * | name, |
| SourcePos | pos | ||
| ) |
Constructor for named enumerated types
Definition at line 588 of file type.cpp.
References isConst, Variability::Unbound, and variability.
| const EnumType * EnumType::GetAsConstType | ( | ) | const [virtual] |
| const EnumType * EnumType::GetAsNonConstType | ( | ) | const [virtual] |
| const EnumType * EnumType::GetAsSOAType | ( | int | width | ) | const [virtual] |
Implements Type.
Definition at line 686 of file type.cpp.
References EnumType(), Type::GetSOAWidth(), Variability::SOA, and variability.
| const EnumType * EnumType::GetAsUnboundVariabilityType | ( | ) | const [virtual] |
Get an instance of the type with unbound variability.
Implements Type.
Definition at line 674 of file type.cpp.
References EnumType(), Type::HasUnboundVariability(), Variability::Unbound, and variability.
| const EnumType * EnumType::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 638 of file type.cpp.
References EnumType(), Type::IsUniformType(), Variability::Uniform, and variability.
| const EnumType * EnumType::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 662 of file type.cpp.
References EnumType(), Type::IsVaryingType(), variability, and Variability::Varying.
| const EnumType * EnumType::GetBaseType | ( | ) | const [virtual] |
| std::string EnumType::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 747 of file type.cpp.
References Assert, Module::errorCount, isConst, lShouldPrintName(), m, name, Variability::SOA, Variability::soaWidth, Variability::Uniform, and variability.
| llvm::DIType EnumType::GetDIType | ( | llvm::DIDescriptor | scope | ) | const [virtual] |
Returns the DIType (LLVM's debugging information structure), corresponding to this type.
Implements Type.
Definition at line 796 of file type.cpp.
References Assert, Module::diBuilder, enumerators, FATAL, SourcePos::first_line, g, SourcePos::GetDIFile(), lCreateDIArray(), m, name, NULL, pos, Variability::SOA, Variability::soaWidth, Globals::target, Variability::type, Variability::Uniform, variability, Variability::Varying, and Target::vectorWidth.
| const Symbol * EnumType::GetEnumerator | ( | int | i | ) | const |
Returns the symbol for the given enumerator number.
Definition at line 856 of file type.cpp.
References enumerators.
| int EnumType::GetEnumeratorCount | ( | ) | const |
Returns the total number of enuemrators in this enum type.
Definition at line 850 of file type.cpp.
References enumerators.
| std::string EnumType::GetString | ( | ) | const [virtual] |
Returns a text representation of the type (for example, for use in warning and error messages).
Implements Type.
Definition at line 722 of file type.cpp.
References Variability::GetString(), isConst, name, and variability.
| Variability EnumType::GetVariability | ( | ) | const [virtual] |
Returns the variability of the type.
Implements Type.
Definition at line 596 of file type.cpp.
References variability.
Referenced by lCheckTypeEquality().
| bool EnumType::IsBoolType | ( | ) | const [virtual] |
| bool EnumType::IsConstType | ( | ) | const [virtual] |
| bool EnumType::IsFloatType | ( | ) | const [virtual] |
| bool EnumType::IsIntType | ( | ) | const [virtual] |
| bool EnumType::IsUnsignedType | ( | ) | const [virtual] |
| llvm::Type * EnumType::LLVMType | ( | llvm::LLVMContext * | ctx | ) | const [virtual] |
Returns the LLVM type corresponding to this ispc type
Implements Type.
Definition at line 776 of file type.cpp.
References Assert, FATAL, LLVMTypes::Int32Type, LLVMTypes::Int32VectorType, ArrayType::LLVMType(), NULL, Variability::SOA, Variability::soaWidth, Variability::type, Variability::Unbound, Variability::Uniform, variability, and Variability::Varying.
| std::string EnumType::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 735 of file type.cpp.
References Assert, isConst, Variability::MangleString(), name, Variability::Unbound, and variability.
| const EnumType * EnumType::ResolveUnboundVariability | ( | Variability | v | ) | const [virtual] |
Implements Type.
Definition at line 650 of file type.cpp.
References EnumType(), Variability::Unbound, and variability.
| void EnumType::SetEnumerators | ( | const std::vector< Symbol * > & | enumerators | ) |
Provides the enumerators defined in the enum definition.
Definition at line 844 of file type.cpp.
References enumerators.
std::vector<Symbol *> EnumType::enumerators [private] |
Definition at line 400 of file type.h.
Referenced by GetDIType(), GetEnumerator(), GetEnumeratorCount(), and SetEnumerators().
bool EnumType::isConst [private] |
Definition at line 399 of file type.h.
Referenced by EnumType(), GetAsConstType(), GetAsNonConstType(), GetCDeclaration(), GetString(), IsConstType(), and Mangle().
const std::string EnumType::name [private] |
Definition at line 397 of file type.h.
Referenced by GetCDeclaration(), GetDIType(), GetString(), and Mangle().
| const SourcePos EnumType::pos |
Definition at line 394 of file type.h.
Referenced by GetDIType(), and lCheckTypeEquality().
Variability EnumType::variability [private] |
Definition at line 398 of file type.h.
Referenced by EnumType(), GetAsSOAType(), GetAsUnboundVariabilityType(), GetAsUniformType(), GetAsVaryingType(), GetCDeclaration(), GetDIType(), GetString(), GetVariability(), LLVMType(), Mangle(), and ResolveUnboundVariability().
1.7.5.1