clang 20.0.0git
|
One instance of this struct is used for each type in a declarator that is parsed. More...
#include "clang/Sema/DeclSpec.h"
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 |
Public Types | |
enum | { Pointer , Reference , Array , Function , BlockPointer , MemberPointer , Paren , Pipe } |
Public Member Functions | |
DeclaratorChunk () | |
SourceRange | getSourceRange () const |
void | destroy () |
const ParsedAttributesView & | getAttrs () const |
If there are attributes applied to this declaratorchunk, return them. | |
ParsedAttributesView & | getAttrs () |
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. | |
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, bool RefQualifierIsLvalueRef, SourceLocation RefQualifierLoc, 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(), SourceLocation TrailingReturnTypeLoc=SourceLocation(), DeclSpec *MethodQualifiers=nullptr) |
DeclaratorChunk::getFunction - Return a DeclaratorChunk for a function. | |
static DeclaratorChunk | getBlockPointer (unsigned TypeQuals, SourceLocation Loc) |
Return a DeclaratorChunk for a block. | |
static DeclaratorChunk | getPipe (unsigned TypeQuals, SourceLocation Loc) |
Return a DeclaratorChunk for a block. | |
static DeclaratorChunk | getMemberPointer (const CXXScopeSpec &SS, unsigned TypeQuals, SourceLocation StarLoc, SourceLocation EndLoc) |
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. | |
ParsedAttributesView | AttrList |
union { | |
PointerTypeInfo Ptr | |
ReferenceTypeInfo Ref | |
ArrayTypeInfo Arr | |
FunctionTypeInfo Fun | |
BlockPointerTypeInfo Cls | |
MemberPointerTypeInfo Mem | |
PipeTypeInfo PipeInfo | |
}; | |
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 1251 of file DeclSpec.h.
anonymous enum |
Enumerator | |
---|---|
Pointer | |
Reference | |
Array | |
Function | |
BlockPointer | |
MemberPointer | |
Paren | |
Pipe |
Definition at line 1254 of file DeclSpec.h.
|
inline |
Definition at line 1252 of file DeclSpec.h.
|
inline |
Definition at line 1648 of file DeclSpec.h.
References Arr, Array, BlockPointer, Cls, clang::DeclaratorChunk::PointerTypeInfo::destroy(), clang::DeclaratorChunk::ReferenceTypeInfo::destroy(), clang::DeclaratorChunk::ArrayTypeInfo::destroy(), clang::DeclaratorChunk::FunctionTypeInfo::destroy(), clang::DeclaratorChunk::BlockPointerTypeInfo::destroy(), clang::DeclaratorChunk::MemberPointerTypeInfo::destroy(), clang::DeclaratorChunk::PipeTypeInfo::destroy(), Fun, Function, Kind, Mem, MemberPointer, Paren, Pipe, PipeInfo, Pointer, Ptr, Ref, and Reference.
|
inlinestatic |
Return a DeclaratorChunk for an array.
Definition at line 1698 of file DeclSpec.h.
References Arr, Array, EndLoc, clang::DeclaratorChunk::ArrayTypeInfo::hasStatic, clang::DeclaratorChunk::ArrayTypeInfo::isStar, Kind, Loc, clang::DeclaratorChunk::ArrayTypeInfo::NumElts, and clang::DeclaratorChunk::ArrayTypeInfo::TypeQuals.
|
inline |
Definition at line 1664 of file DeclSpec.h.
References AttrList.
|
inline |
If there are attributes applied to this declaratorchunk, return them.
Definition at line 1663 of file DeclSpec.h.
References AttrList.
Referenced by distributeFunctionTypeAttr(), distributeFunctionTypeAttrToInnermost(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), distributeObjCPointerTypeAttrFromDeclarator(), GetFullTypeForDeclarator(), hasParsedAttr(), inferARCWriteback(), clang::Sema::ProcessDeclAttributes(), and transferARCOwnershipToDeclaratorChunk().
|
inlinestatic |
Return a DeclaratorChunk for a block.
Definition at line 1741 of file DeclSpec.h.
References BlockPointer, Cls, Kind, Loc, and clang::DeclaratorChunk::BlockPointerTypeInfo::TypeQuals.
|
static |
DeclaratorChunk::getFunction - Return a DeclaratorChunk for a function.
"TheDeclarator" is the declarator that this will be added to.
Definition at line 161 of file DeclSpec.cpp.
References clang::DeclaratorChunk::FunctionTypeInfo::DeclsInPrototype, clang::DeclaratorChunk::FunctionTypeInfo::DeleteParams, clang::DeclaratorChunk::FunctionTypeInfo::EllipsisLoc, EndLoc, clang::EST_DependentNoexcept, clang::EST_Dynamic, clang::EST_NoexceptFalse, clang::EST_NoexceptTrue, clang::EST_None, clang::EST_Unparsed, clang::DeclaratorChunk::FunctionTypeInfo::Exceptions, clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecLocBeg, clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecLocEnd, clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecTokens, clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecType, clang::DeclSpec::forEachCVRUQualifier(), Fun, Function, clang::ActionResult< PtrTy, Compress >::get(), clang::DeclSpec::getAttributePool(), clang::DeclSpec::getAttributes(), clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::DeclSpec::getTypeQualifiers(), clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype, clang::DeclaratorChunk::FunctionTypeInfo::HasTrailingReturnType, clang::Declarator::InlineParams, clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous, clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::SourceLocation::isValid(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, Kind, Loc, clang::DeclaratorChunk::FunctionTypeInfo::LParenLoc, clang::DeclaratorChunk::FunctionTypeInfo::MethodQualifiers, clang::DeclaratorChunk::FunctionTypeInfo::MutableLoc, clang::DeclaratorChunk::FunctionTypeInfo::NoexceptExpr, clang::DeclaratorChunk::FunctionTypeInfo::NumExceptionsOrDecls, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::DeclaratorChunk::FunctionTypeInfo::QualAttrFactory, clang::DeclaratorChunk::TypeAndRange::Range, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierLoc, clang::DeclaratorChunk::FunctionTypeInfo::RParenLoc, clang::DeclSpec::SetTypeQual(), clang::ParsedAttributesView::size(), clang::AttributePool::takeAllFrom(), clang::ParsedAttributes::takeAllFrom(), clang::DeclSpec::TQ_atomic, clang::DeclaratorChunk::FunctionTypeInfo::TrailingReturnType, clang::DeclaratorChunk::FunctionTypeInfo::TrailingReturnTypeLoc, and clang::DeclaratorChunk::TypeAndRange::Ty.
Referenced by clang::Sema::ImplicitlyDefineFunction(), and maybeSynthesizeBlockSignature().
|
inlinestatic |
Definition at line 1760 of file DeclSpec.h.
References EndLoc, clang::CXXScopeSpec::getBeginLoc(), Kind, Loc, Mem, MemberPointer, clang::DeclaratorChunk::MemberPointerTypeInfo::ScopeMem, clang::DeclaratorChunk::MemberPointerTypeInfo::StarLoc, and clang::DeclaratorChunk::MemberPointerTypeInfo::TypeQuals.
|
inlinestatic |
Return a DeclaratorChunk for a paren.
Definition at line 1776 of file DeclSpec.h.
|
inlinestatic |
Return a DeclaratorChunk for a block.
Definition at line 1751 of file DeclSpec.h.
References Cls, Kind, Loc, Pipe, and clang::DeclaratorChunk::BlockPointerTypeInfo::TypeQuals.
|
inlinestatic |
Return a DeclaratorChunk for a pointer.
Definition at line 1667 of file DeclSpec.h.
References clang::DeclaratorChunk::PointerTypeInfo::AtomicQualLoc, clang::DeclaratorChunk::PointerTypeInfo::ConstQualLoc, Kind, Loc, Pointer, Ptr, clang::DeclaratorChunk::PointerTypeInfo::RestrictQualLoc, clang::DeclaratorChunk::PointerTypeInfo::TypeQuals, clang::DeclaratorChunk::PointerTypeInfo::UnalignedQualLoc, and clang::DeclaratorChunk::PointerTypeInfo::VolatileQualLoc.
Referenced by clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers().
|
inlinestatic |
Return a DeclaratorChunk for a reference.
Definition at line 1687 of file DeclSpec.h.
References clang::DeclaratorChunk::ReferenceTypeInfo::HasRestrict, Kind, Loc, clang::DeclaratorChunk::ReferenceTypeInfo::LValueRef, Ref, Reference, and clang::DeclSpec::TQ_restrict.
Referenced by clang::Sema::ActOnCXXForRangeIdentifier().
|
inline |
Definition at line 1263 of file DeclSpec.h.
References EndLoc, clang::SourceLocation::isInvalid(), and Loc.
|
inline |
Definition at line 1785 of file DeclSpec.h.
union { ... } clang::DeclaratorChunk::@224 |
ArrayTypeInfo clang::DeclaratorChunk::Arr |
Definition at line 1641 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXNew(), clang::Sema::containsUnexpandedParameterPacks(), destroy(), getArray(), GetFullTypeForDeclarator(), and clang::Declarator::isArrayOfUnknownBound().
ParsedAttributesView clang::DeclaratorChunk::AttrList |
Definition at line 1269 of file DeclSpec.h.
Referenced by clang::Declarator::AddTypeInfo(), and getAttrs().
BlockPointerTypeInfo clang::DeclaratorChunk::Cls |
Definition at line 1643 of file DeclSpec.h.
Referenced by destroy(), getBlockPointer(), GetFullTypeForDeclarator(), and getPipe().
SourceLocation clang::DeclaratorChunk::EndLoc |
EndLoc - If valid, the place where this chunck ends.
Definition at line 1261 of file DeclSpec.h.
Referenced by getArray(), GetFullTypeForDeclarator(), getFunction(), getMemberPointer(), getParen(), getSourceRange(), and warnAboutAmbiguousFunction().
FunctionTypeInfo clang::DeclaratorChunk::Fun |
Definition at line 1642 of file DeclSpec.h.
Referenced by clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::containsUnexpandedParameterPacks(), destroy(), GetFullTypeForDeclarator(), getFunction(), and warnAboutAmbiguousFunction().
enum { ... } clang::DeclaratorChunk::Kind |
Referenced by clang::Sema::CheckExtraCXXDefaultArguments(), classifyPointerDeclarator(), clang::Sema::containsUnexpandedParameterPacks(), destroy(), diagnoseRedundantReturnTypeQualifiers(), distributeFunctionTypeAttr(), distributeFunctionTypeAttrToInnermost(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), distributeObjCPointerTypeAttrFromDeclarator(), fillAtomicQualLoc(), getArray(), getBlockPointer(), GetFullTypeForDeclarator(), getFunction(), getMemberPointer(), getParen(), getPipe(), getPointer(), getReference(), hasOuterPointerLikeChunk(), inferARCWriteback(), clang::Declarator::isArrayOfUnknownBound(), IsNoDerefableChunk(), isParen(), maybeMovePastReturnType(), RebuildDeclaratorInCurrentInstantiation(), and transferARCOwnership().
SourceLocation clang::DeclaratorChunk::Loc |
Loc - The place where this type was defined.
Definition at line 1259 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXNew(), distributeNullabilityTypeAttr(), getArray(), getBlockPointer(), GetFullTypeForDeclarator(), getFunction(), getMemberPointer(), getParen(), getPipe(), getPointer(), getReference(), getSourceRange(), and warnAboutAmbiguousFunction().
MemberPointerTypeInfo clang::DeclaratorChunk::Mem |
Definition at line 1644 of file DeclSpec.h.
Referenced by clang::Sema::containsUnexpandedParameterPacks(), destroy(), GetFullTypeForDeclarator(), getMemberPointer(), and RebuildDeclaratorInCurrentInstantiation().
PipeTypeInfo clang::DeclaratorChunk::PipeInfo |
Definition at line 1645 of file DeclSpec.h.
Referenced by destroy().
PointerTypeInfo clang::DeclaratorChunk::Ptr |
Definition at line 1639 of file DeclSpec.h.
Referenced by destroy(), diagnoseRedundantReturnTypeQualifiers(), fillAtomicQualLoc(), GetFullTypeForDeclarator(), and getPointer().
ReferenceTypeInfo clang::DeclaratorChunk::Ref |
Definition at line 1640 of file DeclSpec.h.
Referenced by destroy(), GetFullTypeForDeclarator(), and getReference().