comma::SubroutineDecl Class Reference

#include <Decl.h>

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

List of all members.

Public Member Functions

virtual ~SubroutineDecl ()
unsigned getArity () const
 Returns the number of parameters this subroutine accepts.
ParamValueDeclgetParam (unsigned i)
 Returns the i'th parameters declaration node.
const ParamValueDeclgetParam (unsigned i) const
 Returns the i'th parameters declaration node.
TypegetParamType (unsigned i) const
 Returns the type of the i'th parameter.
PM::ParameterMode getParamMode (unsigned i) const
PM::ParameterMode getExplicitParamMode (unsigned i) const
 Returns the i'th parameter mode for this type.
IdentifierInfogetParamKeyword (unsigned i) const
 Returns the i'th argument keyword.
int getKeywordIndex (IdentifierInfo *key) const
int getKeywordIndex (KeywordSelector *key) const
bool keywordsMatch (const SubroutineDecl *SRDecl) const
bool paramModesMatch (const SubroutineDecl *SRDecl) const
void setDefiningDeclaration (SubroutineDecl *routineDecl)
bool hasDefiningDeclaration () const
SubroutineDeclgetDefiningDeclaration ()
const SubroutineDeclgetDefiningDeclaration () const
SubroutineDeclgetForwardDeclaration ()
const SubroutineDeclgetForwardDeclaration () const
const bool hasForwardDeclaration () const
const bool isForwardDeclaration () const
bool hasBody () const
void setBody (BlockStmt *block)
BlockStmtgetBody ()
const BlockStmtgetBody () const
bool isPrimitive () const
 Returns true if this subroutine represents a primitive operation.
void setAsPrimitive (PO::PrimitiveID ID)
 Marks this declaration as primitive.
PO::PrimitiveID getPrimitiveID () const
 Returns the PrimitiveID of this subroutine.
void attachPragma (Pragma *P)
const PragmafindPragma (pragma::PragmaID ID) const
 Returns the first pragma attached to this declaration with the given ID.
bool hasPragma (pragma::PragmaID ID) const

Static Public Member Functions

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

Protected Types

enum  DeclLinkTag { FORWARD_TAG, DEFINITION_TAG }
 

Enumeration used to tag the declaration link.

More...

Protected Member Functions

 SubroutineDecl (AstKind kind, IdentifierInfo *name, Location loc, ParamValueDecl **params, unsigned numParams, DeclRegion *parent)
 SubroutineDecl (AstKind kind, IdentifierInfo *name, Location loc, IdentifierInfo **keywords, SubroutineType *type, DeclRegion *parent)
 SubroutineDecl (AstKind kind, IdentifierInfo *name, Location loc, DeclRegion *parent)

Protected Attributes

PO::PrimitiveID opID: 8
 Identifies the type of operation.
unsigned numParameters
ParamValueDecl ** parameters
BlockStmtbody
llvm::PointerIntPair
< SubroutineDecl
*, 1, DeclLinkTag
declarationLink
llvm::iplist< Pragmapragmas

Parameter Iterators



typedef ParamValueDecl ** param_iterator
typedef ParamValueDecl *const * const_param_iterator
param_iterator begin_params ()
param_iterator end_params ()
const_param_iterator begin_params () const
const_param_iterator end_params () const



typedef llvm::iplist< Pragma >
::iterator 
pragma_iterator
 Iterators over the attached set of pragmas.
typedef llvm::iplist< Pragma >
::const_iterator 
const_pragma_iterator
 Iterators over the attached set of pragmas.
virtual SubroutineTypegetType ()=0
 Returns the type of this declaration.
virtual const SubroutineTypegetType () const =0
 Iterators over the attached set of pragmas.
SubroutineDeclgetOrigin ()
 Specialization of Decl::getOrigin().
const SubroutineDeclgetOrigin () const
 Iterators over the attached set of pragmas.
SubroutineDeclresolveOrigin ()
 Specialization of Decl::resolveOrigin().
const SubroutineDeclresolveOrigin () const
 Iterators over the attached set of pragmas.
pragma_iterator begin_pragmas ()
 Iterators over the attached set of pragmas.
pragma_iterator end_pragmas ()
 Iterators over the attached set of pragmas.
const_pragma_iterator begin_pragmas () const
 Iterators over the attached set of pragmas.
const_pragma_iterator end_pragmas () const
 Iterators over the attached set of pragmas.

Detailed Description

Definition at line 855 of file Decl.h.


Member Typedef Documentation

Definition at line 949 of file Decl.h.

typedef llvm::iplist<Pragma>::const_iterator comma::SubroutineDecl::const_pragma_iterator

Iterators over the attached set of pragmas.

Definition at line 1025 of file Decl.h.

Definition at line 945 of file Decl.h.

typedef llvm::iplist<Pragma>::iterator comma::SubroutineDecl::pragma_iterator

Iterators over the attached set of pragmas.

Definition at line 1021 of file Decl.h.


Member Enumeration Documentation

Enumeration used to tag the declaration link.

Enumerator:
FORWARD_TAG 
DEFINITION_TAG 

