clang  6.0.0svn
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::DeclaratorChunk Struct Reference

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

#include "clang/Sema/DeclSpec.h"

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

Classes

struct  ArrayTypeInfo
 
struct  BlockPointerTypeInfo
 
struct  FunctionTypeInfo
 
struct  MemberPointerTypeInfo
 
struct  ParamInfo
 ParamInfo - An array of paraminfo objects is allocated whenever a function declarator is parsed. More...
 
struct  PipeTypeInfo
 
struct  PointerTypeInfo
 
struct  ReferenceTypeInfo
 
struct  TypeAndRange
 
struct  TypeInfoCommon
 

Public Types

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

Public Member Functions

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

Static Public Member Functions

static DeclaratorChunk getPointer (unsigned TypeQuals, SourceLocation Loc, SourceLocation ConstQualLoc, SourceLocation VolatileQualLoc, SourceLocation RestrictQualLoc, SourceLocation AtomicQualLoc, SourceLocation UnalignedQualLoc)
 Return a DeclaratorChunk for a pointer. More...
 
static DeclaratorChunk getReference (unsigned TypeQuals, SourceLocation Loc, bool lvalue)
 Return a DeclaratorChunk for a reference. More...
 
static DeclaratorChunk getArray (unsigned TypeQuals, bool isStatic, bool isStar, Expr *NumElts, SourceLocation LBLoc, SourceLocation RBLoc)
 Return a DeclaratorChunk for an array. More...
 
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, SourceRange ESpecRange, ParsedType *Exceptions, SourceRange *ExceptionRanges, unsigned NumExceptions, Expr *NoexceptExpr, CachedTokens *ExceptionSpecTokens, ArrayRef< NamedDecl *> DeclsInPrototype, SourceLocation LocalRangeBegin, SourceLocation LocalRangeEnd, Declarator &TheDeclarator, TypeResult TrailingReturnType=TypeResult())
 DeclaratorChunk::getFunction - Return a DeclaratorChunk for a function. More...
 
static DeclaratorChunk getBlockPointer (unsigned TypeQuals, SourceLocation Loc)
 Return a DeclaratorChunk for a block. More...
 
static DeclaratorChunk getPipe (unsigned TypeQuals, SourceLocation Loc)
 Return a DeclaratorChunk for a block. More...
 
static DeclaratorChunk getMemberPointer (const CXXScopeSpec &SS, unsigned TypeQuals, SourceLocation Loc)
 
static DeclaratorChunk getParen (SourceLocation LParenLoc, SourceLocation RParenLoc)
 Return a DeclaratorChunk for a paren. More...
 

Public Attributes

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

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 1134 of file DeclSpec.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Pointer 
Reference 
Array 
Function 
BlockPointer 
MemberPointer 
Paren 
Pipe 

Definition at line 1135 of file DeclSpec.h.

Member Function Documentation

◆ destroy()

void clang::DeclaratorChunk::destroy ( )
inline

Definition at line 1510 of file DeclSpec.h.

References Array, BlockPointer, Function, MemberPointer, Paren, Pipe, Pointer, and Reference.

◆ getArray()

static DeclaratorChunk clang::DeclaratorChunk::getArray ( unsigned  TypeQuals,
bool  isStatic,
bool  isStar,
Expr NumElts,
SourceLocation  LBLoc,
SourceLocation  RBLoc 
)
inlinestatic

Return a DeclaratorChunk for an array.

Definition at line 1566 of file DeclSpec.h.

Referenced by clang::Parser::ParseUnqualifiedId().

◆ getAttrListRef()

AttributeList*& clang::DeclaratorChunk::getAttrListRef ( )
inline

◆ getAttrs()

const AttributeList* clang::DeclaratorChunk::getAttrs ( ) const
inline

If there are attributes applied to this declaratorchunk, return them.

Definition at line 1525 of file DeclSpec.h.

Referenced by clang::Sema::checkUnusedDeclAttributes(), inferARCWriteback(), takeDeclAttributes(), and transferARCOwnershipToDeclaratorChunk().

◆ getBlockPointer()

static DeclaratorChunk clang::DeclaratorChunk::getBlockPointer ( unsigned  TypeQuals,
SourceLocation  Loc 
)
inlinestatic

Return a DeclaratorChunk for a block.

Definition at line 1611 of file DeclSpec.h.

Referenced by isPipeDeclerator().

