clang 19.0.0git
Public Member Functions | Public Attributes | List of all members
clang::DeclaratorChunk::FunctionTypeInfo Struct Reference

#include "clang/Sema/DeclSpec.h"

Public Member Functions

void freeParams ()
 Reset the parameter list to having zero parameters.
 
void destroy ()
 
DeclSpecgetOrCreateMethodQualifiers ()
 
bool isKNRPrototype () const
 isKNRPrototype - Return true if this is a K&R style identifier list, like "void foo(a,b,c)".
 
SourceLocation getLParenLoc () const
 
SourceLocation getEllipsisLoc () const
 
SourceLocation getRParenLoc () const
 
SourceLocation getExceptionSpecLocBeg () const
 
SourceLocation getExceptionSpecLocEnd () const
 
SourceRange getExceptionSpecRange () const
 
SourceLocation getRefQualifierLoc () const
 Retrieve the location of the ref-qualifier, if any.
 
SourceLocation getConstQualifierLoc () const
 Retrieve the location of the 'const' qualifier.
 
SourceLocation getVolatileQualifierLoc () const
 Retrieve the location of the 'volatile' qualifier.
 
SourceLocation getRestrictQualifierLoc () const
 Retrieve the location of the 'restrict' qualifier.
 
SourceLocation getMutableLoc () const
 Retrieve the location of the 'mutable' qualifier, if any.
 
bool hasRefQualifier () const
 Determine whether this function declaration contains a ref-qualifier.
 
bool hasMutableQualifier () const
 Determine whether this lambda-declarator contains a 'mutable' qualifier.
 
bool hasMethodTypeQualifiers () const
 Determine whether this method has qualifiers.
 
ExceptionSpecificationType getExceptionSpecType () const
 Get the type of exception specification this function has.
 
unsigned getNumExceptions () const
 Get the number of dynamic exception specifications.
 
ArrayRef< NamedDecl * > getDeclsInPrototype () const
 Get the non-parameter decls defined within this function prototype.
 
bool hasTrailingReturnType () const
 Determine whether this function declarator had a trailing-return-type.
 
ParsedType getTrailingReturnType () const
 Get the trailing-return-type for this function declarator.
 
SourceLocation getTrailingReturnTypeLoc () const
 Get the trailing-return-type location for this function declarator.
 

Public Attributes

unsigned hasPrototype: 1
 hasPrototype - This is true if the function had at least one typed parameter.
 
unsigned isVariadic: 1
 isVariadic - If this function has a prototype, and if that proto ends with ',...)', this is true.
 
unsigned isAmbiguous: 1
 Can this declaration be a constructor-style initializer?
 
unsigned RefQualifierIsLValueRef: 1
 Whether the ref-qualifier (if any) is an lvalue reference.
 
unsigned ExceptionSpecType: 4
 ExceptionSpecType - An ExceptionSpecificationType value.
 
unsigned DeleteParams: 1
 DeleteParams - If this is true, we need to delete[] Params.
 
unsigned HasTrailingReturnType: 1
 HasTrailingReturnType - If this is true, a trailing return type was specified.
 
SourceLocation LParenLoc
 The location of the left parenthesis in the source.
 
SourceLocation EllipsisLoc
 When isVariadic is true, the location of the ellipsis in the source.
 
SourceLocation RParenLoc
 The location of the right parenthesis in the source.
 
unsigned NumParams
 NumParams - This is the number of formal parameters specified by the declarator.
 
unsigned NumExceptionsOrDecls
 NumExceptionsOrDecls - This is the number of types in the dynamic-exception-decl, if the function has one.
 
SourceLocation RefQualifierLoc
 The location of the ref-qualifier, if any.
 
SourceLocation MutableLoc
 The location of the 'mutable' qualifer in a lambda-declarator, if any.
 
SourceLocation ExceptionSpecLocBeg
 The beginning location of the exception specification, if any.
 
SourceLocation ExceptionSpecLocEnd
 The end location of the exception specification, if any.
 