Definition at line 1057 of file Decl.h.


Constructor & Destructor Documentation

SubroutineDecl::~SubroutineDecl (  )  [virtual]

Definition at line 459 of file Decl.cpp.

SubroutineDecl::SubroutineDecl ( AstKind  kind,
IdentifierInfo name,
Location  loc,
ParamValueDecl **  params,
unsigned  numParams,
DeclRegion parent 
) [protected]

Definition at line 397 of file Decl.cpp.

SubroutineDecl::SubroutineDecl ( AstKind  kind,
IdentifierInfo name,
Location  loc,
IdentifierInfo **  keywords,
SubroutineType type,
DeclRegion parent 
) [protected]

Definition at line 421 of file Decl.cpp.

SubroutineDecl::SubroutineDecl ( AstKind  kind,
IdentifierInfo name,
Location  loc,
DeclRegion parent 
) [protected]

Definition at line 446 of file Decl.cpp.


Member Function Documentation

void comma::SubroutineDecl::attachPragma ( Pragma P  )  [inline]

Associates the given pragma with this declaration. The declaration node takes ownership of the supplied pragma.

Definition at line 1010 of file Decl.h.

const_param_iterator comma::SubroutineDecl::begin_params (  )  const [inline]

Definition at line 950 of file Decl.h.

param_iterator comma::SubroutineDecl::begin_params (  )  [inline]

Definition at line 946 of file Decl.h.

const_pragma_iterator comma::SubroutineDecl::begin_pragmas (  )  const [inline]

Iterators over the attached set of pragmas.

Definition at line 1026 of file Decl.h.

pragma_iterator comma::SubroutineDecl::begin_pragmas (  )  [inline]

Iterators over the attached set of pragmas.

Definition at line 1022 of file Decl.h.

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

Reimplemented from comma::Decl.

Reimplemented in comma::FunctionAttribDecl, comma::PosAD, comma::ValAD, comma::ProcedureDecl, comma::FunctionDecl, and comma::EnumLiteral.

Definition at line 1032 of file Decl.h.

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

Support isa and dyn_cast.

Reimplemented from comma::Decl.

Reimplemented in comma::FunctionAttribDecl, comma::PosAD, comma::ValAD, comma::ProcedureDecl, comma::FunctionDecl, and comma::EnumLiteral.

Definition at line 1031 of file Decl.h.

const_param_iterator comma::SubroutineDecl::end_params (  )  const [inline]

Definition at line 951 of file Decl.h.

param_iterator comma::SubroutineDecl::end_params (  )  [inline]

Definition at line 947 of file Decl.h.

const_pragma_iterator comma::SubroutineDecl::end_pragmas (  )  const [inline]

Iterators over the attached set of pragmas.

Definition at line 1027 of file Decl.h.

pragma_iterator comma::SubroutineDecl::end_pragmas (  )  [inline]

Iterators over the attached set of pragmas.

Definition at line 1023 of file Decl.h.

const Pragma * SubroutineDecl::findPragma ( pragma::PragmaID  ID  )  const

Returns the first pragma attached to this declaration with the given ID.

Definition at line 540 of file Decl.cpp.

unsigned comma::SubroutineDecl::getArity (  )  const [inline]

Returns the number of parameters this subroutine accepts.

Definition at line 867 of file Decl.h.

const BlockStmt* comma::SubroutineDecl::getBody (  )  const [inline]

Definition at line 995 of file Decl.h.

BlockStmt * SubroutineDecl::getBody (  ) 

Definition at line 529 of file Decl.cpp.

const SubroutineDecl* comma::SubroutineDecl::getDefiningDeclaration (  )  const [inline]

Reimplemented in comma::ProcedureDecl, and comma::FunctionDecl.

Definition at line 966 of file Decl.h.

SubroutineDecl* comma::SubroutineDecl::getDefiningDeclaration (  )  [inline]

Reimplemented in comma::ProcedureDecl, and comma::FunctionDecl.

Definition at line 960 of file Decl.h.

PM::ParameterMode comma::SubroutineDecl::getExplicitParamMode ( unsigned  i  )  const [inline]

Returns the i'th parameter mode for this type.

Definition at line 895 of file Decl.h.

const SubroutineDecl* comma::SubroutineDecl::getForwardDeclaration (  )  const [inline]

Reimplemented in comma::ProcedureDecl, and comma::FunctionDecl.

Definition at line 978 of file Decl.h.

SubroutineDecl* comma::SubroutineDecl::getForwardDeclaration (  )  [inline]

Reimplemented in comma::ProcedureDecl, and comma::FunctionDecl.

Definition at line 972 of file Decl.h.

int SubroutineDecl::getKeywordIndex ( KeywordSelector key  )  const

If the KeywordSelector key names an argument keyword, return its associated index, else return -1.

Definition at line 477 of file Decl.cpp.

int SubroutineDecl::getKeywordIndex ( IdentifierInfo key  )  const

If key names an argument keyword, return its associated index, else return -1.

Definition at line 468 of file Decl.cpp.

const SubroutineDecl* comma::SubroutineDecl::getOrigin (  )  const [inline]

Iterators over the attached set of pragmas.

Reimplemented from comma::Decl.

Definition at line 927 of file Decl.h.

SubroutineDecl* comma::SubroutineDecl::getOrigin (  )  [inline]

Specialization of Decl::getOrigin().

Reimplemented from comma::Decl.

Definition at line 924 of file Decl.h.

const ParamValueDecl* comma::SubroutineDecl::getParam ( unsigned  i  )  const [inline]

Returns the i'th parameters declaration node.

Definition at line 876 of file Decl.h.

ParamValueDecl* comma::SubroutineDecl::getParam ( unsigned  i  )  [inline]

Returns the i'th parameters declaration node.

Definition at line 870 of file Decl.h.

IdentifierInfo* comma::SubroutineDecl::getParamKeyword ( unsigned  i  )  const [inline]

Returns the i'th argument keyword.

Definition at line 900 of file Decl.h.

PM::ParameterMode comma::SubroutineDecl::getParamMode ( unsigned  i  )  const [inline]

Returns the i'th parameter mode.

Parameters with MODE_DEFAULT are automatically converted to MODE_IN (if this conversion is undesirable use getExplicitParameterMode instead).

Definition at line 890 of file Decl.h.

Type* comma::SubroutineDecl::getParamType ( unsigned  i  )  const [inline]

Returns the type of the i'th parameter.

Definition at line 882 of file Decl.h.

PO::PrimitiveID comma::SubroutineDecl::getPrimitiveID (  )  const [inline]

Returns the PrimitiveID of this subroutine.

Definition at line 1006 of file Decl.h.

virtual const SubroutineType* comma::SubroutineDecl::getType (  )  const [pure virtual]

Iterators over the attached set of pragmas.

Implemented in comma::ProcedureDecl, and comma::FunctionDecl.

virtual SubroutineType* comma::SubroutineDecl::getType (  )  [pure virtual]

Returns the type of this declaration.

Implemented in comma::ProcedureDecl, and comma::FunctionDecl.

bool SubroutineDecl::hasBody (  )  const

Definition at line 524 of file Decl.cpp.

bool comma::SubroutineDecl::hasDefiningDeclaration (  )  const [inline]

Definition at line 956 of file Decl.h.

const bool comma::SubroutineDecl::hasForwardDeclaration (  )  const [inline]

Definition at line 984 of file Decl.h.

bool comma::SubroutineDecl::hasPragma ( pragma::PragmaID  ID  )  const [inline]

Returns true if a pragma with the given ID has been assoiated with this declaration.

Definition at line 1017 of file Decl.h.

const bool comma::SubroutineDecl::isForwardDeclaration (  )  const [inline]

Definition at line 988 of file Decl.h.

bool comma::SubroutineDecl::isPrimitive (  )  const [inline]

Returns true if this subroutine represents a primitive operation.

Definition at line 1000 of file Decl.h.

bool SubroutineDecl::keywordsMatch ( const SubroutineDecl SRDecl  )  const

Returns true if the keywords of the declaration match exactly those of this one. The arity of both subroutines must match for this function to return true.

Definition at line 482 of file Decl.cpp.

bool SubroutineDecl::paramModesMatch ( const SubroutineDecl SRDecl  )  const

Returns true if the parameter modes of the given declaration match those of this one. The arity of both subroutines must match of this function to return true.

Definition at line 494 of file Decl.cpp.

const SubroutineDecl* comma::SubroutineDecl::resolveOrigin (  )  const [inline]

Iterators over the attached set of pragmas.

Reimplemented from comma::Decl.

Definition at line 937 of file Decl.h.

SubroutineDecl* comma::SubroutineDecl::resolveOrigin (  )  [inline]

Specialization of Decl::resolveOrigin().

Reimplemented from comma::Decl.

Definition at line 934 of file Decl.h.

void comma::SubroutineDecl::setAsPrimitive ( PO::PrimitiveID  ID  )  [inline]

Marks this declaration as primitive.

Definition at line 1003 of file Decl.h.

void comma::SubroutineDecl::setBody ( BlockStmt block  )  [inline]

Definition at line 993 of file Decl.h.

void SubroutineDecl::setDefiningDeclaration ( SubroutineDecl routineDecl  ) 

Definition at line 506 of file Decl.cpp.


Member Data Documentation

Definition at line 1054 of file Decl.h.

llvm::PointerIntPair<SubroutineDecl*, 1, DeclLinkTag> comma::SubroutineDecl::declarationLink [protected]

Definition at line 1062 of file Decl.h.

Definition at line 1052 of file Decl.h.

Identifies the type of operation.

Definition at line 1050 of file Decl.h.

Definition at line 1053 of file Decl.h.

llvm::iplist<Pragma> comma::SubroutineDecl::pragmas [protected]

Definition at line 1063 of file Decl.h.


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

Generated on 1 Feb 2010 for Comma by  doxygen 1.6.1

Rabisu Mirror Service We provide mirrors to support Open source communities. Our mirror server is located in Istanbul/Turkey region.

Please do not hesitate to contact mirror@rabisu.com for new open source mirror submissions.