◆ getFunction()

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,
SourceRange  ESpecRange,
ParsedType Exceptions,
SourceRange ExceptionRanges,
unsigned  NumExceptions,
Expr NoexceptExpr,
CachedTokens ExceptionSpecTokens,
ArrayRef< NamedDecl *>  DeclsInPrototype,
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 152 of file DeclSpec.cpp.

References clang::DeclSpec::TQ_atomic.

Referenced by addConstexprToLambdaDeclSpecifier(), and maybeSynthesizeBlockSignature().

◆ getMemberPointer()

static DeclaratorChunk clang::DeclaratorChunk::getMemberPointer ( const CXXScopeSpec SS,
unsigned  TypeQuals,
SourceLocation  Loc 
)
inlinestatic

Definition at line 1632 of file DeclSpec.h.

Referenced by isPipeDeclerator().

◆ getParen()

static DeclaratorChunk clang::DeclaratorChunk::getParen ( SourceLocation  LParenLoc,
SourceLocation  RParenLoc 
)
inlinestatic

Return a DeclaratorChunk for a paren.

Definition at line 1646 of file DeclSpec.h.

Referenced by getMissingDeclaratorIdLoc().

◆ getPipe()

static DeclaratorChunk clang::DeclaratorChunk::getPipe ( unsigned  TypeQuals,
SourceLocation  Loc 
)
inlinestatic

Return a DeclaratorChunk for a block.

Definition at line 1622 of file DeclSpec.h.

Referenced by isPipeDeclerator().

◆ getPointer()

static DeclaratorChunk clang::DeclaratorChunk::getPointer ( unsigned  TypeQuals,
SourceLocation  Loc,
SourceLocation  ConstQualLoc,
SourceLocation  VolatileQualLoc,
SourceLocation  RestrictQualLoc,
SourceLocation  AtomicQualLoc,
SourceLocation  UnalignedQualLoc 
)
inlinestatic

Return a DeclaratorChunk for a pointer.

Definition at line 1534 of file DeclSpec.h.

Referenced by isPipeDeclerator().

◆ getReference()

static DeclaratorChunk clang::DeclaratorChunk::getReference ( unsigned  TypeQuals,
SourceLocation  Loc,
bool  lvalue 
)
inlinestatic

Return a DeclaratorChunk for a reference.

Definition at line 1554 of file DeclSpec.h.

Referenced by isPipeDeclerator().

◆ getSourceRange()

SourceRange clang::DeclaratorChunk::getSourceRange ( ) const
inline

Definition at line 1144 of file DeclSpec.h.

References clang::SourceLocation::isInvalid().

◆ isParen()

bool clang::DeclaratorChunk::isParen ( ) const
inline

Definition at line 1656 of file DeclSpec.h.

References Paren.

Member Data Documentation

◆ @200

union { ... }

◆ Arr

ArrayTypeInfo clang::DeclaratorChunk::Arr

◆ Cls

BlockPointerTypeInfo clang::DeclaratorChunk::Cls

Definition at line 1505 of file DeclSpec.h.

◆ Common

TypeInfoCommon clang::DeclaratorChunk::Common

Definition at line 1500 of file DeclSpec.h.

◆ EndLoc

SourceLocation clang::DeclaratorChunk::EndLoc

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

Definition at line 1142 of file DeclSpec.h.

Referenced by warnAboutAmbiguousFunction(), and warnAboutRedundantParens().

◆ Fun

FunctionTypeInfo clang::DeclaratorChunk::Fun

◆ Kind

enum { ... } clang::DeclaratorChunk::Kind

◆ Loc

SourceLocation clang::DeclaratorChunk::Loc

Loc - The place where this type was defined.

Definition at line 1140 of file DeclSpec.h.

Referenced by clang::Sema::ActOnCXXNew(), distributeNullabilityTypeAttr(), isPipeDeclerator(), warnAboutAmbiguousFunction(), and warnAboutRedundantParens().

◆ Mem

MemberPointerTypeInfo clang::DeclaratorChunk::Mem

Definition at line 1506 of file DeclSpec.h.

◆ PipeInfo

PipeTypeInfo clang::DeclaratorChunk::PipeInfo

Definition at line 1507 of file DeclSpec.h.

◆ Ptr

PointerTypeInfo clang::DeclaratorChunk::Ptr

Definition at line 1501 of file DeclSpec.h.

Referenced by diagnoseRedundantReturnTypeQualifiers(), and fillAtomicQualLoc().

◆ Ref

ReferenceTypeInfo clang::DeclaratorChunk::Ref

Definition at line 1502 of file DeclSpec.h.


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