comma::EnumerationType Class Reference

#include <Type.h>

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

List of all members.

Public Member Functions

virtual ~EnumerationType ()
void getLowerLimit (llvm::APInt &res) const
void getUpperLimit (llvm::APInt &res) const
uint64_t getSize () const
uint64_t getNumLiterals () const
 Returns the number of literals in this enumeration type.
bool isCharacterType () const
 Returns true if this enumeration type is a character type.
bool isConstrained () const
 Returns true if this type is constrained.
PosADgetPosAttribute ()
ValADgetValAttribute ()
EnumKind getEnumKind () const
 Returns the EnumKind of this node. For internal use only.



RangegetConstraint ()
const RangegetConstraint () const
EnumerationTypegetRootType ()
 Specialize PrimaryType::getRootType().
const EnumerationTypegetRootType () const
EnumerationTypegetBaseSubtype ()
 Returns the base (unconstrained) subtype of this enumeration type.
const EnumerationTypegetBaseSubtype () const
const EnumerationDeclgetDefiningDecl () const
 Returns the underlying enumeration declaration for this type.
EnumerationDeclgetDefiningDecl ()

Static Public Member Functions

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

Protected Types

enum  EnumKind { RootEnumType_KIND, UnconstrainedEnumType_KIND, ConstrainedEnumType_KIND }
 

EnumerationType nodes are implemented using three internal classes.

More...

Protected Member Functions

 EnumerationType (EnumKind kind, EnumerationType *rootOrParent)
 Constructor for the internal subclasses (not for use by AstResource).

Static Protected Member Functions

static bool isSubtypeKind (EnumKind kind)
 Returns true if the given kind denotes a subtype.

Friends

class AstResource

Detailed Description

Definition at line 736 of file Type.h.


Member Enumeration Documentation

EnumerationType nodes are implemented using three internal classes.

Enumerator:
RootEnumType_KIND 
UnconstrainedEnumType_KIND 
ConstrainedEnumType_KIND 

Definition at line 836 of file Type.h.


Constructor & Destructor Documentation

virtual comma::EnumerationType::~EnumerationType (  )  [inline, virtual]

Definition at line 739 of file Type.h.

comma::EnumerationType::EnumerationType ( EnumKind  kind,
EnumerationType rootOrParent 
) [inline, protected]

Constructor for the internal subclasses (not for use by AstResource).

Definition at line 849 of file Type.h.


Member Function Documentation

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

Reimplemented from comma::DiscreteType.

Definition at line 806 of file Type.h.

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

Support isa and dyn_cast.

Reimplemented from comma::DiscreteType.

Definition at line 805 of file Type.h.

const EnumerationType * EnumerationType::getBaseSubtype (  )  const

Returns the constraint associated with this enumeration or null if this is an unconstrained type.

Definition at line 765 of file Type.cpp.

EnumerationType * EnumerationType::getBaseSubtype (  ) 

Returns the base (unconstrained) subtype of this enumeration type.

Definition at line 770 of file Type.cpp.

const Range * EnumerationType::getConstraint (  )  const [virtual]

Returns the constraint associated with this enumeration or null if this is an unconstrained type.

Implements comma::DiscreteType.

Definition at line 743 of file Type.cpp.

Range * EnumerationType::getConstraint (  )  [virtual]

Returns the constraint associated with this enumeration or null if this is an unconstrained type.

Implements comma::DiscreteType.

Definition at line 736 of file Type.cpp.

EnumerationDecl * EnumerationType::getDefiningDecl (  ) 

Returns the constraint associated with this enumeration or null if this is an unconstrained type.

Definition at line 720 of file Type.cpp.

const EnumerationDecl* comma::EnumerationType::getDefiningDecl (  )  const [inline]

Returns the underlying enumeration declaration for this type.

Definition at line 790 of file Type.h.

EnumKind comma::EnumerationType::getEnumKind (  )  const [inline]

Returns the EnumKind of this node. For internal use only.

Definition at line 856 of file Type.h.

void EnumerationType::getLowerLimit ( llvm::APInt &  res  )  const [virtual]

Returns the lower limit for this type.

See also:
DiscreteType::getLowerLimit().

Implements comma::DiscreteType.

Definition at line 750 of file Type.cpp.

uint64_t EnumerationType::getNumLiterals (  )  const

Returns the number of literals in this enumeration type.

Definition at line 731 of file Type.cpp.

PosAD * EnumerationType::getPosAttribute (  )  [virtual]

Returns the declaration corresponding to the Pos attribute for this type.

Implements comma::DiscreteType.

Definition at line 777 of file Type.cpp.

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

Returns the constraint associated with this enumeration or null if this is an unconstrained type.

Reimplemented from comma::DiscreteType.

Definition at line 777 of file Type.h.

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

Specialize PrimaryType::getRootType().

Reimplemented from comma::DiscreteType.

Definition at line 774 of file Type.h.

uint64_t EnumerationType::getSize (  )  const [virtual]

Returns the number of bits needed to represent this type.

See also:
DiscreteType::getSize().

Implements comma::DiscreteType.

Definition at line 760 of file Type.cpp.

void EnumerationType::getUpperLimit ( llvm::APInt &  res  )  const [virtual]

Returns the upper limit for this type.

See also:
DiscreteType::getUpperLimit().

Implements comma::DiscreteType.

Definition at line 755 of file Type.cpp.

ValAD * EnumerationType::getValAttribute (  )  [virtual]

Returns the declaration corresponding to the Val attribute for this type.

Implements comma::DiscreteType.

Definition at line 783 of file Type.cpp.

bool EnumerationType::isCharacterType (  )  const

Returns true if this enumeration type is a character type.

Definition at line 726 of file Type.cpp.

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

Returns true if this type is constrained.

Reimplemented from comma::PrimaryType.

Definition at line 763 of file Type.h.

static bool comma::EnumerationType::isSubtypeKind ( EnumKind  kind  )  [inline, static, protected]

Returns true if the given kind denotes a subtype.

Definition at line 843 of file Type.h.


Friends And Related Function Documentation

friend class AstResource [friend]

Definition at line 829 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