Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Declarations related to type declarations; the parser basically creates instances of these classes, which are then turned into actual Types. More...
Go to the source code of this file.
Classes | |
class | DeclSpecs |
Representation of the declaration specifiers in a declaration. More... | |
class | Declarator |
Representation of the declaration of a single variable. More... | |
class | Declaration |
Representation of a full declaration of one or more variables, including the shared DeclSpecs as well as the per-variable Declarators. More... | |
struct | StructDeclaration |
Macros | |
#define | TYPEQUAL_NONE 0 |
#define | TYPEQUAL_CONST (1 << 0) |
#define | TYPEQUAL_UNIFORM (1 << 1) |
#define | TYPEQUAL_VARYING (1 << 2) |
#define | TYPEQUAL_TASK (1 << 3) |
#define | TYPEQUAL_SIGNED (1 << 4) |
#define | TYPEQUAL_UNSIGNED (1 << 5) |
#define | TYPEQUAL_INLINE (1 << 6) |
#define | TYPEQUAL_EXPORT (1 << 7) |
#define | TYPEQUAL_UNMASKED (1 << 8) |
#define | TYPEQUAL_NOINLINE (1 << 9) |
Enumerations | |
enum | DeclaratorKind { DK_BASE, DK_POINTER, DK_REFERENCE, DK_ARRAY, DK_FUNCTION } |
Functions | |
void | GetStructTypesNamesPositions (const std::vector< StructDeclaration *> &sd, llvm::SmallVector< const Type *, 8 > *elementTypes, llvm::SmallVector< std::string, 8 > *elementNames, llvm::SmallVector< SourcePos, 8 > *elementPositions) |
Declarations related to type declarations; the parser basically creates instances of these classes, which are then turned into actual Types.
Three classes work together to represent declarations. As an example, consider a declaration like:
static uniform int foo, bar[10];
An instance of the Declaration class represents this entire declaration of two variables, 'foo' and 'bar'. It holds a single instance of the DeclSpecs class represents the common specifiers for all of the variables–here, that the declaration has the 'static' and 'uniform' qualifiers, and that it's basic type is 'int'. Then for each variable declaration, the Declaraiton class holds an instance of a Declarator, which in turn records the per-variable information like the name, array size (if any), initializer expression, etc.
Definition in file decl.h.
#define TYPEQUAL_CONST (1 << 0) |
Definition at line 68 of file decl.h.
Referenced by Declarator::InitFromType(), lApplyTypeQualifiers(), and lPrintTypeQualifiers().
#define TYPEQUAL_EXPORT (1 << 7) |
Definition at line 75 of file decl.h.
Referenced by Declarator::InitFromType(), and lPrintTypeQualifiers().
#define TYPEQUAL_INLINE (1 << 6) |
Definition at line 74 of file decl.h.
Referenced by Declaration::DeclareFunctions(), and lPrintTypeQualifiers().
#define TYPEQUAL_NOINLINE (1 << 9) |
Definition at line 77 of file decl.h.
Referenced by Declaration::DeclareFunctions().
#define TYPEQUAL_SIGNED (1 << 4) |
Definition at line 72 of file decl.h.
Referenced by lApplyTypeQualifiers(), and lPrintTypeQualifiers().
#define TYPEQUAL_TASK (1 << 3) |
Definition at line 71 of file decl.h.
Referenced by Declarator::InitFromType(), and lPrintTypeQualifiers().
#define TYPEQUAL_UNIFORM (1 << 1) |
Definition at line 69 of file decl.h.
Referenced by DeclSpecs::DeclSpecs(), GetStructTypesNamesPositions(), Declarator::InitFromType(), lApplyTypeQualifiers(), lPrintTypeQualifiers(), and NewExpr::NewExpr().
#define TYPEQUAL_UNMASKED (1 << 8) |
Definition at line 76 of file decl.h.
Referenced by Declarator::InitFromType(), and lPrintTypeQualifiers().
#define TYPEQUAL_UNSIGNED (1 << 5) |
Definition at line 73 of file decl.h.
Referenced by lApplyTypeQualifiers(), and lPrintTypeQualifiers().
#define TYPEQUAL_VARYING (1 << 2) |
Definition at line 70 of file decl.h.
Referenced by DeclSpecs::DeclSpecs(), GetStructTypesNamesPositions(), Declarator::InitFromType(), lApplyTypeQualifiers(), lPrintTypeQualifiers(), and NewExpr::NewExpr().
enum DeclaratorKind |
void GetStructTypesNamesPositions | ( | const std::vector< StructDeclaration *> & | sd, |
llvm::SmallVector< const Type *, 8 > * | elementTypes, | ||
llvm::SmallVector< std::string, 8 > * | elementNames, | ||
llvm::SmallVector< SourcePos, 8 > * | elementPositions | ||
) |
Given a set of StructDeclaration instances, this returns the types of the elements of the corresponding struct and their names.
Definition at line 669 of file decl.cpp.
References Error(), ArrayType::GetElementCount(), Type::GetSOAWidth(), Declarator::InitFromDeclSpecs(), Type::IsUniformType(), Type::IsVaryingType(), Type::IsVoidType(), Declarator::name, Declarator::pos, DeclSpecs::soaWidth, Declarator::type, TYPEQUAL_UNIFORM, TYPEQUAL_VARYING, and DeclSpecs::typeQualifiers.