clang
7.0.0
|
Information about one declarator, including the parsed type information and the identifier. More...
#include "clang/Sema/DeclSpec.h"
Public Types | |
typedef SmallVectorImpl< DeclaratorChunk >::const_iterator | type_object_iterator |
typedef llvm::iterator_range< type_object_iterator > | type_object_range |
Public Member Functions | |
Declarator (const DeclSpec &ds, DeclaratorContext C) | |
~Declarator () | |
const DeclSpec & | getDeclSpec () const |
getDeclSpec - Return the declaration-specifier that this declarator was declared with. More... | |
DeclSpec & | getMutableDeclSpec () |
getMutableDeclSpec - Return a non-const version of the DeclSpec. More... | |
AttributePool & | getAttributePool () const |
const CXXScopeSpec & | getCXXScopeSpec () const |
getCXXScopeSpec - Return the C++ scope specifier (global scope or nested-name-specifier) that is part of the declarator-id. More... | |
CXXScopeSpec & | getCXXScopeSpec () |
UnqualifiedId & | getName () |
Retrieve the name specified by this declarator. More... | |
const DecompositionDeclarator & | getDecompositionDeclarator () const |
DeclaratorContext | getContext () const |
bool | isPrototypeContext () const |
SourceRange | getSourceRange () const LLVM_READONLY |
Get the source range that spans this declarator. More... | |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getBeginLoc () const LLVM_READONLY |
SourceLocation | getLocEnd () const LLVM_READONLY |
SourceLocation | getEndLoc () const LLVM_READONLY |
void | SetSourceRange (SourceRange R) |
void | SetRangeBegin (SourceLocation Loc) |
SetRangeBegin - Set the start of the source range to Loc, unless it's invalid. More... | |
void | SetRangeEnd (SourceLocation Loc) |
SetRangeEnd - Set the end of the source range to Loc, unless it's invalid. More... | |
void | ExtendWithDeclSpec (const DeclSpec &DS) |
ExtendWithDeclSpec - Extend the declarator source range to include the given declspec, unless its location is invalid. More... | |
void | clear () |
Reset the contents of this Declarator. More... | |
bool | mayOmitIdentifier () const |
mayOmitIdentifier - Return true if the identifier is either optional or not allowed. More... | |
bool | mayHaveIdentifier () const |
mayHaveIdentifier - Return true if the identifier is either optional or required. More... | |
bool | mayHaveDecompositionDeclarator () const |
Return true if the context permits a C++17 decomposition declarator. More... | |
bool | mayBeFollowedByCXXDirectInit () const |
mayBeFollowedByCXXDirectInit - Return true if the declarator can be followed by a C++ direct initializer, e.g. More... | |
bool | isPastIdentifier () const |
isPastIdentifier - Return true if we have parsed beyond the point where the name would appear. More... | |
bool | hasName () const |
hasName - Whether this declarator has a name, which might be an identifier (accessible via getIdentifier()) or some kind of special C++ name (constructor, destructor, etc.), or a structured binding (which is not exactly a name, but occupies the same position). More... | |
bool | isDecompositionDeclarator () const |
Return whether this declarator is a decomposition declarator. More... | |
IdentifierInfo * | getIdentifier () const |
SourceLocation | getIdentifierLoc () const |
void | SetIdentifier (IdentifierInfo *Id, SourceLocation IdLoc) |
Set the name of this declarator to be the given identifier. More... | |
void | setDecompositionBindings (SourceLocation LSquareLoc, ArrayRef< DecompositionDeclarator::Binding > Bindings, SourceLocation RSquareLoc) |
Set the decomposition bindings for this declarator. More... | |
void | AddTypeInfo (const DeclaratorChunk &TI, ParsedAttributes &&attrs, SourceLocation EndLoc) |
AddTypeInfo - Add a chunk to this declarator. More... | |
void | AddTypeInfo (const DeclaratorChunk &TI, SourceLocation EndLoc) |
AddTypeInfo - Add a chunk to this declarator. More... | |
void | AddInnermostTypeInfo (const DeclaratorChunk &TI) |
Add a new innermost chunk to this declarator. More... | |
unsigned | getNumTypeObjects () const |
Return the number of types applied to this declarator. More... | |
const DeclaratorChunk & | getTypeObject (unsigned i) const |
Return the specified TypeInfo from this declarator. More... | |
DeclaratorChunk & | getTypeObject (unsigned i) |
type_object_range | type_objects () const |
Returns the range of type objects, from the identifier outwards. More... | |
void | DropFirstTypeObject () |
const DeclaratorChunk * | getInnermostNonParenChunk () const |
Return the innermost (closest to the declarator) chunk of this declarator that is not a parens chunk, or null if there are no non-parens chunks. More... | |
const DeclaratorChunk * | getOutermostNonParenChunk () const |
Return the outermost (furthest from the declarator) chunk of this declarator that is not a parens chunk, or null if there are no non-parens chunks. More... | |
bool | isArrayOfUnknownBound () const |
isArrayOfUnknownBound - This method returns true if the declarator is a declarator for an array of unknown bound (looking through parentheses). More... | |
bool | isFunctionDeclarator (unsigned &idx) const |
isFunctionDeclarator - This method returns true if the declarator is a function declarator (looking through parentheses). More... | |
bool | isFunctionDeclarator () const |
isFunctionDeclarator - Once this declarator is fully parsed and formed, this method returns true if the identifier is a function declarator (looking through parentheses). More... | |
DeclaratorChunk::FunctionTypeInfo & | getFunctionTypeInfo () |
getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses). More... | |
const DeclaratorChunk::FunctionTypeInfo & | getFunctionTypeInfo () const |
getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses). More... | |
bool | isDeclarationOfFunction () const |
Determine whether the declaration that will be produced from this declaration will be a function. More... | |
bool | isFunctionDeclarationContext () const |
Return true if this declaration appears in a context where a function declarator would be a function declaration. More... | |
bool | isExpressionContext () const |
Determine whether this declaration appears in a context where an expression could appear. More... | |
bool | isFunctionDeclaratorAFunctionDeclaration () const |
Return true if a function declarator at this position would be a function declaration. More... | |
bool | hasTrailingReturnType () const |
Determine whether a trailing return type was written (at any level) within this declarator. More... | |
void | takeAttributes (ParsedAttributes &attrs, SourceLocation lastLoc) |
takeAttributes - Takes attributes from the given parsed-attributes set and add them to this declarator. More... | |
const ParsedAttributes & | getAttributes () const |
ParsedAttributes & | getAttributes () |
bool | hasAttributes () const |
hasAttributes - do we contain any attributes? More... | |
void | getCXX11AttributeRanges (SmallVectorImpl< SourceRange > &Ranges) |
Return a source range list of C++11 attributes associated with the declarator. More... | |
void | setAsmLabel (Expr *E) |
Expr * | getAsmLabel () const |
void | setExtension (bool Val=true) |
bool | getExtension () const |
void | setObjCIvar (bool Val=true) |
bool | isObjCIvar () const |
void | setObjCWeakProperty (bool Val=true) |
bool | isObjCWeakProperty () const |
void | setInvalidType (bool Val=true) |
bool | isInvalidType () const |
void | setGroupingParens (bool flag) |
bool | hasGroupingParens () const |
bool | isFirstDeclarator () const |
SourceLocation | getCommaLoc () const |
void | setCommaLoc (SourceLocation CL) |
bool | hasEllipsis () const |
SourceLocation | getEllipsisLoc () const |
void | setEllipsisLoc (SourceLocation EL) |
void | setFunctionDefinitionKind (FunctionDefinitionKind Val) |
bool | isFunctionDefinition () const |
FunctionDefinitionKind | getFunctionDefinitionKind () const |
bool | isFirstDeclarationOfMember () |
Returns true if this declares a real member and not a friend. More... | |
bool | isStaticMember () |
Returns true if this declares a static member. More... | |
bool | isCtorOrDtor () |
Returns true if this declares a constructor or a destructor. More... | |
void | setRedeclaration (bool Val) |
bool | isRedeclaration () const |
Friends | |
struct | DeclaratorChunk |
Information about one declarator, including the parsed type information and the identifier.
When the declarator is fully formed, this is turned into the appropriate Decl object.
Declarators come in two types: normal declarators and abstract declarators. Abstract declarators are used when parsing types, and don't have an identifier. Normal declarators do have ID's.
Instances of this class should be a transient object that lives on the stack, not objects that are allocated in large quantities on the heap.
Definition at line 1752 of file DeclSpec.h.
typedef SmallVectorImpl<DeclaratorChunk>::const_iterator clang::Declarator::type_object_iterator |
Definition at line 2177 of file DeclSpec.h.
typedef llvm::iterator_range<type_object_iterator> clang::Declarator::type_object_range |
Definition at line 2178 of file DeclSpec.h.
|
inline |
Definition at line 1828 of file DeclSpec.h.
|
inline |
Definition at line 1836 of file DeclSpec.h.
References clang::CXXScopeSpec::clear().
|
inline |
Add a new innermost chunk to this declarator.
Definition at line 2159 of file DeclSpec.h.
Referenced by maybeSynthesizeBlockSignature().
|
inline |
AddTypeInfo - Add a chunk to this declarator.
Also extend the range to EndLoc, which should be the last token of the chunk. This function takes attrs by R-Value reference because it takes ownership of those attributes from the parameter.
Definition at line 2139 of file DeclSpec.h.
References clang::SourceLocation::isInvalid().
Referenced by addConstexprToLambdaDeclSpecifier(), getMissingDeclaratorIdLoc(), isPipeDeclerator(), and clang::Parser::ParseUnqualifiedId().
|
inline |
AddTypeInfo - Add a chunk to this declarator.
Also extend the range to EndLoc, which should be the last token of the chunk.
Definition at line 2151 of file DeclSpec.h.
References clang::SourceLocation::isInvalid().
|
inline |
Reset the contents of this Declarator.
Definition at line 1906 of file DeclSpec.h.
References clang::CXXScopeSpec::clear(), clang::ParsedAttributes::clear(), clang::UnqualifiedId::clear(), clang::DecompositionDeclarator::clear(), and clang::DeclSpec::getSourceRange().
Referenced by clang::ParsingDeclarator::clear(), and clang::Parser::ParseTopLevelDecl().
|
inline |
Definition at line 2185 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXNew().
|
inline |
ExtendWithDeclSpec - Extend the declarator source range to include the given declspec, unless its location is invalid.
Adopts the range start if the current range start is invalid.
Definition at line 1897 of file DeclSpec.h.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::DeclSpec::getSourceRange(), clang::SourceLocation::isInvalid(), clang::SourceRange::setBegin(), and clang::SourceRange::setEnd().
Referenced by isPipeDeclerator().
|
inline |
Definition at line 2420 of file DeclSpec.h.
|
inline |
Definition at line 1850 of file DeclSpec.h.
References clang::ParsedAttributes::getPool().
Referenced by addContextSensitiveTypeNullability(), takeDeclAttributes(), and transferARCOwnershipToDeclaratorChunk().
|
inline |
Definition at line 2398 of file DeclSpec.h.
Referenced by clang::Sema::checkUnusedDeclAttributes(), distributeFunctionTypeAttrFromDeclarator(), distributeObjCPointerTypeAttrFromDeclarator(), GetDeclSpecTypeForDeclarator(), clang::Parser::ParseTopLevelDecl(), and takeDeclAttributes().
|
inline |
Definition at line 2399 of file DeclSpec.h.
|
inline |
Definition at line 1878 of file DeclSpec.h.
References clang::SourceRange::getBegin().
|
inline |
Definition at line 2440 of file DeclSpec.h.
Referenced by warnAboutAmbiguousFunction().
|
inline |
Definition at line 1866 of file DeclSpec.h.
Referenced by clang::Sema::ActOnBlockArguments(), clang::Sema::ActOnTypeName(), deduceOpenCLImplicitAddrSpace(), GetDeclSpecTypeForDeclarator(), getMissingDeclaratorIdLoc(), isOmittedBlockReturnType(), isPipeDeclerator(), warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
|
inline |
Return a source range list of C++11 attributes associated with the declarator.
Definition at line 2413 of file DeclSpec.h.
|
inline |
getCXXScopeSpec - Return the C++ scope specifier (global scope or nested-name-specifier) that is part of the declarator-id.
Definition at line 1856 of file DeclSpec.h.
Referenced by clang::Sema::ActOnFriendFunctionDecl(), getMissingDeclaratorIdLoc(), isPipeDeclerator(), SetNestedNameSpecifier(), and warnAboutRedundantParens().
|
inline |
Definition at line 1857 of file DeclSpec.h.
|
inline |
getDeclSpec - Return the declaration-specifier that this declarator was declared with.
Definition at line 1841 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXConditionDeclaration(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnCXXNew(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::canDelayFunctionBody(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDestructorDeclarator(), clang::Sema::checkUnusedDeclAttributes(), clang::Sema::containsUnexpandedParameterPacks(), deduceOpenCLImplicitAddrSpace(), diagnoseRedundantReturnTypeQualifiers(), clang::ParsingDeclarator::getDeclSpec(), GetDeclSpecTypeForDeclarator(), getFunctionStorageClass(), getMissingDeclaratorIdLoc(), isOmittedBlockReturnType(), isPipeDeclerator(), clang::Parser::ParseUnqualifiedId(), takeDeclAttributes(), warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
|
inline |
Definition at line 1862 of file DeclSpec.h.
|
inline |
Definition at line 2444 of file DeclSpec.h.
Referenced by getMissingDeclaratorIdLoc().
|
inline |
Definition at line 1880 of file DeclSpec.h.
References clang::SourceRange::getEnd().
|
inline |
Definition at line 2423 of file DeclSpec.h.
|
inline |
Definition at line 2455 of file DeclSpec.h.
Referenced by warnAboutAmbiguousFunction().
|
inline |
getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses).
Definition at line 2257 of file DeclSpec.h.
Referenced by clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDestructorDeclarator(), maybeSynthesizeBlockSignature(), and clang::Parser::ParseTopLevelDecl().
|
inline |
getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses).
Definition at line 2266 of file DeclSpec.h.
|
inline |
Definition at line 2116 of file DeclSpec.h.
References clang::UnqualifiedId::getKind(), clang::UnqualifiedId::Identifier, and clang::IK_Identifier.
Referenced by clang::Sema::ActOnBlockArguments(), clang::Sema::ActOnTypeName(), getMissingDeclaratorIdLoc(), clang::Sema::HandleMSProperty(), clang::Sema::isLibstdcxxEagerExceptionSpecHack(), isPipeDeclerator(), clang::Parser::ParseTopLevelDecl(), takeDeclAttributes(), warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
|
inline |
Definition at line 2122 of file DeclSpec.h.
References clang::UnqualifiedId::StartLocation.
Referenced by clang::Sema::ActOnExceptionDeclarator(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDestructorDeclarator(), diagnoseRedundantReturnTypeQualifiers(), clang::Sema::HandleMSProperty(), clang::Parser::ParseTopLevelDecl(), and takeDeclAttributes().
|
inline |
Return the innermost (closest to the declarator) chunk of this declarator that is not a parens chunk, or null if there are no non-parens chunks.
Definition at line 2194 of file DeclSpec.h.
|
inline |
Definition at line 1879 of file DeclSpec.h.
References clang::CXXScopeSpec::getEndLoc().
Referenced by getMissingDeclaratorIdLoc(), clang::Parser::ParseUnqualifiedId(), and warnAboutRedundantParens().
|
inline |
Definition at line 1877 of file DeclSpec.h.
References clang::CXXScopeSpec::getBeginLoc().
Referenced by GetDeclSpecTypeForDeclarator(), clang::Sema::isLibstdcxxEagerExceptionSpecHack(), maybeSynthesizeBlockSignature(), and warnAboutRedundantParens().
|
inline |
getMutableDeclSpec - Return a non-const version of the DeclSpec.
This should be used with extreme care: declspecs can often be shared between multiple declarators, so mutating the DeclSpec affects all of the Declarators. This should only be done when the declspec is known to not be shared or when in error recovery etc.
Definition at line 1848 of file DeclSpec.h.
Referenced by addContextSensitiveTypeNullability(), clang::Sema::CheckDeductionGuideDeclarator(), distributeObjCPointerTypeAttrFromDeclarator(), GetDeclSpecTypeForDeclarator(), getFunctionStorageClass(), clang::Parser::ParseUnqualifiedId(), and takeDeclAttributes().
|
inline |
Retrieve the name specified by this declarator.
Definition at line 1860 of file DeclSpec.h.
Referenced by clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDestructorDeclarator(), diagnoseRedundantReturnTypeQualifiers(), GetDeclSpecTypeForDeclarator(), getMissingDeclaratorIdLoc(), and clang::Sema::GetNameForDeclarator().
|
inline |
Return the number of types applied to this declarator.
Definition at line 2164 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXNew(), clang::Sema::ActOnStartOfLambdaDefinition(), addContextSensitiveTypeNullability(), clang::Sema::canDelayFunctionBody(), clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::checkUnusedDeclAttributes(), classifyPointerDeclarator(), deduceOpenCLImplicitAddrSpace(), diagnoseRedundantReturnTypeQualifiers(), distributeFunctionTypeAttrToInnermost(), distributeObjCPointerTypeAttrFromDeclarator(), GetDeclSpecTypeForDeclarator(), getMissingDeclaratorIdLoc(), handleObjCOwnershipTypeAttr(), inferARCWriteback(), isOmittedBlockReturnType(), isPipeDeclerator(), maybeMovePastReturnType(), maybeSynthesizeBlockSignature(), takeDeclAttributes(), transferARCOwnership(), and warnAboutRedundantParens().
|
inline |
Return the outermost (furthest from the declarator) chunk of this declarator that is not a parens chunk, or null if there are no non-parens chunks.
Definition at line 2205 of file DeclSpec.h.
|
inline |
Get the source range that spans this declarator.
Definition at line 1876 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXConditionDeclaration(), clang::Sema::ActOnCXXNew(), clang::Sema::CheckDeductionGuideDeclarator(), and getMissingDeclaratorIdLoc().
|
inline |
Return the specified TypeInfo from this declarator.
TypeInfo #0 is closest to the identifier.
Definition at line 2168 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXNew(), addContextSensitiveTypeNullability(), clang::Sema::canDelayFunctionBody(), clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::checkUnusedDeclAttributes(), classifyPointerDeclarator(), deduceOpenCLImplicitAddrSpace(), diagnoseRedundantReturnTypeQualifiers(), distributeFunctionTypeAttr(), distributeFunctionTypeAttrToInnermost(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), distributeObjCPointerTypeAttrFromDeclarator(), getCCForDeclaratorChunk(), getMissingDeclaratorIdLoc(), hasOuterPointerLikeChunk(), inferARCWriteback(), isOmittedBlockReturnType(), isPipeDeclerator(), maybeMovePastReturnType(), takeDeclAttributes(), transferARCOwnership(), transferARCOwnershipToDeclaratorChunk(), and warnAboutRedundantParens().
|
inline |
Definition at line 2172 of file DeclSpec.h.
|
inline |
hasAttributes - do we contain any attributes?
Definition at line 2402 of file DeclSpec.h.
|
inline |
Definition at line 2443 of file DeclSpec.h.
References clang::SourceLocation::isValid().
Referenced by GetDeclSpecTypeForDeclarator(), and getMissingDeclaratorIdLoc().
|
inline |
Definition at line 2437 of file DeclSpec.h.
Referenced by getMissingDeclaratorIdLoc().
|
inline |
hasName - Whether this declarator has a name, which might be an identifier (accessible via getIdentifier()) or some kind of special C++ name (constructor, destructor, etc.), or a structured binding (which is not exactly a name, but occupies the same position).
Definition at line 2106 of file DeclSpec.h.
References clang::UnqualifiedId::getKind(), clang::UnqualifiedId::Identifier, and clang::IK_Identifier.
Referenced by getMissingDeclaratorIdLoc().
|
inline |
Determine whether a trailing return type was written (at any level) within this declarator.
Definition at line 2374 of file DeclSpec.h.
References clang::DeclaratorChunk::Function.
Referenced by GetDeclSpecTypeForDeclarator().
|
inline |
isArrayOfUnknownBound - This method returns true if the declarator is a declarator for an array of unknown bound (looking through parentheses).
Definition at line 2216 of file DeclSpec.h.
References clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, clang::DeclaratorChunk::Kind, and clang::DeclaratorChunk::ArrayTypeInfo::NumElts.
bool Declarator::isCtorOrDtor | ( | ) |
Returns true if this declares a constructor or a destructor.
Definition at line 401 of file DeclSpec.cpp.
References clang::UnqualifiedId::getKind(), clang::CodeGen::getName(), clang::IK_ConstructorName, and clang::IK_DestructorName.
bool Declarator::isDeclarationOfFunction | ( | ) | const |
Determine whether the declaration that will be produced from this declaration will be a function.
A declaration can declare a function even if the declarator itself isn't a function declarator, if the type specifier refers to a function type. This routine checks for both cases.
Definition at line 309 of file DeclSpec.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, clang::TST_Accum, clang::TST_atomic, clang::TST_auto, clang::TST_auto_type, clang::TST_bool, clang::TST_char, clang::TST_char16, clang::TST_char32, clang::TST_char8, clang::TST_class, clang::TST_decimal128, clang::TST_decimal32, clang::TST_decimal64, clang::TST_decltype, clang::TST_decltype_auto, clang::TST_double, clang::TST_enum, clang::TST_error, clang::TST_float, clang::TST_float128, clang::TST_Float16, clang::TST_Fract, clang::TST_half, clang::TST_int, clang::TST_int128, clang::TST_interface, clang::TST_struct, clang::TST_typeofExpr, clang::TST_union, clang::TST_unknown_anytype, clang::TST_unspecified, clang::TST_void, and clang::TST_wchar.
Referenced by HandleLifetimeBoundAttr().
|
inline |
Return whether this declarator is a decomposition declarator.
Definition at line 2112 of file DeclSpec.h.
References clang::DecompositionDeclarator::isSet().
|
inline |
Determine whether this declaration appears in a context where an expression could appear.
Definition at line 2320 of file DeclSpec.h.
References clang::AliasDeclContext, clang::AliasTemplateContext, clang::BlockContext, clang::BlockLiteralContext, clang::ConditionContext, clang::ConversionIdContext, clang::CXXCatchContext, clang::CXXNewContext, clang::FileContext, clang::ForContext, clang::FunctionalCastContext, clang::InitStmtContext, clang::KNRTypeListContext, clang::LambdaExprContext, clang::LambdaExprParameterContext, clang::MemberContext, clang::ObjCCatchContext, clang::ObjCParameterContext, clang::ObjCResultContext, clang::PrototypeContext, clang::TemplateArgContext, clang::TemplateParamContext, clang::TemplateTypeArgContext, clang::TrailingReturnContext, clang::TrailingReturnVarContext, and clang::TypeNameContext.
Referenced by warnAboutRedundantParens().
|
inline |
Returns true if this declares a real member and not a friend.
Definition at line 2460 of file DeclSpec.h.
References clang::MemberContext.
Referenced by getMissingDeclaratorIdLoc().
|
inline |
Definition at line 2439 of file DeclSpec.h.
References clang::SourceLocation::isValid().
Referenced by warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
|
inline |
Return true if this declaration appears in a context where a function declarator would be a function declaration.
Definition at line 2280 of file DeclSpec.h.
References clang::AliasDeclContext, clang::AliasTemplateContext, clang::BlockContext, clang::BlockLiteralContext, clang::ConditionContext, clang::ConversionIdContext, clang::CXXCatchContext, clang::CXXNewContext, clang::FileContext, clang::ForContext, clang::FunctionalCastContext, clang::InitStmtContext, clang::KNRTypeListContext, clang::LambdaExprContext, clang::LambdaExprParameterContext, clang::MemberContext, clang::ObjCCatchContext, clang::ObjCParameterContext, clang::ObjCResultContext, clang::PrototypeContext, clang::DeclSpec::SCS_typedef, clang::TemplateArgContext, clang::TemplateParamContext, clang::TemplateTypeArgContext, clang::TrailingReturnContext, clang::TrailingReturnVarContext, and clang::TypeNameContext.
Referenced by clang::Sema::CheckExtraCXXDefaultArguments().
|
inline |
isFunctionDeclarator - This method returns true if the declarator is a function declarator (looking through parentheses).
If true is returned, then the reference type parameter idx is assigned with the index of the declaration chunk.
Definition at line 2226 of file DeclSpec.h.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, and clang::DeclaratorChunk::Reference.
Referenced by clang::Sema::ActOnStartOfFunctionDef(), GetDeclSpecTypeForDeclarator(), maybeSynthesizeBlockSignature(), clang::Parser::ParseTopLevelDecl(), and warnAboutAmbiguousFunction().
|
inline |
isFunctionDeclarator - Once this declarator is fully parsed and formed, this method returns true if the identifier is a function declarator (looking through parentheses).
Definition at line 2250 of file DeclSpec.h.
|
inline |
Return true if a function declarator at this position would be a function declaration.
Definition at line 2361 of file DeclSpec.h.
Referenced by getMissingDeclaratorIdLoc().
|
inline |
Definition at line 2451 of file DeclSpec.h.
References clang::FDK_Declaration.
|
inline |
Definition at line 2432 of file DeclSpec.h.
References clang::DeclSpec::getTypeSpecType(), and clang::DeclSpec::TST_error.
Referenced by clang::Sema::ActOnCastExpr(), clang::Sema::ActOnExceptionDeclarator(), clang::Sema::ActOnTypeName(), addConstexprToLambdaDeclSpecifier(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDestructorDeclarator(), GetDeclSpecTypeForDeclarator(), getMissingDeclaratorIdLoc(), clang::Parser::ParseUnqualifiedId(), takeDeclAttributes(), TypeTraitArity(), and warnAboutRedundantParens().
|
inline |
Definition at line 2426 of file DeclSpec.h.
|
inline |
Definition at line 2429 of file DeclSpec.h.
|
inline |
isPastIdentifier - Return true if we have parsed beyond the point where the name would appear.
(This may happen even if we haven't actually parsed a name, perhaps because this context doesn't require one.)
Definition at line 2100 of file DeclSpec.h.
References clang::UnqualifiedId::isValid().
Referenced by getMissingDeclaratorIdLoc().
|
inline |
Definition at line 1868 of file DeclSpec.h.
References clang::LambdaExprParameterContext, clang::ObjCParameterContext, clang::ObjCResultContext, and clang::PrototypeContext.
Referenced by clang::Sema::GetTypeForDeclarator().
|
inline |
Definition at line 2474 of file DeclSpec.h.
bool Declarator::isStaticMember | ( | ) |
Returns true if this declares a static member.
This cannot be called on a declarator outside of a MemberContext because we won't know until redeclaration time if the decl is static.
Definition at line 393 of file DeclSpec.cpp.
References clang::CodeGen::getName(), clang::IK_OperatorFunctionId, clang::CXXMethodDecl::isStaticOverloadedOperator(), clang::MemberContext, clang::UnqualifiedId::OFI::Operator, clang::UnqualifiedId::OperatorFunctionId, and clang::DeclSpec::SCS_static.
|
inline |
mayBeFollowedByCXXDirectInit - Return true if the declarator can be followed by a C++ direct initializer, e.g.
"int x(1);".
Definition at line 2044 of file DeclSpec.h.
References clang::AliasDeclContext, clang::AliasTemplateContext, clang::BlockContext, clang::BlockLiteralContext, clang::ConditionContext, clang::ConversionIdContext, clang::CXXCatchContext, clang::CXXNewContext, clang::FileContext, clang::ForContext, clang::FunctionalCastContext, clang::UnqualifiedId::getKind(), clang::IK_Identifier, clang::InitStmtContext, clang::KNRTypeListContext, clang::LambdaExprContext, clang::LambdaExprParameterContext, clang::MemberContext, clang::ObjCCatchContext, clang::ObjCParameterContext, clang::ObjCResultContext, clang::PrototypeContext, clang::DeclSpec::SCS_extern, clang::DeclSpec::SCS_typedef, clang::TemplateArgContext, clang::TemplateParamContext, clang::TemplateTypeArgContext, clang::TrailingReturnContext, clang::TrailingReturnVarContext, and clang::TypeNameContext.
Referenced by getMissingDeclaratorIdLoc().
|
inline |
Return true if the context permits a C++17 decomposition declarator.
Definition at line 2001 of file DeclSpec.h.
References clang::AliasDeclContext, clang::AliasTemplateContext, clang::BlockContext, clang::BlockLiteralContext, clang::ConditionContext, clang::ConversionIdContext, clang::CXXCatchContext, clang::CXXNewContext, clang::FileContext, clang::ForContext, clang::FunctionalCastContext, clang::InitStmtContext, clang::KNRTypeListContext, clang::LambdaExprContext, clang::LambdaExprParameterContext, clang::MemberContext, clang::ObjCCatchContext, clang::ObjCParameterContext, clang::ObjCResultContext, clang::PrototypeContext, clang::TemplateArgContext, clang::TemplateParamContext, clang::TemplateTypeArgContext, clang::TrailingReturnContext, clang::TrailingReturnVarContext, and clang::TypeNameContext.
|
inline |
mayHaveIdentifier - Return true if the identifier is either optional or required.
This is true for normal declarators and prototypes, but not typenames.
Definition at line 1965 of file DeclSpec.h.
References clang::AliasDeclContext, clang::AliasTemplateContext, clang::BlockContext, clang::BlockLiteralContext, clang::ConditionContext, clang::ConversionIdContext, clang::CXXCatchContext, clang::CXXNewContext, clang::FileContext, clang::ForContext, clang::FunctionalCastContext, clang::InitStmtContext, clang::KNRTypeListContext, clang::LambdaExprContext, clang::LambdaExprParameterContext, clang::MemberContext, clang::ObjCCatchContext, clang::ObjCParameterContext, clang::ObjCResultContext, clang::PrototypeContext, clang::TemplateArgContext, clang::TemplateParamContext, clang::TemplateTypeArgContext, clang::TrailingReturnContext, clang::TrailingReturnVarContext, and clang::TypeNameContext.
Referenced by getMissingDeclaratorIdLoc(), and isPipeDeclerator().
|
inline |
mayOmitIdentifier - Return true if the identifier is either optional or not allowed.
This is true for typenames, prototypes, and template parameter lists.
Definition at line 1927 of file DeclSpec.h.
References clang::AliasDeclContext, clang::AliasTemplateContext, clang::BlockContext, clang::BlockLiteralContext, clang::ConditionContext, clang::ConversionIdContext, clang::CXXCatchContext, clang::CXXNewContext, clang::FileContext, clang::ForContext, clang::FunctionalCastContext, clang::InitStmtContext, clang::KNRTypeListContext, clang::LambdaExprContext, clang::LambdaExprParameterContext, clang::MemberContext, clang::ObjCCatchContext, clang::ObjCParameterContext, clang::ObjCResultContext, clang::PrototypeContext, clang::TemplateArgContext, clang::TemplateParamContext, clang::TemplateTypeArgContext, clang::TrailingReturnContext, clang::TrailingReturnVarContext, and clang::TypeNameContext.
Referenced by getMissingDeclaratorIdLoc(), and isPipeDeclerator().
|
inline |
Definition at line 2419 of file DeclSpec.h.
|
inline |
Definition at line 2441 of file DeclSpec.h.
Referenced by clang::Parser::ParseTopLevelDecl().
void Declarator::setDecompositionBindings | ( | SourceLocation | LSquareLoc, |
ArrayRef< DecompositionDeclarator::Binding > | Bindings, | ||
SourceLocation | RSquareLoc | ||
) |
Set the decomposition bindings for this declarator.
Definition at line 277 of file DeclSpec.cpp.
References clang::ast_matchers::hasName().
Referenced by getMissingDeclaratorIdLoc().
|
inline |
Definition at line 2445 of file DeclSpec.h.
Referenced by getMissingDeclaratorIdLoc().
Definition at line 2422 of file DeclSpec.h.
Referenced by isPipeDeclerator().
|
inline |
Definition at line 2447 of file DeclSpec.h.
Referenced by clang::Sema::ActOnStartOfFunctionDef(), and clang::Parser::ParseTopLevelDecl().
|
inline |
Definition at line 2436 of file DeclSpec.h.
Referenced by getMissingDeclaratorIdLoc().
|
inline |
Set the name of this declarator to be the given identifier.
Definition at line 2125 of file DeclSpec.h.
References clang::UnqualifiedId::setIdentifier().
Referenced by getMissingDeclaratorIdLoc().
Definition at line 2431 of file DeclSpec.h.
Referenced by clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDestructorDeclarator(), GetDeclSpecTypeForDeclarator(), getFunctionStorageClass(), getMissingDeclaratorIdLoc(), clang::Sema::HandleMSProperty(), and clang::Parser::ParseUnqualifiedId().
Definition at line 2425 of file DeclSpec.h.
Definition at line 2428 of file DeclSpec.h.
|
inline |
SetRangeBegin - Set the start of the source range to Loc, unless it's invalid.
Definition at line 1885 of file DeclSpec.h.
References clang::SourceLocation::isInvalid(), and clang::SourceRange::setBegin().
Referenced by getMissingDeclaratorIdLoc(), and clang::Parser::ParseTopLevelDecl().
|
inline |
SetRangeEnd - Set the end of the source range to Loc, unless it's invalid.
Definition at line 1890 of file DeclSpec.h.
References clang::SourceLocation::isInvalid(), and clang::SourceRange::setEnd().
Referenced by getMissingDeclaratorIdLoc(), and isPipeDeclerator().
|
inline |
Definition at line 2473 of file DeclSpec.h.
|
inline |
Definition at line 1882 of file DeclSpec.h.
Referenced by clang::Parser::ParseUnqualifiedId().
|
inline |
takeAttributes - Takes attributes from the given parsed-attributes set and add them to this declarator.
These examples both add 3 attributes to "var": short int var attribute((aligned(16),common,deprecated)); short int x, attribute((aligned(16)) var attribute((common,deprecated));
Also extends the range of the declarator.
Definition at line 2391 of file DeclSpec.h.
References clang::SourceLocation::isInvalid(), and clang::ParsedAttributes::takeAllFrom().
|
inline |
Returns the range of type objects, from the identifier outwards.
Definition at line 2181 of file DeclSpec.h.
Referenced by clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDeductionGuideDeclarator(), and warnAboutRedundantParens().
|
friend |
Definition at line 1825 of file DeclSpec.h.
DecompositionDeclarator::Binding clang::Declarator::InlineBindings[16] |
Definition at line 1812 of file DeclSpec.h.
DeclaratorChunk::ParamInfo clang::Declarator::InlineParams[16] |
InlineParams - This is a local array used for the first function decl chunk to avoid going to the heap for the common case when we have one function chunk in the declarator.
Definition at line 1811 of file DeclSpec.h.