clang
9.0.0
|
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 | |
SourceRange | getSourceRange () const |
void | destroy () |
const ParsedAttributesView & | getAttrs () const |
If there are attributes applied to this declaratorchunk, return them. More... | |
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. 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, 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(), DeclSpec *MethodQualifiers=nullptr) |
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... | |
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 1158 of file DeclSpec.h.
anonymous enum |
Enumerator | |
---|---|
Pointer | |
Reference | |
Array | |
Function | |
BlockPointer | |
MemberPointer | |
Paren | |
Pipe |
Definition at line 1159 of file DeclSpec.h.
|
inline |
Definition at line 1536 of file DeclSpec.h.
References Array, BlockPointer, Function, MemberPointer, Paren, Pipe, Pointer, and Reference.
|
inlinestatic |
Return a DeclaratorChunk for an array.
Definition at line 1585 of file DeclSpec.h.
References Arr, EndLoc, clang::DeclaratorChunk::ArrayTypeInfo::hasStatic, clang::DeclaratorChunk::ArrayTypeInfo::isStar, Kind, Loc, clang::DeclaratorChunk::ArrayTypeInfo::NumElts, and clang::DeclaratorChunk::ArrayTypeInfo::TypeQuals.
Referenced by getMissingDeclaratorIdLoc(), and clang::Parser::ParseUnqualifiedId().
|
inline |
If there are attributes applied to this declaratorchunk, return them.
Definition at line 1551 of file DeclSpec.h.
Referenced by addContextSensitiveTypeNullability(), distributeFunctionTypeAttr(), distributeFunctionTypeAttrToInnermost(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), distributeObjCPointerTypeAttrFromDeclarator(), GetTypeSourceInfoForDeclarator(), inferARCWriteback(), takeDeclAttributes(), and transferARCOwnershipToDeclaratorChunk().
|
inline |
Definition at line 1552 of file DeclSpec.h.
|
inlinestatic |
Return a DeclaratorChunk for a block.
Definition at line 1626 of file DeclSpec.h.
References Cls, Kind, Loc, and clang::DeclaratorChunk::BlockPointerTypeInfo::TypeQuals.
Referenced by isPipeDeclerator().
|
static |
DeclaratorChunk::getFunction - Return a DeclaratorChunk for a function.
"TheDeclarator" is the declarator that this will be added to.
Definition at line 151 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, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::DeclSpec::getAttributePool(), clang::DeclSpec::getAttributes(), clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::SourceLocation::getRawEncoding(), clang::DeclSpec::getTypeQualifiers(), clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype, clang::DeclaratorChunk::FunctionTypeInfo::HasTrailingReturnType, i, clang::Declarator::InlineParams, 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::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, and clang::DeclaratorChunk::TypeAndRange::Ty.
Referenced by addConstevalToLambdaDeclSpecifier(), getMissingDeclaratorIdLoc(), and maybeSynthesizeBlockSignature().
|
inlinestatic |
Definition at line 1645 of file DeclSpec.h.
References EndLoc, clang::CXXScopeSpec::getBeginLoc(), Kind, Loc, Mem, clang::DeclaratorChunk::MemberPointerTypeInfo::ScopeMem, and clang::DeclaratorChunk::MemberPointerTypeInfo::TypeQuals.
Referenced by isPipeDeclerator().
|
inlinestatic |
Return a DeclaratorChunk for a paren.
Definition at line 1658 of file DeclSpec.h.
References EndLoc, Kind, Loc, and Paren.
Referenced by getMissingDeclaratorIdLoc().
|
inlinestatic |
Return a DeclaratorChunk for a block.
Definition at line 1636 of file DeclSpec.h.
References Cls, Kind, Loc, and clang::DeclaratorChunk::BlockPointerTypeInfo::TypeQuals.
Referenced by isPipeDeclerator().
|
inlinestatic |
Return a DeclaratorChunk for a pointer.
Definition at line 1555 of file DeclSpec.h.
References clang::DeclaratorChunk::PointerTypeInfo::AtomicQualLoc, clang::DeclaratorChunk::PointerTypeInfo::ConstQualLoc, clang::SourceLocation::getRawEncoding(), Kind, Loc, Pointer, Ptr, clang::DeclaratorChunk::PointerTypeInfo::RestrictQualLoc, clang::DeclaratorChunk::PointerTypeInfo::TypeQuals, clang::DeclaratorChunk::PointerTypeInfo::UnalignedQualLoc, and clang::DeclaratorChunk::PointerTypeInfo::VolatileQualLoc.
Referenced by isPipeDeclerator().
|
inlinestatic |
Return a DeclaratorChunk for a reference.
Definition at line 1574 of file DeclSpec.h.
References clang::DeclaratorChunk::ReferenceTypeInfo::HasRestrict, Kind, Loc, clang::DeclaratorChunk::ReferenceTypeInfo::LValueRef, Ref, and clang::DeclSpec::TQ_restrict.
Referenced by isPipeDeclerator().
|
inline |
Definition at line 1168 of file DeclSpec.h.
References clang::SourceLocation::isInvalid().
|
inline |
Definition at line 1667 of file DeclSpec.h.
References Paren.
union { ... } |
ArrayTypeInfo clang::DeclaratorChunk::Arr |
Definition at line 1529 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXNew(), clang::Sema::containsUnexpandedParameterPacks(), getArray(), and clang::Declarator::isArrayOfUnknownBound().
ParsedAttributesView clang::DeclaratorChunk::AttrList |
Definition at line 1174 of file DeclSpec.h.
BlockPointerTypeInfo clang::DeclaratorChunk::Cls |
Definition at line 1531 of file DeclSpec.h.
Referenced by getBlockPointer(), and getPipe().
SourceLocation clang::DeclaratorChunk::EndLoc |
EndLoc - If valid, the place where this chunck ends.
Definition at line 1166 of file DeclSpec.h.
Referenced by getArray(), getFunction(), getMemberPointer(), getParen(), warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
FunctionTypeInfo clang::DeclaratorChunk::Fun |
Definition at line 1530 of file DeclSpec.h.
Referenced by clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::containsUnexpandedParameterPacks(), diagnoseRedundantReturnTypeQualifiers(), getFunction(), and warnAboutAmbiguousFunction().
enum { ... } clang::DeclaratorChunk::Kind |
Referenced by clang::Sema::ActOnCXXNew(), clang::Sema::CheckExtraCXXDefaultArguments(), classifyPointerDeclarator(), clang::Sema::containsUnexpandedParameterPacks(), deduceOpenCLImplicitAddrSpace(), diagnoseRedundantReturnTypeQualifiers(), distributeFunctionTypeAttr(), distributeFunctionTypeAttrToInnermost(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), distributeObjCPointerTypeAttrFromDeclarator(), fillAtomicQualLoc(), getArray(), getBlockPointer(), getCCForDeclaratorChunk(), getFunction(), getMemberPointer(), getParen(), getPipe(), getPointer(), getReference(), hasOuterPointerLikeChunk(), inferARCWriteback(), clang::Declarator::isArrayOfUnknownBound(), IsNoDerefableChunk(), isOmittedBlockReturnType(), isPipeDeclerator(), maybeMovePastReturnType(), transferARCOwnership(), and warnAboutRedundantParens().
SourceLocation clang::DeclaratorChunk::Loc |
Loc - The place where this type was defined.
Definition at line 1164 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXNew(), distributeNullabilityTypeAttr(), getArray(), getBlockPointer(), getFunction(), getMemberPointer(), getParen(), getPipe(), getPointer(), getReference(), isPipeDeclerator(), warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
MemberPointerTypeInfo clang::DeclaratorChunk::Mem |
Definition at line 1532 of file DeclSpec.h.
Referenced by clang::Sema::containsUnexpandedParameterPacks(), and getMemberPointer().
PipeTypeInfo clang::DeclaratorChunk::PipeInfo |
Definition at line 1533 of file DeclSpec.h.
PointerTypeInfo clang::DeclaratorChunk::Ptr |
Definition at line 1527 of file DeclSpec.h.
Referenced by diagnoseRedundantReturnTypeQualifiers(), fillAtomicQualLoc(), and getPointer().
ReferenceTypeInfo clang::DeclaratorChunk::Ref |
Definition at line 1528 of file DeclSpec.h.
Referenced by getReference().