ParamInfoParams
 Params - This is a pointer to a new[]'d array of ParamInfo objects that describe the parameters specified by this function declarator.
 
DeclSpecMethodQualifiers
 DeclSpec for the function with the qualifier related info.
 
AttributeFactoryQualAttrFactory
 AttributeFactory for the MethodQualifiers.
 
union {
   TypeAndRange *   Exceptions
 Pointer to a new[]'d array of TypeAndRange objects that contain the types in the function's dynamic exception specification and their locations, if there is one. More...
 
   Expr *   NoexceptExpr
 Pointer to the expression in the noexcept-specifier of this function, if it has one. More...
 
   CachedTokens *   ExceptionSpecTokens
 Pointer to the cached tokens for an exception-specification that has not yet been parsed. More...
 
   NamedDecl **   DeclsInPrototype
 Pointer to a new[]'d array of declarations that need to be available for lookup inside the function body, if one exists. More...
 
}; 
 
UnionParsedType TrailingReturnType
 If HasTrailingReturnType is true, this is the trailing return type specified.
 
SourceLocation TrailingReturnTypeLoc
 If HasTrailingReturnType is true, this is the location of the trailing return type.
 

Detailed Description

Definition at line 1353 of file DeclSpec.h.

Member Function Documentation

◆ destroy()

void clang::DeclaratorChunk::FunctionTypeInfo::destroy ( )
inline

◆ freeParams()

void clang::DeclaratorChunk::FunctionTypeInfo::freeParams ( )
inline

Reset the parameter list to having zero parameters.

This is used in various places for error recovery.

Definition at line 1463 of file DeclSpec.h.

References DeleteParams, NumParams, and Params.

Referenced by clang::Sema::CheckDestructorDeclarator(), and destroy().

◆ getConstQualifierLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getConstQualifierLoc ( ) const
inline

Retrieve the location of the 'const' qualifier.

Definition at line 1528 of file DeclSpec.h.

References clang::DeclSpec::getConstSpecLoc(), and MethodQualifiers.

◆ getDeclsInPrototype()

ArrayRef< NamedDecl * > clang::DeclaratorChunk::FunctionTypeInfo::getDeclsInPrototype ( ) const
inline

Get the non-parameter decls defined within this function prototype.

Typically these are tag declarations.

Definition at line 1575 of file DeclSpec.h.

References DeclsInPrototype, clang::EST_None, ExceptionSpecType, and NumExceptionsOrDecls.

Referenced by clang::Sema::ActOnFunctionDeclarator().

◆ getEllipsisLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getEllipsisLoc ( ) const
inline

Definition at line 1508 of file DeclSpec.h.

References EllipsisLoc.

Referenced by GetFullTypeForDeclarator().

◆ getExceptionSpecLocBeg()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecLocBeg ( ) const
inline

Definition at line 1512 of file DeclSpec.h.

References ExceptionSpecLocBeg.

Referenced by getExceptionSpecRange(), and GetFullTypeForDeclarator().

◆ getExceptionSpecLocEnd()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecLocEnd ( ) const
inline

Definition at line 1516 of file DeclSpec.h.

References ExceptionSpecLocEnd.

Referenced by getExceptionSpecRange().

◆ getExceptionSpecRange()

SourceRange clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecRange ( ) const
inline

Definition at line 1520 of file DeclSpec.h.

References getExceptionSpecLocBeg(), and getExceptionSpecLocEnd().

◆ getExceptionSpecType()

ExceptionSpecificationType clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecType ( ) const
inline

Get the type of exception specification this function has.

Definition at line 1563 of file DeclSpec.h.

References ExceptionSpecType.

Referenced by clang::Sema::containsUnexpandedParameterPacks(), destroy(), and GetFullTypeForDeclarator().

◆ getLParenLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getLParenLoc ( ) const
inline

Definition at line 1506 of file DeclSpec.h.

References LParenLoc.

Referenced by GetFullTypeForDeclarator().

◆ getMutableLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getMutableLoc ( ) const
inline

