comma::ArrayType Class Reference

#include <Type.h>

Inheritance diagram for comma::ArrayType:
Inheritance graph
[legend]
Collaboration diagram for comma::ArrayType:
Collaboration graph
[legend]

List of all members.

Public Member Functions

IdentifierInfogetIdInfo () const
 Returns the identifier associated with this array type.
unsigned getRank () const
 Returns the rank (dimensionality) of this array type.
bool isVector () const
 Returns true if this is a vector type (an array of rank 1).
uint64_t length () const
TypegetComponentType () const
 Returns the component type of this array.
bool isConstrained () const
 Returns true if this type is constrained.
bool isStaticallyConstrained () const
 Returns true if this array type is statically constrained.



const DiscreteTypegetIndexType (unsigned i) const
 Returns the i'th index type of this array.
DiscreteTypegetIndexType (unsigned i)
 Returns the i'th index type of this array.
ArrayTypegetRootType ()
 Specialize PrimaryType::getRootType().
const ArrayTypegetRootType () const
 Returns the i'th index type of this array.
const ArrayDeclgetDefiningDecl () const
 Returns the declaration defining this array type.
ArrayDeclgetDefiningDecl ()
 Returns the i'th index type of this array.

Static Public Member Functions

static bool classof (const ArrayType *node)
 Support isa and dyn_cast.
static bool classof (const Ast *node)

Friends

class AstResource

Index Type Iterators.

Iterators over the index types of this array.



typedef IndexVec::iterator iterator
typedef IndexVec::const_iterator const_iterator
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const

Detailed Description

Definition at line 1022 of file Type.h.


Member Typedef Documentation

typedef IndexVec::const_iterator comma::ArrayType::const_iterator

Definition at line 1055 of file Type.h.

typedef IndexVec::iterator comma::ArrayType::iterator

Definition at line 1051 of file Type.h.


Member Function Documentation

const_iterator comma::ArrayType::begin (  )  const [inline]

Definition at line 1056 of file Type.h.

iterator comma::ArrayType::begin (  )  [inline]

Definition at line 1052 of file Type.h.

static bool comma::ArrayType::classof ( const Ast node  )  [inline, static]

Reimplemented from comma::CompositeType.

Definition at line 1091 of file Type.h.

static bool comma::ArrayType::classof ( const ArrayType node  )  [inline, static]

Support isa and dyn_cast.

Reimplemented from comma::CompositeType.

Definition at line 1090 of file Type.h.

const_iterator comma::ArrayType::end (  )  const [inline]

Definition at line 1057 of file Type.h.

iterator comma::ArrayType::end (  )  [inline]

Definition at line 1053 of file Type.h.

Type* comma::ArrayType::getComponentType (  )  const [inline]

Returns the component type of this array.

Definition at line 1061 of file Type.h.

ArrayDecl* comma::ArrayType::getDefiningDecl (  )  [inline]

Returns the i'th index type of this array.

Definition at line 1084 of file Type.h.

const ArrayDecl* comma::ArrayType::getDefiningDecl (  )  const [inline]

Returns the declaration defining this array type.

Definition at line 1081 of file Type.h.

IdentifierInfo * ArrayType::getIdInfo (  )  const

Returns the identifier associated with this array type.

Definition at line 1121 of file Type.cpp.

DiscreteType* comma::ArrayType::getIndexType ( unsigned  i  )  [inline]

Returns the i'th index type of this array.

Definition at line 1044 of file Type.h.

const DiscreteType* comma::ArrayType::getIndexType ( unsigned  i  )  const [inline]

Returns the i'th index type of this array.

Definition at line 1043 of file Type.h.

unsigned comma::ArrayType::getRank (  )  const [inline]

Returns the rank (dimensionality) of this array type.

Definition at line 1032 of file Type.h.

const ArrayType* comma::ArrayType::getRootType (  )  const [inline]

Returns the i'th index type of this array.

Reimplemented from comma::PrimaryType.

Definition at line 1074 of file Type.h.

ArrayType* comma::ArrayType::getRootType (  )  [inline]

Specialize PrimaryType::getRootType().

Reimplemented from comma::PrimaryType.

Definition at line 1071 of file Type.h.

bool comma::ArrayType::isConstrained (  )  const [inline, virtual]

Returns true if this type is constrained.

Reimplemented from comma::PrimaryType.

Definition at line 1064 of file Type.h.

bool ArrayType::isStaticallyConstrained (  )  const

Returns true if this array type is statically constrained.

Definition at line 1153 of file Type.cpp.

bool comma::ArrayType::isVector (  )  const [inline]

Returns true if this is a vector type (an array of rank 1).

Definition at line 1035 of file Type.h.

uint64_t ArrayType::length (  )  const

Return the length of the first dimension. This operation is valid only if this is a statically constrained array type.

FIXME: There is an problem with overflow here when the bounds are at the limit for a signed 64 bit integer. One solution is to have this method return an APInt. Another is to make the length undefined for arrays with a null index and return a "zero based" result.

Definition at line 1129 of file Type.cpp.


Friends And Related Function Documentation

friend class AstResource [friend]

Definition at line 1107 of file Type.h.


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

Generated on 1 Feb 2010 for Comma by  doxygen 1.6.1