|
clang
5.0.0
|
Information about one declarator, including the parsed type information and the identifier. More...
#include "clang/Sema/DeclSpec.h"
Public Types | |
| enum | TheContext { FileContext, PrototypeContext, ObjCResultContext, ObjCParameterContext, KNRTypeListContext, TypeNameContext, FunctionalCastContext, MemberContext, BlockContext, ForContext, InitStmtContext, ConditionContext, TemplateParamContext, CXXNewContext, CXXCatchContext, ObjCCatchContext, BlockLiteralContext, LambdaExprContext, LambdaExprParameterContext, ConversionIdContext, TrailingReturnContext, TemplateTypeArgContext, AliasDeclContext, AliasTemplateContext } |
| 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, TheContext 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 |
| TheContext | 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 | getLocEnd () 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 | 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 | 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 AttributeList * | getAttributes () const |
| AttributeList * | getAttributes () |
| AttributeList *& | getAttrListRef () |
| 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 1733 of file DeclSpec.h.
| typedef SmallVectorImpl<DeclaratorChunk>::const_iterator clang::Declarator::type_object_iterator |
Definition at line 2165 of file DeclSpec.h.
| typedef llvm::iterator_range<type_object_iterator> clang::Declarator::type_object_range |
Definition at line 2166 of file DeclSpec.h.
Definition at line 1735 of file DeclSpec.h.
|
inline |
Definition at line 1836 of file DeclSpec.h.
|
inline |
Definition at line 1844 of file DeclSpec.h.
References clear().
|
inline |
Add a new innermost chunk to this declarator.
Definition at line 2147 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.
Definition at line 2135 of file DeclSpec.h.
References getAttributePool(), clang::ParsedAttributes::getList(), clang::ParsedAttributes::getPool(), clang::SourceLocation::isInvalid(), SetRangeEnd(), and clang::AttributePool::takeAllFrom().
Referenced by clang::Sema::ActOnCXXForRangeIdentifier(), clang::Sema::actOnObjCTypeArgsOrProtocolQualifiers(), and clang::Sema::ImplicitlyDefineFunction().
|
inline |
Reset the contents of this Declarator.
Definition at line 1912 of file DeclSpec.h.
References clang::CXXScopeSpec::clear(), clang::ParsedAttributes::clear(), clang::DecompositionDeclarator::clear(), clang::DeclSpec::getSourceRange(), and Name.
Referenced by clang::ParsingDeclarator::clear(), and ~Declarator().
|
inline |
Definition at line 2173 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 1903 of file DeclSpec.h.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::DeclSpec::getSourceRange(), clang::SourceLocation::isInvalid(), clang::SourceRange::setBegin(), and clang::SourceRange::setEnd().
|
inline |
Definition at line 2369 of file DeclSpec.h.
Referenced by clang::Sema::ActOnFunctionDeclarator(), and clang::Sema::ActOnVariableDeclarator().
|
inline |
Definition at line 1858 of file DeclSpec.h.
References clang::ParsedAttributes::getPool().
Referenced by addContextSensitiveTypeNullability(), AddTypeInfo(), takeDeclAttributes(), and transferARCOwnershipToDeclaratorChunk().
|
inline |
Definition at line 2343 of file DeclSpec.h.
References clang::ParsedAttributes::getList().
Referenced by clang::Sema::checkUnusedDeclAttributes(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), clang::Sema::GetTypeSourceInfoForDeclarator(), hasAttributes(), hasParsedAttr(), clang::Sema::ProcessDeclAttributes(), and takeDeclAttributes().
|
inline |
Definition at line 2344 of file DeclSpec.h.
References clang::ParsedAttributes::getList().
|
inline |
Definition at line 2346 of file DeclSpec.h.
References clang::ParsedAttributes::getListRef().
Referenced by distributeFunctionTypeAttrFromDeclarator(), and distributeObjCPointerTypeAttrFromDeclarator().
|
inline |
Definition at line 2389 of file DeclSpec.h.
Referenced by warnAboutAmbiguousFunction().
|
inline |
Definition at line 1874 of file DeclSpec.h.
References Context.
Referenced by clang::Sema::ActOnBlockArguments(), clang::Sema::ActOnTypeName(), clang::Sema::CodeCompleteFunctionQualifiers(), ConvertDeclSpecToType(), getCCForDeclaratorChunk(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), isFirstDeclarationOfMember(), isOmittedBlockReturnType(), isStaticMember(), processTypeAttrs(), and warnAboutAmbiguousFunction().
|
inline |
Return a source range list of C++11 attributes associated with the declarator.
Definition at line 2359 of file DeclSpec.h.
References clang::ParsedAttributes::getList(), clang::AttributeList::getNext(), clang::AttributeList::getRange(), and clang::AttributeList::isCXX11Attribute().
|
inline |
getCXXScopeSpec - Return the C++ scope specifier (global scope or nested-name-specifier) that is part of the declarator-id.
Definition at line 1864 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnExceptionDeclarator(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnObjCExceptionDecl(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::ActOnVariableDeclarator(), GetFullTypeForDeclarator(), clang::Sema::HandleDeclarator(), and SetNestedNameSpecifier().
|
inline |
Definition at line 1865 of file DeclSpec.h.
|
inline |
getDeclSpec - Return the declaration-specifier that this declarator was declared with.
Definition at line 1849 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXConditionDeclaration(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnCXXNew(), clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIvar(), clang::Sema::ActOnObjCExceptionDecl(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::canDelayFunctionBody(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDestructorDeclarator(), clang::Sema::CheckFieldDecl(), checkOmittedBlockReturnType(), clang::Sema::checkUnusedDeclAttributes(), clang::Sema::containsUnexpandedParameterPacks(), ConvertDeclSpecToType(), CreateNewFunctionDecl(), diagnoseRedundantReturnTypeQualifiers(), getCCForDeclaratorChunk(), clang::ParsingDeclarator::getDeclSpec(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), getFunctionStorageClass(), clang::Sema::GetTypeSourceInfoForDeclarator(), clang::Sema::HandleDeclarator(), clang::Sema::HandleField(), clang::Sema::HandleMSProperty(), hasAttributes(), hasParsedAttr(), isFirstDeclarationOfMember(), isFunctionDeclarationContext(), isOmittedBlockReturnType(), isStaticMember(), mayBeFollowedByCXXDirectInit(), clang::Sema::ParseTypedefDecl(), clang::Sema::ProcessDeclAttributes(), processTypeAttrs(), takeDeclAttributes(), and warnAboutAmbiguousFunction().
|
inline |
Definition at line 1870 of file DeclSpec.h.
Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnVariableDeclarator(), and clang::Sema::HandleField().
|
inline |
Definition at line 2393 of file DeclSpec.h.
Referenced by GetFullTypeForDeclarator(), and clang::Sema::GetTypeSourceInfoForDeclarator().
|
inline |
Definition at line 2372 of file DeclSpec.h.
|
inline |
Definition at line 2404 of file DeclSpec.h.
Referenced by clang::Sema::ActOnFunctionDeclarator(), GetFullTypeForDeclarator(), isFunctionDefinition(), and warnAboutAmbiguousFunction().
|
inline |
getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses).
Definition at line 2245 of file DeclSpec.h.
References isFunctionDeclarator().
Referenced by clang::Sema::ActOnFinishKNRParamDeclarations(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDestructorDeclarator(), CreateNewFunctionDecl(), getFunctionTypeInfo(), and maybeSynthesizeBlockSignature().
|
inline |
getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses).
Definition at line 2254 of file DeclSpec.h.
References getFunctionTypeInfo().
|
inline |
Definition at line 2114 of file DeclSpec.h.
References clang::UnqualifiedId::IK_Identifier, and Name.
Referenced by clang::Sema::ActOnBlockArguments(), clang::Sema::ActOnExceptionDeclarator(), clang::Sema::ActOnIvar(), clang::Sema::ActOnNonTypeTemplateParameter(), clang::Sema::ActOnObjCExceptionDecl(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ActOnTypeName(), clang::Sema::CreatePropertyDecl(), GetFullTypeForDeclarator(), clang::Sema::HandleField(), clang::Sema::HandleMSProperty(), clang::Sema::HandlePropertyInClassExtension(), clang::Sema::isLibstdcxxEagerExceptionSpecHack(), clang::Sema::ParseTypedefDecl(), and warnAboutAmbiguousFunction().
|
inline |
Definition at line 2120 of file DeclSpec.h.
References Name.
Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnExceptionDeclarator(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIvar(), clang::Sema::ActOnNonTypeTemplateParameter(), clang::Sema::ActOnObjCExceptionDecl(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDestructorDeclarator(), ConvertDeclSpecToType(), CreateNewFunctionDecl(), clang::Sema::CreatePropertyDecl(), diagnoseRedundantReturnTypeQualifiers(), GetFullTypeForDeclarator(), clang::Sema::HandleDeclarator(), clang::Sema::HandleField(), clang::Sema::HandleMSProperty(), clang::Sema::ParseTypedefDecl(), RebuildDeclaratorInCurrentInstantiation(), and warnAboutAmbiguousFunction().
|
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 2182 of file DeclSpec.h.
Referenced by GetFullTypeForDeclarator(), and isArrayOfUnknownBound().
|
inline |
Definition at line 1886 of file DeclSpec.h.
References clang::SourceRange::getEnd().
Referenced by clang::Sema::ActOnCXXNew(), and CreateNewFunctionDecl().
|
inline |
Definition at line 1885 of file DeclSpec.h.
References clang::SourceRange::getBegin().
Referenced by clang::Sema::ActOnBlockArguments(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnExceptionDeclarator(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnNonTypeTemplateParameter(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ActOnVariableDeclarator(), CreateNewFunctionDecl(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), clang::Sema::HandleField(), clang::Sema::HandleMSProperty(), clang::Sema::isLibstdcxxEagerExceptionSpecHack(), maybeSynthesizeBlockSignature(), and clang::Sema::ParseTypedefDecl().
|
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 1856 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnObjCExceptionDecl(), clang::Sema::ActOnParamDeclarator(), addContextSensitiveTypeNullability(), clang::Sema::CheckDeductionGuideDeclarator(), checkOmittedBlockReturnType(), distributeObjCPointerTypeAttrFromDeclarator(), GetFullTypeForDeclarator(), getFunctionStorageClass(), and RebuildDeclaratorInCurrentInstantiation().
|
inline |
Retrieve the name specified by this declarator.
Definition at line 1868 of file DeclSpec.h.
References Name.
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDestructorDeclarator(), diagnoseRedundantReturnTypeQualifiers(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), getMissingDeclaratorIdLoc(), clang::Sema::GetNameForDeclarator(), isCtorOrDtor(), and isStaticMember().
|
inline |
Return the number of types applied to this declarator.
Definition at line 2152 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXNew(), clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnStartOfLambdaDefinition(), addContextSensitiveTypeNullability(), clang::Sema::canDelayFunctionBody(), clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::checkUnusedDeclAttributes(), classifyPointerDeclarator(), clang::Sema::containsUnexpandedParameterPacks(), diagnoseRedundantReturnTypeQualifiers(), distributeFunctionTypeAttrToInnermost(), distributeObjCPointerTypeAttrFromDeclarator(), GetFullTypeForDeclarator(), clang::Sema::GetTypeSourceInfoForDeclarator(), handleObjCOwnershipTypeAttr(), hasAttributes(), hasParsedAttr(), inferARCWriteback(), isFunctionDeclaratorAFunctionDeclaration(), isOmittedBlockReturnType(), isPipeDeclerator(), maybeMovePastReturnType(), maybeSynthesizeBlockSignature(), clang::Sema::ProcessDeclAttributes(), RebuildDeclaratorInCurrentInstantiation(), takeDeclAttributes(), and transferARCOwnership().
|
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 2193 of file DeclSpec.h.
|
inline |
Get the source range that spans this declarator.
Definition at line 1884 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXConditionDeclaration(), clang::Sema::ActOnCXXNew(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnObjCExceptionDecl(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::CheckDeductionGuideDeclarator(), GetFullTypeForDeclarator(), clang::Sema::HandleDeclarator(), and clang::Parser::ParseTypeName().
|
inline |
Return the specified TypeInfo from this declarator.
TypeInfo #0 is closest to the identifier.
Definition at line 2156 of file DeclSpec.h.
Referenced by clang::Sema::ActOnCXXNew(), clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFunctionDeclarator(), addContextSensitiveTypeNullability(), clang::Sema::canDelayFunctionBody(), clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::checkUnusedDeclAttributes(), classifyPointerDeclarator(), clang::Sema::containsUnexpandedParameterPacks(), diagnoseRedundantReturnTypeQualifiers(), distributeFunctionTypeAttr(), distributeFunctionTypeAttrToInnermost(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), distributeObjCPointerTypeAttrFromDeclarator(), getCCForDeclaratorChunk(), GetFullTypeForDeclarator(), clang::Sema::GetTypeSourceInfoForDeclarator(), hasAttributes(), hasOuterPointerLikeChunk(), hasParsedAttr(), inferARCWriteback(), isFunctionDeclaratorAFunctionDeclaration(), isOmittedBlockReturnType(), isPipeDeclerator(), maybeMovePastReturnType(), clang::Sema::ProcessDeclAttributes(), processTypeAttrs(), RebuildDeclaratorInCurrentInstantiation(), takeDeclAttributes(), transferARCOwnership(), and transferARCOwnershipToDeclaratorChunk().
|
inline |
Definition at line 2160 of file DeclSpec.h.
|
inline |
hasAttributes - do we contain any attributes?
Definition at line 2349 of file DeclSpec.h.
References getAttributes(), getDeclSpec(), getNumTypeObjects(), and getTypeObject().
|
inline |
Definition at line 2392 of file DeclSpec.h.
References clang::SourceLocation::isValid().
Referenced by clang::Sema::ActOnNonTypeTemplateParameter(), GetDeclSpecTypeForDeclarator(), and GetFullTypeForDeclarator().
|
inline |
Definition at line 2386 of file DeclSpec.h.
Referenced by clang::Sema::ActOnDecompositionDeclarator(), and mayBeFollowedByCXXDirectInit().
|
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 2104 of file DeclSpec.h.
References clang::UnqualifiedId::IK_Identifier, isDecompositionDeclarator(), and Name.
Referenced by clang::Sema::ActOnParamDeclarator(), and setDecompositionBindings().
|
inline |
Determine whether a trailing return type was written (at any level) within this declarator.
Definition at line 2319 of file DeclSpec.h.
References clang::DeclaratorChunk::Function, and type_objects().
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 2204 of file DeclSpec.h.
References clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, getInnermostNonParenChunk(), clang::DeclaratorChunk::Kind, and clang::DeclaratorChunk::ArrayTypeInfo::NumElts.
| bool Declarator::isCtorOrDtor | ( | ) |
Returns true if this declares a constructor or a destructor.
Definition at line 396 of file DeclSpec.cpp.
References getKind(), clang::UnqualifiedId::getKind(), getName(), clang::UnqualifiedId::IK_ConstructorName, and clang::UnqualifiedId::IK_DestructorName.
Referenced by clang::Sema::ActOnFunctionDeclarator(), and clang::Sema::CodeCompleteFunctionQualifiers().
| 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 308 of file DeclSpec.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, E, clang::DeclaratorChunk::Function, clang::OpaquePtr< PtrTy >::get(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsType(), clang::DeclSpec::getTypeSpecType(), clang::Type::isFunctionType(), clang::QualType::isNull(), clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, clang::TST_atomic, clang::TST_auto, clang::TST_auto_type, clang::TST_bool, clang::TST_char, clang::TST_char16, clang::TST_char32, 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_half, clang::TST_int, clang::TST_int128, clang::TST_interface, clang::TST_struct, clang::TST_typename, clang::TST_typeofExpr, clang::TST_typeofType, clang::TST_underlyingType, clang::TST_union, clang::TST_unknown_anytype, clang::TST_unspecified, clang::TST_void, and clang::TST_wchar.
Referenced by clang::Sema::ActOnCXXMemberDeclarator().
|
inline |
Return whether this declarator is a decomposition declarator.
Definition at line 2110 of file DeclSpec.h.
References clang::DecompositionDeclarator::isSet().
Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::HandleDeclarator(), clang::Sema::HandleField(), and hasName().
|
inline |
Returns true if this declares a real member and not a friend.
Definition at line 2409 of file DeclSpec.h.
References getContext(), getDeclSpec(), clang::DeclSpec::isFriendSpecified(), and MemberContext.
Referenced by clang::Sema::ActOnFunctionDeclarator(), and getCCForDeclaratorChunk().
|
inline |
Definition at line 2388 of file DeclSpec.h.
References clang::SourceLocation::isValid().
Referenced by warnAboutAmbiguousFunction().
|
inline |
Return true if this declaration appears in a context where a function declarator would be a function declaration.
Definition at line 2268 of file DeclSpec.h.
References AliasDeclContext, AliasTemplateContext, BlockContext, BlockLiteralContext, ConditionContext, Context, ConversionIdContext, CXXCatchContext, CXXNewContext, FileContext, ForContext, FunctionalCastContext, getDeclSpec(), InitStmtContext, KNRTypeListContext, LambdaExprContext, LambdaExprParameterContext, MemberContext, ObjCCatchContext, ObjCParameterContext, ObjCResultContext, PrototypeContext, clang::DeclSpec::SCS_typedef, TemplateParamContext, TemplateTypeArgContext, TrailingReturnContext, and TypeNameContext.
Referenced by clang::Sema::CheckExtraCXXDefaultArguments(), GetFullTypeForDeclarator(), and isFunctionDeclaratorAFunctionDeclaration().
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 2214 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::ActOnFunctionDeclarator(), clang::Sema::ActOnStartOfFunctionDef(), clang::Sema::ActOnStartOfLambdaDefinition(), CreateNewFunctionDecl(), getCCForDeclaratorChunk(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), maybeSynthesizeBlockSignature(), processTypeAttrs(), 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 2238 of file DeclSpec.h.
Referenced by getFunctionTypeInfo().
|
inline |
Return true if a function declarator at this position would be a function declaration.
Definition at line 2306 of file DeclSpec.h.
References getNumTypeObjects(), getTypeObject(), I, isFunctionDeclarationContext(), and clang::DeclaratorChunk::Paren.
|
inline |
Definition at line 2400 of file DeclSpec.h.
References clang::FDK_Declaration, and getFunctionDefinitionKind().
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::CheckDeductionGuideDeclarator(), and processTypeAttrs().
|
inline |
Definition at line 2381 of file DeclSpec.h.
References clang::DeclSpec::getTypeSpecType(), and clang::DeclSpec::TST_error.
Referenced by clang::Sema::ActOnCastExpr(), clang::Sema::ActOnCXXNamedCast(), clang::Sema::ActOnCXXNew(), clang::Sema::ActOnExceptionDeclarator(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIvar(), clang::Sema::ActOnObjCExceptionDecl(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ActOnTypeName(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDestructorDeclarator(), clang::Sema::CheckFieldDecl(), CreateNewFunctionDecl(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), clang::Sema::HandleDeclarator(), clang::Sema::ParseTypedefDecl(), and clang::Parser::ParseTypeName().
|
inline |
Definition at line 2375 of file DeclSpec.h.
|
inline |
Definition at line 2378 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 2098 of file DeclSpec.h.
References Name.
|
inline |
Definition at line 1876 of file DeclSpec.h.
References Context, LambdaExprParameterContext, ObjCParameterContext, ObjCResultContext, and PrototypeContext.
Referenced by GetFullTypeForDeclarator(), and clang::Sema::GetTypeForDeclarator().
|
inline |
Definition at line 2422 of file DeclSpec.h.
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::ActOnVariableDeclarator(), and clang::Sema::HandleDeclarator().
| 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 388 of file DeclSpec.cpp.
References getContext(), getDeclSpec(), getName(), clang::DeclSpec::getStorageClassSpec(), clang::UnqualifiedId::IK_OperatorFunctionId, clang::CXXMethodDecl::isStaticOverloadedOperator(), clang::UnqualifiedId::Kind, MemberContext, and clang::DeclSpec::SCS_static.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::CodeCompleteFunctionQualifiers(), and getCCForDeclaratorChunk().
|
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 AliasDeclContext, AliasTemplateContext, BlockContext, BlockLiteralContext, ConditionContext, Context, ConversionIdContext, CXXCatchContext, CXXNewContext, FileContext, ForContext, FunctionalCastContext, getDeclSpec(), hasGroupingParens(), clang::UnqualifiedId::IK_Identifier, InitStmtContext, KNRTypeListContext, LambdaExprContext, LambdaExprParameterContext, MemberContext, Name, ObjCCatchContext, ObjCParameterContext, ObjCResultContext, PrototypeContext, clang::DeclSpec::SCS_extern, clang::DeclSpec::SCS_typedef, TemplateParamContext, TemplateTypeArgContext, TrailingReturnContext, and TypeNameContext.
|
inline |
Return true if the context permits a C++17 decomposition declarator.
Definition at line 2003 of file DeclSpec.h.
References AliasDeclContext, AliasTemplateContext, BlockContext, BlockLiteralContext, ConditionContext, Context, ConversionIdContext, CXXCatchContext, CXXNewContext, FileContext, ForContext, FunctionalCastContext, InitStmtContext, KNRTypeListContext, LambdaExprContext, LambdaExprParameterContext, MemberContext, ObjCCatchContext, ObjCParameterContext, ObjCResultContext, PrototypeContext, TemplateParamContext, TemplateTypeArgContext, TrailingReturnContext, and TypeNameContext.
Referenced by clang::Sema::ActOnDecompositionDeclarator().
|
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 1969 of file DeclSpec.h.
References AliasDeclContext, AliasTemplateContext, BlockContext, BlockLiteralContext, ConditionContext, Context, ConversionIdContext, CXXCatchContext, CXXNewContext, FileContext, ForContext, FunctionalCastContext, InitStmtContext, KNRTypeListContext, LambdaExprContext, LambdaExprParameterContext, MemberContext, ObjCCatchContext, ObjCParameterContext, ObjCResultContext, PrototypeContext, TemplateParamContext, TemplateTypeArgContext, TrailingReturnContext, and TypeNameContext.
|
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 1933 of file DeclSpec.h.
References AliasDeclContext, AliasTemplateContext, BlockContext, BlockLiteralContext, ConditionContext, Context, ConversionIdContext, CXXCatchContext, CXXNewContext, FileContext, ForContext, FunctionalCastContext, InitStmtContext, KNRTypeListContext, LambdaExprContext, LambdaExprParameterContext, MemberContext, ObjCCatchContext, ObjCParameterContext, ObjCResultContext, PrototypeContext, TemplateParamContext, TemplateTypeArgContext, TrailingReturnContext, and TypeNameContext.
|
inline |
Definition at line 2368 of file DeclSpec.h.
References E.
|
inline |
Definition at line 2390 of file DeclSpec.h.
| void Declarator::setDecompositionBindings | ( | SourceLocation | LSquareLoc, |
| ArrayRef< DecompositionDeclarator::Binding > | Bindings, | ||
| SourceLocation | RSquareLoc | ||
| ) |
Set the decomposition bindings for this declarator.
Definition at line 276 of file DeclSpec.cpp.
References clang::UnqualifiedId::EndLocation, hasName(), InlineBindings, clang::SourceRange::setEnd(), and SetIdentifier().
|
inline |
Definition at line 2394 of file DeclSpec.h.
Referenced by GetFullTypeForDeclarator().
Definition at line 2371 of file DeclSpec.h.
|
inline |
Definition at line 2396 of file DeclSpec.h.
Referenced by clang::Sema::ActOnDeclarator(), and clang::Sema::ActOnStartOfFunctionDef().
|
inline |
Definition at line 2385 of file DeclSpec.h.
|
inline |
Set the name of this declarator to be the given identifier.
Definition at line 2123 of file DeclSpec.h.
References Name.
Referenced by clang::Sema::ActOnCXXForRangeIdentifier(), clang::Sema::ActOnFinishKNRParamDeclarations(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ImplicitlyDefineFunction(), and setDecompositionBindings().
Definition at line 2380 of file DeclSpec.h.
Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIvar(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDestructorDeclarator(), checkIsValidOpenCLKernelParameter(), ConvertDeclSpecToType(), CreateNewFunctionDecl(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), getFunctionStorageClass(), clang::Sema::HandleDeclarator(), clang::Sema::HandleField(), and clang::Sema::HandleMSProperty().
Definition at line 2374 of file DeclSpec.h.
Definition at line 2377 of file DeclSpec.h.
Referenced by clang::Sema::ActOnProperty().
|
inline |
SetRangeBegin - Set the start of the source range to Loc, unless it's invalid.
Definition at line 1891 of file DeclSpec.h.
References clang::SourceLocation::isInvalid(), and clang::SourceRange::setBegin().
|
inline |
SetRangeEnd - Set the end of the source range to Loc, unless it's invalid.
Definition at line 1896 of file DeclSpec.h.
References clang::SourceLocation::isInvalid(), and clang::SourceRange::setEnd().
Referenced by AddTypeInfo(), and takeAttributes().
|
inline |
Definition at line 2421 of file DeclSpec.h.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::ActOnVariableDeclarator(), and clang::Sema::ActOnVarTemplateSpecialization().
|
inline |
Definition at line 1888 of file DeclSpec.h.
|
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 2336 of file DeclSpec.h.
References clang::SourceLocation::isInvalid(), SetRangeEnd(), and clang::ParsedAttributes::takeAllFrom().
Referenced by clang::Sema::ActOnCXXForRangeIdentifier().
|
inline |
Returns the range of type objects, from the identifier outwards.
Definition at line 2169 of file DeclSpec.h.
Referenced by clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDeductionGuideDeclarator(), GetFullTypeForDeclarator(), and hasTrailingReturnType().
|
friend |
Definition at line 1833 of file DeclSpec.h.
| DecompositionDeclarator::Binding clang::Declarator::InlineBindings[16] |
Definition at line 1820 of file DeclSpec.h.
Referenced by setDecompositionBindings().
| 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 1819 of file DeclSpec.h.
Referenced by clang::DeclaratorChunk::getFunction().
1.8.6