Retrieve the location of the 'mutable' qualifier, if any.

Definition at line 1546 of file DeclSpec.h.

References MutableLoc.

Referenced by hasMutableQualifier().

◆ getNumExceptions()

unsigned clang::DeclaratorChunk::FunctionTypeInfo::getNumExceptions ( ) const
inline

Get the number of dynamic exception specifications.

Definition at line 1568 of file DeclSpec.h.

References clang::EST_None, ExceptionSpecType, and NumExceptionsOrDecls.

Referenced by clang::Sema::containsUnexpandedParameterPacks(), and GetFullTypeForDeclarator().

◆ getOrCreateMethodQualifiers()

DeclSpec & clang::DeclaratorChunk::FunctionTypeInfo::getOrCreateMethodQualifiers ( )
inline

Definition at line 1493 of file DeclSpec.h.

References MethodQualifiers, and QualAttrFactory.

Referenced by getLambdaType().

◆ getRefQualifierLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc ( ) const
inline

Retrieve the location of the ref-qualifier, if any.

Definition at line 1525 of file DeclSpec.h.

References RefQualifierLoc.

Referenced by clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckDestructorDeclarator(), GetFullTypeForDeclarator(), and hasRefQualifier().

◆ getRestrictQualifierLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getRestrictQualifierLoc ( ) const
inline

Retrieve the location of the 'restrict' qualifier.

Definition at line 1540 of file DeclSpec.h.

References clang::DeclSpec::getRestrictSpecLoc(), and MethodQualifiers.

◆ getRParenLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getRParenLoc ( ) const
inline

Definition at line 1510 of file DeclSpec.h.

References RParenLoc.

Referenced by GetFullTypeForDeclarator().

◆ getTrailingReturnType()

ParsedType clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnType ( ) const
inline

Get the trailing-return-type for this function declarator.

Definition at line 1585 of file DeclSpec.h.

References HasTrailingReturnType, and TrailingReturnType.

Referenced by clang::Sema::containsUnexpandedParameterPacks(), GetFullTypeForDeclarator(), and getLambdaType().

◆ getTrailingReturnTypeLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnTypeLoc ( ) const
inline

Get the trailing-return-type location for this function declarator.

Definition at line 1591 of file DeclSpec.h.

References HasTrailingReturnType, and TrailingReturnTypeLoc.

Referenced by diagnoseRedundantReturnTypeQualifiers(), and getLambdaType().

◆ getVolatileQualifierLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getVolatileQualifierLoc ( ) const
inline

Retrieve the location of the 'volatile' qualifier.

Definition at line 1534 of file DeclSpec.h.

References clang::DeclSpec::getVolatileSpecLoc(), and MethodQualifiers.

◆ hasMethodTypeQualifiers()

bool clang::DeclaratorChunk::FunctionTypeInfo::hasMethodTypeQualifiers ( ) const
inline

◆ hasMutableQualifier()

bool clang::DeclaratorChunk::FunctionTypeInfo::hasMutableQualifier ( ) const
inline

Determine whether this lambda-declarator contains a 'mutable' qualifier.

Definition at line 1554 of file DeclSpec.h.

References getMutableLoc(), and clang::SourceLocation::isValid().

Referenced by clang::Sema::CheckExplicitObjectMemberFunction(), and getLambdaType().

◆ hasRefQualifier()

bool clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier ( ) const
inline

Determine whether this function declaration contains a ref-qualifier.

Definition at line 1550 of file DeclSpec.h.

References getRefQualifierLoc(), and clang::SourceLocation::isValid().

Referenced by clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckDestructorDeclarator(), and GetFullTypeForDeclarator().

◆ hasTrailingReturnType()

bool clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType ( ) const
inline

Determine whether this function declarator had a trailing-return-type.

Definition at line 1582 of file DeclSpec.h.

References HasTrailingReturnType.

Referenced by clang::Sema::containsUnexpandedParameterPacks(), diagnoseRedundantReturnTypeQualifiers(), GetFullTypeForDeclarator(), and getLambdaType().

