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

#include <DeclSpec.h>

Inheritance diagram for clang::DeclaratorChunk::FunctionTypeInfo:
[legend]
Collaboration diagram for clang::DeclaratorChunk::FunctionTypeInfo:
[legend]

Public Member Functions

void freeParams ()
 Reset the parameter list to having zero parameters. More...
 
void destroy ()
 
bool isKNRPrototype () const
 
SourceLocation getLParenLoc () const
 
SourceLocation getEllipsisLoc () const
 
SourceLocation getRParenLoc () const
 
SourceLocation getExceptionSpecLoc () const
 
SourceLocation getRefQualifierLoc () const
 Retrieve the location of the ref-qualifier, if any. More...
 
SourceLocation getConstQualifierLoc () const
 Retrieve the location of the 'const' qualifier, if any. More...
 
SourceLocation getVolatileQualifierLoc () const
 Retrieve the location of the 'volatile' qualifier, if any. More...
 
SourceLocation getRestrictQualifierLoc () const
 Retrieve the location of the 'restrict' qualifier, if any. More...
 
SourceLocation getMutableLoc () const
 Retrieve the location of the 'mutable' qualifier, if any. More...
 
bool hasRefQualifier () const
 Determine whether this function declaration contains a ref-qualifier. More...
 
bool hasMutableQualifier () const
 Determine whether this lambda-declarator contains a 'mutable' qualifier. More...
 
ExceptionSpecificationType getExceptionSpecType () const
 Get the type of exception specification this function has. More...
 
bool hasTrailingReturnType () const
 Determine whether this function declarator had a trailing-return-type. More...
 
ParsedType getTrailingReturnType () const
 Get the trailing-return-type for this function declarator. More...
 

Public Attributes

unsigned hasPrototype: 1
 
unsigned isVariadic: 1
 
unsigned isAmbiguous: 1
 Can this declaration be a constructor-style initializer? More...
 
unsigned RefQualifierIsLValueRef: 1
 Whether the ref-qualifier (if any) is an lvalue reference. Otherwise, it's an rvalue reference. More...
 
unsigned TypeQuals: 3
 
unsigned ExceptionSpecType: 4
 ExceptionSpecType - An ExceptionSpecificationType value. More...
 
unsigned DeleteParams: 1
 DeleteParams - If this is true, we need to delete[] Params. More...
 
unsigned HasTrailingReturnType: 1
 
unsigned LParenLoc
 The location of the left parenthesis in the source. More...
 
unsigned EllipsisLoc
 When isVariadic is true, the location of the ellipsis in the source. More...
 
unsigned RParenLoc
 The location of the right parenthesis in the source. More...
 
unsigned NumParams
 
unsigned NumExceptions
 
unsigned RefQualifierLoc
 The location of the ref-qualifier, if any. More...
 
unsigned ConstQualifierLoc
 The location of the const-qualifier, if any. More...
 
unsigned VolatileQualifierLoc
 The location of the volatile-qualifier, if any. More...
 
unsigned RestrictQualifierLoc
 The location of the restrict-qualifier, if any. More...
 
unsigned MutableLoc
 The location of the 'mutable' qualifer in a lambda-declarator, if any. More...
 
unsigned ExceptionSpecLoc
 The location of the keyword introducing the spec, if any. More...
 
ParamInfoParams
 
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...
 
}; 
 
UnionParsedType TrailingReturnType
 If HasTrailingReturnType is true, this is the trailing return type specified. More...
 
- Public Attributes inherited from clang::DeclaratorChunk::TypeInfoCommon
AttributeListAttrList
 

Detailed Description

Definition at line 1185 of file DeclSpec.h.

Member Function Documentation

void clang::DeclaratorChunk::FunctionTypeInfo::destroy ( )
inline
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 1288 of file DeclSpec.h.

References clang::DeclaratorChunk::ParamInfo::DefaultArgTokens, DeleteParams, NumParams, and Params.

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

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

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

Definition at line 1336 of file DeclSpec.h.

References ConstQualifierLoc, and clang::SourceLocation::getFromRawEncoding().

Referenced by GetFullTypeForDeclarator().

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

