clang API Documentation

Public Member Functions | Public Attributes
clang::DeclaratorChunk::FunctionTypeInfo Struct Reference

#include <DeclSpec.h>

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

List of all members.

Public Member Functions

void freeParams ()
 Reset the parameter list to having zero parameters.
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.
SourceLocation getConstQualifierLoc () const
 Retrieve the location of the 'const' qualifier, if any.
SourceLocation getVolatileQualifierLoc () const
 Retrieve the location of the 'volatile' qualifier, if any.
SourceLocation getRestrictQualifierLoc () const
 Retrieve the location of the 'restrict' qualifier, if any.
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.
ExceptionSpecificationType getExceptionSpecType () const
 Get the type of exception specification this function has.
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.

Public Attributes

unsigned hasPrototype: 1
unsigned isVariadic: 1
unsigned isAmbiguous: 1
 Can this declaration be a constructor-style initializer?
unsigned RefQualifierIsLValueRef: 1
 Whether the ref-qualifier (if any) is an lvalue reference. Otherwise, it's an rvalue reference.
unsigned TypeQuals: 3
unsigned ExceptionSpecType: 4
 ExceptionSpecType - An ExceptionSpecificationType value.
unsigned DeleteParams: 1
 DeleteParams - If this is true, we need to delete[] Params.
unsigned HasTrailingReturnType: 1
unsigned LParenLoc
 The location of the left parenthesis in the source.
unsigned EllipsisLoc
 When isVariadic is true, the location of the ellipsis in the source.
unsigned RParenLoc
 The location of the right parenthesis in the source.
unsigned NumParams
unsigned NumExceptions
unsigned RefQualifierLoc
 The location of the ref-qualifier, if any.
unsigned ConstQualifierLoc
 The location of the const-qualifier, if any.
unsigned VolatileQualifierLoc
 The location of the volatile-qualifier, if any.
unsigned RestrictQualifierLoc
 The location of the restrict-qualifier, if any.
unsigned MutableLoc
 The location of the 'mutable' qualifer in a lambda-declarator, if any.
unsigned ExceptionSpecLoc
 The location of the keyword introducing the spec, if any.
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.
   Expr *   NoexceptExpr
 Pointer to the expression in the noexcept-specifier of this function, if it has one.
   CachedTokens *   ExceptionSpecTokens
 Pointer to the cached tokens for an exception-specification that has not yet been parsed.
}; 
UnionParsedType TrailingReturnType
 If HasTrailingReturnType is true, this is the trailing return type specified.

Detailed Description

Definition at line 1156 of file DeclSpec.h.


Member Function Documentation

Reset the parameter list to having zero parameters.

This is used in various places for error recovery.

Definition at line 1259 of file DeclSpec.h.

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

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

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

Definition at line 1307 of file DeclSpec.h.

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

Referenced by GetFullTypeForDeclarator().

Definition at line 1289 of file DeclSpec.h.

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

Referenced by GetFullTypeForDeclarator().

Definition at line 1297 of file DeclSpec.h.

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

Referenced by GetFullTypeForDeclarator().

Get the type of exception specification this function has.

Definition at line 1335 of file DeclSpec.h.

References ExceptionSpecType.

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

Definition at line 1285 of file DeclSpec.h.

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

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

Definition at line 1322 of file DeclSpec.h.

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

Referenced by hasMutableQualifier().

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

Definition at line 1317 of file DeclSpec.h.

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

Referenced by GetFullTypeForDeclarator().

Definition at line 1293 of file DeclSpec.h.

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

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

Definition at line 1344 of file DeclSpec.h.

References TrailingReturnType.

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

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

Definition at line 1312 of file DeclSpec.h.

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

Referenced by GetFullTypeForDeclarator().

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

Definition at line 1332 of file DeclSpec.h.

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

Determine whether this function declaration contains a ref-qualifier.

Definition at line 1328 of file DeclSpec.h.

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

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

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

Definition at line 1341 of file DeclSpec.h.

References HasTrailingReturnType.

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

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

References hasPrototype, and NumParams.


Member Data Documentation

union { ... }

The location of the const-qualifier, if any.

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

Definition at line 1213 of file DeclSpec.h.

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

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

Definition at line 1182 of file DeclSpec.h.

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

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

Definition at line 1192 of file DeclSpec.h.

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

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

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

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

Definition at line 1230 of file DeclSpec.h.

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

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

Definition at line 1249 of file DeclSpec.h.

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

ExceptionSpecType - An ExceptionSpecificationType value.

Definition at line 1179 of file DeclSpec.h.

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

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

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

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

Definition at line 1186 of file DeclSpec.h.

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

Can this declaration be a constructor-style initializer?

Definition at line 1168 of file DeclSpec.h.

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

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

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

The location of the left parenthesis in the source.

Definition at line 1189 of file DeclSpec.h.

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

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

Definition at line 1227 of file DeclSpec.h.

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

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

Definition at line 1245 of file DeclSpec.h.

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

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

Definition at line 1203 of file DeclSpec.h.

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

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 1235 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().

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

Definition at line 1172 of file DeclSpec.h.

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

The location of the ref-qualifier, if any.

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

Definition at line 1208 of file DeclSpec.h.

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

The location of the restrict-qualifier, if any.

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

Definition at line 1223 of file DeclSpec.h.

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

The location of the right parenthesis in the source.

Definition at line 1195 of file DeclSpec.h.

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

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

Definition at line 1254 of file DeclSpec.h.

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

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

Definition at line 1176 of file DeclSpec.h.

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

The location of the volatile-qualifier, if any.

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

Definition at line 1218 of file DeclSpec.h.

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


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