◆ isKNRPrototype()

bool clang::DeclaratorChunk::FunctionTypeInfo::isKNRPrototype ( ) const
inline

isKNRPrototype - Return true if this is a K&R style identifier list, like "void foo(a,b,c)".

In a function definition, this will be followed by the parameter type definitions.

Definition at line 1504 of file DeclSpec.h.

References hasPrototype, and NumParams.

Member Data Documentation

◆ 

union { ... } clang::DeclaratorChunk::FunctionTypeInfo::@223

◆ DeclsInPrototype

NamedDecl** clang::DeclaratorChunk::FunctionTypeInfo::DeclsInPrototype

Pointer to a new[]'d array of declarations that need to be available for lookup inside the function body, if one exists.

Does not exist in C++.

Definition at line 1449 of file DeclSpec.h.

Referenced by destroy(), getDeclsInPrototype(), and clang::DeclaratorChunk::getFunction().

◆ DeleteParams

unsigned clang::DeclaratorChunk::FunctionTypeInfo::DeleteParams

DeleteParams - If this is true, we need to delete[] Params.

Definition at line 1381 of file DeclSpec.h.

Referenced by freeParams(), and clang::DeclaratorChunk::getFunction().

◆ EllipsisLoc

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::EllipsisLoc

When isVariadic is true, the location of the ellipsis in the source.

Definition at line 1392 of file DeclSpec.h.

Referenced by getEllipsisLoc(), and clang::DeclaratorChunk::getFunction().

◆ Exceptions

TypeAndRange* clang::DeclaratorChunk::FunctionTypeInfo::Exceptions

Pointer to a new[]'d array of TypeAndRange objects that contain the types in the function's dynamic exception specification and their locations, if there is one.

Definition at line 1436 of file DeclSpec.h.

Referenced by clang::Sema::containsUnexpandedParameterPacks(), destroy(), GetFullTypeForDeclarator(), and clang::DeclaratorChunk::getFunction().

◆ ExceptionSpecLocBeg

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecLocBeg

The beginning location of the exception specification, if any.

Definition at line 1416 of file DeclSpec.h.

Referenced by getExceptionSpecLocBeg(), and clang::DeclaratorChunk::getFunction().

◆ ExceptionSpecLocEnd

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecLocEnd

The end location of the exception specification, if any.

Definition at line 1419 of file DeclSpec.h.

Referenced by getExceptionSpecLocEnd(), and clang::DeclaratorChunk::getFunction().

◆ ExceptionSpecTokens

CachedTokens* clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecTokens

Pointer to the cached tokens for an exception-specification that has not yet been parsed.

Definition at line 1444 of file DeclSpec.h.

Referenced by destroy(), and clang::DeclaratorChunk::getFunction().

◆ ExceptionSpecType

unsigned clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecType

ExceptionSpecType - An ExceptionSpecificationType value.

Definition at line 1377 of file DeclSpec.h.

Referenced by getDeclsInPrototype(), getExceptionSpecType(), clang::DeclaratorChunk::getFunction(), and getNumExceptions().

◆ hasPrototype

unsigned clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype

hasPrototype - This is true if the function had at least one typed parameter.

If the function is () or (a,b,c), then it has no prototype, and is treated as a K&R-style function.

Definition at line 1358 of file DeclSpec.h.

Referenced by clang::Sema::ActOnFinishKNRParamDeclarations(), CreateNewFunctionDecl(), GetFullTypeForDeclarator(), clang::DeclaratorChunk::getFunction(), isKNRPrototype(), and maybeSynthesizeBlockSignature().

◆ HasTrailingReturnType

unsigned clang::DeclaratorChunk::FunctionTypeInfo::HasTrailingReturnType

HasTrailingReturnType - If this is true, a trailing return type was specified.

Definition at line 1386 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction(), getTrailingReturnType(), getTrailingReturnTypeLoc(), and hasTrailingReturnType().