Definition at line 1318 of file DeclSpec.h.

References EllipsisLoc, and clang::SourceLocation::getFromRawEncoding().

Referenced by GetFullTypeForDeclarator().

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

Definition at line 1326 of file DeclSpec.h.

References ExceptionSpecLoc, and clang::SourceLocation::getFromRawEncoding().

Referenced by GetFullTypeForDeclarator().

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

Get the type of exception specification this function has.

Definition at line 1364 of file DeclSpec.h.

References ExceptionSpecType.

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

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

Definition at line 1314 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding(), and LParenLoc.

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

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

Definition at line 1351 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding(), and MutableLoc.

Referenced by hasMutableQualifier().

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

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

Definition at line 1346 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding(), and RestrictQualifierLoc.

Referenced by GetFullTypeForDeclarator().

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

Definition at line 1322 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding(), and RParenLoc.

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

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

Definition at line 1373 of file DeclSpec.h.

References TrailingReturnType.

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

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

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

Definition at line 1341 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding(), and VolatileQualifierLoc.

Referenced by GetFullTypeForDeclarator().

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

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

Definition at line 1361 of file DeclSpec.h.

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

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

Determine whether this function declaration contains a ref-qualifier.

Definition at line 1357 of file DeclSpec.h.

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

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

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

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

Definition at line 1370 of file DeclSpec.h.

References HasTrailingReturnType.

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

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 1312 of file DeclSpec.h.

References hasPrototype, and NumParams.

Member Data Documentation

union { ... }
unsigned clang::DeclaratorChunk::FunctionTypeInfo::ConstQualifierLoc

The location of the const-qualifier, if any.

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

Definition at line 1242 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::DeleteParams

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

Definition at line 1211 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::EllipsisLoc

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

Definition at line 1221 of file DeclSpec.h.

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

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 1270 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecLoc

The location of the keyword introducing the spec, if any.

Definition at line 1259 of file DeclSpec.h.

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

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

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

Definition at line 1278 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecType

ExceptionSpecType - An ExceptionSpecificationType value.

Definition at line 1208 of file DeclSpec.h.

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

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 1189 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::HasTrailingReturnType

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

Definition at line 1215 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous

Can this declaration be a constructor-style initializer?

Definition at line 1197 of file DeclSpec.h.

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

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 1194 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::LParenLoc

The location of the left parenthesis in the source.

Definition at line 1218 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::MutableLoc

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

Definition at line 1256 of file DeclSpec.h.

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

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

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

Definition at line 1274 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::NumExceptions

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

Definition at line 1232 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::NumParams
ParamInfo* clang::DeclaratorChunk::FunctionTypeInfo::Params

Params - This is a pointer to a new[]'d array of ParamInfo objects that describe the parameters specified by this function declarator. null if there are no parameters specified.

Definition at line 1264 of file DeclSpec.h.

Referenced by clang::Sema::ActOnFinishKNRParamDeclarations(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::containsUnexpandedParameterPacks(), destroy(), freeParams(), clang::FTIHasSingleVoidParameter(), GetFullTypeForDeclarator(), clang::DeclaratorChunk::getFunction(), and warnAboutAmbiguousFunction().

unsigned clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef

Whether the ref-qualifier (if any) is an lvalue reference. Otherwise, it's an rvalue reference.

Definition at line 1201 of file DeclSpec.h.

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

unsigned 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 1237 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::RestrictQualifierLoc

The location of the restrict-qualifier, if any.

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

Definition at line 1252 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::RParenLoc

The location of the right parenthesis in the source.

Definition at line 1224 of file DeclSpec.h.

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

UnionParsedType clang::DeclaratorChunk::FunctionTypeInfo::TrailingReturnType

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

Definition at line 1283 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::TypeQuals

The type qualifiers: const/volatile/restrict. The qualifier bitmask values are the same as in QualType.

Definition at line 1205 of file DeclSpec.h.

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

unsigned clang::DeclaratorChunk::FunctionTypeInfo::VolatileQualifierLoc

The location of the volatile-qualifier, if any.

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

Definition at line 1247 of file DeclSpec.h.

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


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