comma::IntegerType Class Reference

#include <Type.h>

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

List of all members.

Public Member Functions

virtual ~IntegerType ()
void getLowerLimit (llvm::APInt &res) const
void getUpperLimit (llvm::APInt &res) const
bool baseContains (const llvm::APInt &value) const
uint64_t getSize () const
bool isConstrained () const
 Returns true if this type is constrained.
PosADgetPosAttribute ()
ValADgetValAttribute ()
IntegerKind getIntegerKind () const
 Returns the IntegerKind of this node. For internal use only.

Static Public Member Functions

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

Protected Types

enum  IntegerKind { RootIntegerType_KIND, UnconstrainedIntegerType_KIND, ConstrainedIntegerType_KIND }

Protected Member Functions

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

Static Protected Member Functions

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

Friends

class AstResource



const IntegerTypegetBaseSubtype () const
 Returns the base subtype.
IntegerTypegetBaseSubtype ()
 Returns the base subtype.
RangegetConstraint ()
 Returns the Range associated with this IntegerType, or null if this is an unconstrained type.
const RangegetConstraint () const
 Returns the base subtype.
IntegerTypegetRootType ()
 Specialize PrimaryType::getRootType().
const IntegerTypegetRootType () const
 Returns the base subtype.

Detailed Description

Definition at line 864 of file Type.h.


Member Enumeration Documentation

IntegerType nodes are implemented using three internal classes represeting the root, constrained, and unconstrained cases. The following enumeration identifies each of these classes and is encoded into the AST::bits field.

Enumerator:
RootIntegerType_KIND 
UnconstrainedIntegerType_KIND 
ConstrainedIntegerType_KIND 

Definition at line 973 of file Type.h.


Constructor & Destructor Documentation

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

Definition at line 867 of file Type.h.

comma::IntegerType::IntegerType ( IntegerKind  kind,
IntegerType rootOrParent 
) [inline, protected]

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

Definition at line 986 of file Type.h.


Member Function Documentation

bool IntegerType::baseContains ( const llvm::APInt &  value  )  const

Returns true if the base integer type can represent the given value (interpreted as signed).

Definition at line 1040 of file Type.cpp.

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

Reimplemented from comma::DiscreteType.

Definition at line 929 of file Type.h.

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

Support isa and dyn_cast.

Reimplemented from comma::DiscreteType.

Definition at line 928 of file Type.h.

IntegerType * IntegerType::getBaseSubtype (  ) 

Returns the base subtype.

The base subtype is a distinguished unconstrained subtype corresponding to the attribute S'Base.

Definition at line 1009 of file Type.cpp.

const IntegerType* comma::IntegerType::getBaseSubtype (  )  const [inline]

Returns the base subtype.

The base subtype is a distinguished unconstrained subtype corresponding to the attribute S'Base.

Definition at line 893 of file Type.h.

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

Returns the base subtype.

The base subtype is a distinguished unconstrained subtype corresponding to the attribute S'Base.

Implements comma::DiscreteType.

Definition at line 1022 of file Type.cpp.

Range * IntegerType::getConstraint (  )  [virtual]

Returns the Range associated with this IntegerType, or null if this is an unconstrained type.

Implements comma::DiscreteType.

Definition at line 1015 of file Type.cpp.

IntegerKind comma::IntegerType::getIntegerKind (  )  const [inline]

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

Definition at line 993 of file Type.h.

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

Returns the lower limit for this type.

See also:
DiscreteType::getLowerLimit().

Implements comma::DiscreteType.

Definition at line 1028 of file Type.cpp.

PosAD * IntegerType::getPosAttribute (  )  [virtual]

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

Implements comma::DiscreteType.

Definition at line 1073 of file Type.cpp.

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

Returns the base subtype.

The base subtype is a distinguished unconstrained subtype corresponding to the attribute S'Base.

Reimplemented from comma::DiscreteType.

Definition at line 914 of file Type.h.

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

Specialize PrimaryType::getRootType().

Reimplemented from comma::DiscreteType.

Definition at line 911 of file Type.h.

uint64_t IntegerType::getSize (  )  const [virtual]

Returns the number of bits needed to represent this type.

See also:
DiscreteType::getSize();

Implements comma::DiscreteType.

Definition at line 1067 of file Type.cpp.

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

Returns the upper limit for this type.

See also:
DiscreteType::getUpperLimit().

Implements comma::DiscreteType.

Definition at line 1034 of file Type.cpp.

ValAD * IntegerType::getValAttribute (  )  [virtual]

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

Implements comma::DiscreteType.

Definition at line 1078 of file Type.cpp.

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

Returns true if this type is constrained.

Reimplemented from comma::PrimaryType.

Definition at line 900 of file Type.h.

static bool comma::IntegerType::isSubtypeKind ( IntegerKind  kind  )  [inline, static, protected]

Returns true if the given kind denotes a subtype.

Definition at line 980 of file Type.h.


Friends And Related Function Documentation

friend class AstResource [friend]

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