◆ isAmbiguous

unsigned clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous

Can this declaration be a constructor-style initializer?

Definition at line 1368 of file DeclSpec.h.

Referenced by GetFullTypeForDeclarator(), clang::DeclaratorChunk::getFunction(), and warnAboutAmbiguousFunction().

◆ isVariadic

unsigned clang::DeclaratorChunk::FunctionTypeInfo::isVariadic

isVariadic - If this function has a prototype, and if that proto ends with ',...)', this is true.

When true, EllipsisLoc contains the location of the ellipsis.

Definition at line 1364 of file DeclSpec.h.

Referenced by clang::Sema::CheckDestructorDeclarator(), clang::FTIHasSingleVoidParameter(), getCCForDeclaratorChunk(), GetFullTypeForDeclarator(), and clang::DeclaratorChunk::getFunction().

◆ LParenLoc

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::LParenLoc

The location of the left parenthesis in the source.

Definition at line 1389 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction(), and getLParenLoc().

◆ MethodQualifiers

DeclSpec* clang::DeclaratorChunk::FunctionTypeInfo::MethodQualifiers

◆ MutableLoc

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::MutableLoc

The location of the 'mutable' qualifer in a lambda-declarator, if any.

Definition at line 1413 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction(), and getMutableLoc().

◆ NoexceptExpr

Expr* clang::DeclaratorChunk::FunctionTypeInfo::NoexceptExpr

Pointer to the expression in the noexcept-specifier of this function, if it has one.

Definition at line 1440 of file DeclSpec.h.

Referenced by clang::Sema::containsUnexpandedParameterPacks(), GetFullTypeForDeclarator(), and clang::DeclaratorChunk::getFunction().

◆ NumExceptionsOrDecls

unsigned clang::DeclaratorChunk::FunctionTypeInfo::NumExceptionsOrDecls

NumExceptionsOrDecls - This is the number of types in the dynamic-exception-decl, if the function has one.

In C, this is the number of declarations in the function prototype.

Definition at line 1404 of file DeclSpec.h.

Referenced by destroy(), getDeclsInPrototype(), clang::DeclaratorChunk::getFunction(), and getNumExceptions().

◆ NumParams

unsigned clang::DeclaratorChunk::FunctionTypeInfo::NumParams

◆ Params

ParamInfo* clang::DeclaratorChunk::FunctionTypeInfo::Params

◆ QualAttrFactory

AttributeFactory* clang::DeclaratorChunk::FunctionTypeInfo::QualAttrFactory

AttributeFactory for the MethodQualifiers.

Definition at line 1430 of file DeclSpec.h.

Referenced by destroy(), clang::DeclaratorChunk::getFunction(), and getOrCreateMethodQualifiers().

◆ RefQualifierIsLValueRef

unsigned clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef

Whether the ref-qualifier (if any) is an lvalue reference.

Otherwise, it's an rvalue reference.

Definition at line 1373 of file DeclSpec.h.

Referenced by clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckDestructorDeclarator(), GetFullTypeForDeclarator(), and clang::DeclaratorChunk::getFunction().

◆ RefQualifierLoc

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierLoc

The location of the ref-qualifier, if any.

If this is an invalid location, there is no ref-qualifier.

Definition at line 1409 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction(), and getRefQualifierLoc().

◆ RParenLoc

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::RParenLoc

The location of the right parenthesis in the source.

Definition at line 1395 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction(), and getRParenLoc().

◆ TrailingReturnType

UnionParsedType clang::DeclaratorChunk::FunctionTypeInfo::TrailingReturnType

If HasTrailingReturnType is true, this is the trailing return type specified.

Definition at line 1454 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction(), and getTrailingReturnType().

◆ TrailingReturnTypeLoc

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::TrailingReturnTypeLoc

If HasTrailingReturnType is true, this is the location of the trailing return type.

Definition at line 1458 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction(), and getTrailingReturnTypeLoc().


The documentation for this struct was generated from the following file: