clang API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
clang::DeclaratorChunk Struct Reference

One instance of this struct is used for each type in a declarator that is parsed. More...

#include <DeclSpec.h>

Collaboration diagram for clang::DeclaratorChunk:
Collaboration graph
[legend]

List of all members.

Classes

struct  ArrayTypeInfo
struct  BlockPointerTypeInfo
struct  FunctionTypeInfo
struct  MemberPointerTypeInfo
struct  ParamInfo
struct  PointerTypeInfo
struct  ReferenceTypeInfo
struct  TypeAndRange
struct  TypeInfoCommon

Public Types

enum  {
  Pointer, Reference, Array, Function,
  BlockPointer, MemberPointer, Paren
}

Public Member Functions

void destroy ()
const AttributeListgetAttrs () const
 If there are attributes applied to this declaratorchunk, return them.
AttributeList *& getAttrListRef ()
bool isParen () const

Static Public Member Functions

static DeclaratorChunk getPointer (unsigned TypeQuals, SourceLocation Loc, SourceLocation ConstQualLoc, SourceLocation VolatileQualLoc, SourceLocation RestrictQualLoc)
 Return a DeclaratorChunk for a pointer.
static DeclaratorChunk getReference (unsigned TypeQuals, SourceLocation Loc, bool lvalue)
 Return a DeclaratorChunk for a reference.
static DeclaratorChunk getArray (unsigned TypeQuals, bool isStatic, bool isStar, Expr *NumElts, SourceLocation LBLoc, SourceLocation RBLoc)
 Return a DeclaratorChunk for an array.
static DeclaratorChunk getFunction (bool HasProto, bool IsAmbiguous, SourceLocation LParenLoc, ParamInfo *Params, unsigned NumParams, SourceLocation EllipsisLoc, SourceLocation RParenLoc, unsigned TypeQuals, bool RefQualifierIsLvalueRef, SourceLocation RefQualifierLoc, SourceLocation ConstQualifierLoc, SourceLocation VolatileQualifierLoc, SourceLocation RestrictQualifierLoc, SourceLocation MutableLoc, ExceptionSpecificationType ESpecType, SourceLocation ESpecLoc, ParsedType *Exceptions, SourceRange *ExceptionRanges, unsigned NumExceptions, Expr *NoexceptExpr, CachedTokens *ExceptionSpecTokens, SourceLocation LocalRangeBegin, SourceLocation LocalRangeEnd, Declarator &TheDeclarator, TypeResult TrailingReturnType=TypeResult())
static DeclaratorChunk getBlockPointer (unsigned TypeQuals, SourceLocation Loc)
 Return a DeclaratorChunk for a block.
static DeclaratorChunk getMemberPointer (const CXXScopeSpec &SS, unsigned TypeQuals, SourceLocation Loc)
static DeclaratorChunk getParen (SourceLocation LParenLoc, SourceLocation RParenLoc)
 Return a DeclaratorChunk for a paren.

Public Attributes

enum clang::DeclaratorChunk:: { ... }  Kind
SourceLocation Loc
 Loc - The place where this type was defined.
SourceLocation EndLoc
 EndLoc - If valid, the place where this chunck ends.
union {
   TypeInfoCommon   Common
   PointerTypeInfo   Ptr
   ReferenceTypeInfo   Ref
   ArrayTypeInfo   Arr
   FunctionTypeInfo   Fun
   BlockPointerTypeInfo   Cls
   MemberPointerTypeInfo   Mem
}; 

Detailed Description

One instance of this struct is used for each type in a declarator that is parsed.

This is intended to be a small value object.

Definition at line 1063 of file DeclSpec.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
Pointer 
Reference 
Array 
Function 
BlockPointer 
MemberPointer 
Paren 

Definition at line 1064 of file DeclSpec.h.


Member Function Documentation

static DeclaratorChunk clang::DeclaratorChunk::getArray ( unsigned  TypeQuals,
bool  isStatic,
bool  isStar,
Expr NumElts,
SourceLocation  LBLoc,
SourceLocation  RBLoc 
) [inline, static]
static DeclaratorChunk clang::DeclaratorChunk::getBlockPointer ( unsigned  TypeQuals,
SourceLocation  Loc 
) [inline, static]
DeclaratorChunk DeclaratorChunk::getFunction ( bool  hasProto,
bool  isAmbiguous,
SourceLocation  LParenLoc,
ParamInfo Params,
unsigned  NumParams,
SourceLocation  EllipsisLoc,
SourceLocation  RParenLoc,
unsigned  TypeQuals,
bool  RefQualifierIsLvalueRef,
SourceLocation  RefQualifierLoc,
SourceLocation  ConstQualifierLoc,
SourceLocation  VolatileQualifierLoc,
SourceLocation  RestrictQualifierLoc,
SourceLocation  MutableLoc,
ExceptionSpecificationType  ESpecType,
SourceLocation  ESpecLoc,
ParsedType Exceptions,
SourceRange ExceptionRanges,
unsigned  NumExceptions,
Expr NoexceptExpr,
CachedTokens ExceptionSpecTokens,
SourceLocation  LocalRangeBegin,
SourceLocation  LocalRangeEnd,
Declarator TheDeclarator,
TypeResult  TrailingReturnType = TypeResult() 
) [static]

DeclaratorChunk::getFunction - Return a DeclaratorChunk for a function. "TheDeclarator" is the declarator that this will be added to.

Definition at line 162 of file DeclSpec.cpp.

References clang::DeclaratorChunk::TypeInfoCommon::AttrList, clang::DeclaratorChunk::FunctionTypeInfo::ConstQualifierLoc, clang::DeclaratorChunk::FunctionTypeInfo::DeleteParams, clang::DeclaratorChunk::FunctionTypeInfo::EllipsisLoc, EndLoc, clang::EST_ComputedNoexcept, clang::EST_Dynamic, clang::EST_Unparsed, clang::DeclaratorChunk::FunctionTypeInfo::Exceptions, clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecLoc, clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecTokens, clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecType, Fun, Function, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::SourceLocation::getRawEncoding(), clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype, clang::DeclaratorChunk::FunctionTypeInfo::HasTrailingReturnType, clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous, clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::ActionResult< PtrTy, CompressInvalid >::isUsable(), clang::SourceLocation::isValid(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, Kind, Loc, clang::DeclaratorChunk::FunctionTypeInfo::LParenLoc, clang::DeclaratorChunk::FunctionTypeInfo::MutableLoc, clang::DeclaratorChunk::FunctionTypeInfo::NoexceptExpr, clang::DeclaratorChunk::FunctionTypeInfo::NumExceptions, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::DeclaratorChunk::TypeAndRange::Range, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierLoc, clang::DeclaratorChunk::FunctionTypeInfo::RestrictQualifierLoc, clang::DeclaratorChunk::FunctionTypeInfo::RParenLoc, clang::DeclSpec::TQ_atomic, clang::DeclaratorChunk::FunctionTypeInfo::TrailingReturnType, clang::DeclaratorChunk::TypeAndRange::Ty, clang::DeclaratorChunk::FunctionTypeInfo::TypeQuals, and clang::DeclaratorChunk::FunctionTypeInfo::VolatileQualifierLoc.

Referenced by clang::Sema::ImplicitlyDefineFunction(), and maybeSynthesizeBlockSignature().

static DeclaratorChunk clang::DeclaratorChunk::getMemberPointer ( const CXXScopeSpec SS,
unsigned  TypeQuals,
SourceLocation  Loc 
) [inline, static]
static DeclaratorChunk clang::DeclaratorChunk::getParen ( SourceLocation  LParenLoc,
SourceLocation  RParenLoc 
) [inline, static]

Return a DeclaratorChunk for a paren.

Definition at line 1504 of file DeclSpec.h.

References clang::DeclaratorChunk::TypeInfoCommon::AttrList, Common, EndLoc, Kind, Loc, and Paren.

static DeclaratorChunk clang::DeclaratorChunk::getPointer ( unsigned  TypeQuals,
SourceLocation  Loc,
SourceLocation  ConstQualLoc,
SourceLocation  VolatileQualLoc,
SourceLocation  RestrictQualLoc 
) [inline, static]
static DeclaratorChunk clang::DeclaratorChunk::getReference ( unsigned  TypeQuals,
SourceLocation  Loc,
bool  lvalue 
) [inline, static]

Definition at line 1514 of file DeclSpec.h.

References Paren.


Member Data Documentation

union { ... }

Definition at line 1382 of file DeclSpec.h.

Referenced by destroy(), getBlockPointer(), and GetFullTypeForDeclarator().

Definition at line 1377 of file DeclSpec.h.

Referenced by getAttrListRef(), getAttrs(), and getParen().

EndLoc - If valid, the place where this chunck ends.

Definition at line 1071 of file DeclSpec.h.

Referenced by getArray(), GetFullTypeForDeclarator(), getFunction(), getParen(), and warnAboutAmbiguousFunction().

Definition at line 1379 of file DeclSpec.h.

Referenced by destroy(), GetFullTypeForDeclarator(), and getReference().


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