clang 20.0.0git
|
A class for parsing a declarator. More...
#include "clang/Parse/RAIIObjectsForParser.h"
Public Member Functions | |
ParsingDeclarator (Parser &P, const ParsingDeclSpec &DS, const ParsedAttributes &DeclarationAttrs, DeclaratorContext C) | |
const ParsingDeclSpec & | getDeclSpec () const |
ParsingDeclSpec & | getMutableDeclSpec () const |
void | clear () |
void | complete (Decl *D) |
Public Member Functions inherited from clang::Declarator | |
Declarator (const DeclSpec &DS, const ParsedAttributesView &DeclarationAttrs, DeclaratorContext C) | |
DS and DeclarationAttrs must outlive the Declarator . | |
~Declarator () | |
const DeclSpec & | getDeclSpec () const |
getDeclSpec - Return the declaration-specifier that this declarator was declared with. | |
DeclSpec & | getMutableDeclSpec () |
getMutableDeclSpec - Return a non-const version of the DeclSpec. | |
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. | |
CXXScopeSpec & | getCXXScopeSpec () |
UnqualifiedId & | getName () |
Retrieve the name specified by this declarator. | |
const DecompositionDeclarator & | getDecompositionDeclarator () const |
DeclaratorContext | getContext () const |
bool | isPrototypeContext () const |
SourceRange | getSourceRange () const LLVM_READONLY |
Get the source range that spans this declarator. | |
SourceLocation | getBeginLoc () 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. | |
void | SetRangeEnd (SourceLocation Loc) |
SetRangeEnd - Set the end of the source range to Loc, unless it's invalid. | |
void | ExtendWithDeclSpec (const DeclSpec &DS) |
ExtendWithDeclSpec - Extend the declarator source range to include the given declspec, unless its location is invalid. | |
void | clear () |
Reset the contents of this Declarator. | |
bool | mayOmitIdentifier () const |
mayOmitIdentifier - Return true if the identifier is either optional or not allowed. | |
bool | mayHaveIdentifier () const |
mayHaveIdentifier - Return true if the identifier is either optional or required. | |
bool | mayHaveDecompositionDeclarator () const |
Return true if the context permits a C++17 decomposition declarator. | |
bool | mayBeFollowedByCXXDirectInit () const |
mayBeFollowedByCXXDirectInit - Return true if the declarator can be followed by a C++ direct initializer, e.g. | |
bool | isPastIdentifier () const |
isPastIdentifier - Return true if we have parsed beyond the point where the name would appear. | |
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). | |
bool | isDecompositionDeclarator () const |
Return whether this declarator is a decomposition declarator. | |
const IdentifierInfo * | getIdentifier () const |
SourceLocation | getIdentifierLoc () const |
void | SetIdentifier (const IdentifierInfo *Id, SourceLocation IdLoc) |
Set the name of this declarator to be the given identifier. | |
void | setDecompositionBindings (SourceLocation LSquareLoc, MutableArrayRef< DecompositionDeclarator::Binding > Bindings, SourceLocation RSquareLoc) |
Set the decomposition bindings for this declarator. | |
void | AddTypeInfo (const DeclaratorChunk &TI, ParsedAttributes &&attrs, SourceLocation EndLoc) |
AddTypeInfo - Add a chunk to this declarator. | |
void | AddTypeInfo (const DeclaratorChunk &TI, AttributePool &OtherPool, SourceLocation EndLoc) |
AddTypeInfo - Add a chunk to this declarator. | |
void | AddTypeInfo (const DeclaratorChunk &TI, SourceLocation EndLoc) |
AddTypeInfo - Add a chunk to this declarator. | |
void | AddInnermostTypeInfo (const DeclaratorChunk &TI) |
Add a new innermost chunk to this declarator. | |
unsigned | getNumTypeObjects () const |
Return the number of types applied to this declarator. | |
const DeclaratorChunk & | getTypeObject (unsigned i) const |
Return the specified TypeInfo from this declarator. | |
DeclaratorChunk & | getTypeObject (unsigned i) |
type_object_range | type_objects () const |
Returns the range of type objects, from the identifier outwards. | |
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. | |
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. | |
bool | isArrayOfUnknownBound () const |
isArrayOfUnknownBound - This method returns true if the declarator is a declarator for an array of unknown bound (looking through parentheses). | |
bool | isFunctionDeclarator (unsigned &idx) const |
isFunctionDeclarator - This method returns true if the declarator is a function declarator (looking through parentheses). | |
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). | |
DeclaratorChunk::FunctionTypeInfo & | getFunctionTypeInfo () |
getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses). | |
const DeclaratorChunk::FunctionTypeInfo & | getFunctionTypeInfo () const |
getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses). | |
bool | isDeclarationOfFunction () const |
Determine whether the declaration that will be produced from this declaration will be a function. | |
bool | isFunctionDeclarationContext () const |
Return true if this declaration appears in a context where a function declarator would be a function declaration. | |
bool | isExpressionContext () const |
Determine whether this declaration appears in a context where an expression could appear. | |
bool | isFunctionDeclaratorAFunctionDeclaration () const |
Return true if a function declarator at this position would be a function declaration. | |
bool | hasTrailingReturnType () const |
Determine whether a trailing return type was written (at any level) within this declarator. | |
ParsedType | getTrailingReturnType () const |
Get the trailing return type appearing (at any level) within this declarator. | |
void | setTrailingRequiresClause (Expr *TRC) |
Sets a trailing requires clause for this declarator. | |
Expr * | getTrailingRequiresClause () |
Sets a trailing requires clause for this declarator. | |
bool | hasTrailingRequiresClause () const |
Determine whether a trailing requires clause was written in this declarator. | |
void | setTemplateParameterLists (ArrayRef< TemplateParameterList * > TPLs) |
Sets the template parameter lists that preceded the declarator. | |
ArrayRef< TemplateParameterList * > | getTemplateParameterLists () const |
The template parameter lists that preceded the declarator. | |
void | setInventedTemplateParameterList (TemplateParameterList *Invented) |
Sets the template parameter list generated from the explicit template parameters along with any invented template parameters from placeholder-typed parameters. | |
TemplateParameterList * | getInventedTemplateParameterList () const |
The template parameter list generated from the explicit template parameters along with any invented template parameters from placeholder-typed parameters, if there were any such parameters. | |
void | takeAttributes (ParsedAttributes &attrs) |
takeAttributes - Takes attributes from the given parsed-attributes set and add them to this declarator. | |
const ParsedAttributes & | getAttributes () const |
ParsedAttributes & | getAttributes () |
const ParsedAttributesView & | getDeclarationAttributes () const |
bool | hasAttributes () const |
hasAttributes - do we contain any attributes? | |
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) |
bool | hasPackIndexing () const |
Expr * | getPackIndexingExpr () const |
void | setPackIndexingExpr (Expr *PI) |
void | setFunctionDefinitionKind (FunctionDefinitionKind Val) |
bool | isFunctionDefinition () const |
FunctionDefinitionKind | getFunctionDefinitionKind () const |
void | setHasInitializer (bool Val=true) |
bool | hasInitializer () const |
bool | isFirstDeclarationOfMember () |
Returns true if this declares a real member and not a friend. | |
bool | isStaticMember () |
Returns true if this declares a static member. | |
bool | isExplicitObjectMemberFunction () |
bool | isCtorOrDtor () |
Returns true if this declares a constructor or a destructor. | |
void | setRedeclaration (bool Val) |
bool | isRedeclaration () const |
Additional Inherited Members | |
Public Types inherited from clang::Declarator | |
typedef SmallVectorImpl< DeclaratorChunk >::const_iterator | type_object_iterator |
typedef llvm::iterator_range< type_object_iterator > | type_object_range |
A class for parsing a declarator.
Definition at line 200 of file RAIIObjectsForParser.h.
|
inline |
Definition at line 204 of file RAIIObjectsForParser.h.
|
inline |
Definition at line 218 of file RAIIObjectsForParser.h.
References clang::Declarator::clear(), and clang::ParsingDeclRAIIObject::reset().
|
inline |
Definition at line 223 of file RAIIObjectsForParser.h.
References clang::ParsingDeclRAIIObject::complete(), and D.
|
inline |
Definition at line 210 of file RAIIObjectsForParser.h.
References clang::Declarator::getDeclSpec().
Referenced by getMutableDeclSpec().
|
inline |
Definition at line 214 of file RAIIObjectsForParser.h.
References getDeclSpec().