clang
3.9.0
|
Represents a C++ unqualified-id that has been parsed. More...
#include <DeclSpec.h>
Classes | |
struct | OFI |
Public Types | |
enum | IdKind { IK_Identifier, IK_OperatorFunctionId, IK_ConversionFunctionId, IK_LiteralOperatorId, IK_ConstructorName, IK_ConstructorTemplateId, IK_DestructorName, IK_TemplateId, IK_ImplicitSelfParam } |
Describes the kind of unqualified-id parsed. More... | |
Public Member Functions | |
UnqualifiedId () | |
void | clear () |
Clear out this unqualified-id, setting it to default (invalid) state. More... | |
bool | isValid () const |
Determine whether this unqualified-id refers to a valid name. More... | |
bool | isInvalid () const |
Determine whether this unqualified-id refers to an invalid name. More... | |
IdKind | getKind () const |
Determine what kind of name we have. More... | |
void | setKind (IdKind kind) |
void | setIdentifier (const IdentifierInfo *Id, SourceLocation IdLoc) |
Specify that this unqualified-id was parsed as an identifier. More... | |
void | setOperatorFunctionId (SourceLocation OperatorLoc, OverloadedOperatorKind Op, SourceLocation SymbolLocations[3]) |
Specify that this unqualified-id was parsed as an operator-function-id. More... | |
void | setConversionFunctionId (SourceLocation OperatorLoc, ParsedType Ty, SourceLocation EndLoc) |
Specify that this unqualified-id was parsed as a conversion-function-id. More... | |
void | setLiteralOperatorId (const IdentifierInfo *Id, SourceLocation OpLoc, SourceLocation IdLoc) |
Specific that this unqualified-id was parsed as a literal-operator-id. More... | |
void | setConstructorName (ParsedType ClassType, SourceLocation ClassNameLoc, SourceLocation EndLoc) |
Specify that this unqualified-id was parsed as a constructor name. More... | |
void | setConstructorTemplateId (TemplateIdAnnotation *TemplateId) |
Specify that this unqualified-id was parsed as a template-id that names a constructor. More... | |
void | setDestructorName (SourceLocation TildeLoc, ParsedType ClassType, SourceLocation EndLoc) |
Specify that this unqualified-id was parsed as a destructor name. More... | |
void | setTemplateId (TemplateIdAnnotation *TemplateId) |
Specify that this unqualified-id was parsed as a template-id. More... | |
SourceRange | getSourceRange () const LLVM_READONLY |
Return the source range that covers this unqualified-id. More... | |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getLocEnd () const LLVM_READONLY |
Public Attributes | |
enum clang::UnqualifiedId::IdKind | Kind |
union { | |
IdentifierInfo * Identifier | |
When Kind == IK_Identifier, the parsed identifier, or when Kind == IK_UserLiteralId, the identifier suffix. More... | |
struct OFI OperatorFunctionId | |
When Kind == IK_OperatorFunctionId, the overloaded operator that we parsed. More... | |
UnionParsedType ConversionFunctionId | |
When Kind == IK_ConversionFunctionId, the type that the conversion function names. More... | |
UnionParsedType ConstructorName | |
When Kind == IK_ConstructorName, the class-name of the type whose constructor is being referenced. More... | |
UnionParsedType DestructorName | |
When Kind == IK_DestructorName, the type referred to by the class-name. More... | |
TemplateIdAnnotation * TemplateId | |
When Kind == IK_TemplateId or IK_ConstructorTemplateId, the template-id annotation that contains the template name and template arguments. More... | |
}; | |
Anonymous union that holds extra data associated with the parsed unqualified-id. More... | |
SourceLocation | StartLocation |
The location of the first token that describes this unqualified-id, which will be the location of the identifier, "operator" keyword, tilde (for a destructor), or the template name of a template-id. More... | |
SourceLocation | EndLocation |
The location of the last token that describes this unqualified-id. More... | |
Represents a C++ unqualified-id that has been parsed.
Definition at line 884 of file DeclSpec.h.
Describes the kind of unqualified-id parsed.
Definition at line 891 of file DeclSpec.h.
|
inline |
Definition at line 963 of file DeclSpec.h.
|
inline |
Clear out this unqualified-id, setting it to default (invalid) state.
Definition at line 967 of file DeclSpec.h.
References EndLocation, Identifier, IK_Identifier, and StartLocation.
|
inline |
Determine what kind of name we have.
Definition at line 981 of file DeclSpec.h.
References Kind.
Referenced by clang::Sema::ActOnDependentTemplateName(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnMemberAccessExpr(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnUsingDeclaration(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::checkLiteralOperatorId(), clang::Sema::DecomposeUnqualifiedId(), diagnoseRedundantReturnTypeQualifiers(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), clang::Sema::GetNameFromUnqualifiedId(), clang::Declarator::isCtorOrDtor(), clang::Sema::isTemplateName(), and clang::Parser::ParseUnqualifiedId().
|
inline |
Definition at line 1091 of file DeclSpec.h.
References EndLocation.
|
inline |
Definition at line 1090 of file DeclSpec.h.
References StartLocation.
Referenced by clang::Sema::ActOnDependentTemplateName(), clang::Sema::ActOnUsingDeclaration(), clang::Sema::checkLiteralOperatorId(), and clang::Sema::isTemplateName().
|
inline |
Return the source range that covers this unqualified-id.
Definition at line 1087 of file DeclSpec.h.
References EndLocation, and StartLocation.
Referenced by clang::Sema::ActOnDependentTemplateName(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnMemberAccessExpr(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::CheckConversionDeclarator(), and GetDeclSpecTypeForDeclarator().
|
inline |
Determine whether this unqualified-id refers to an invalid name.
Definition at line 978 of file DeclSpec.h.
References isValid().
|
inline |
Determine whether this unqualified-id refers to a valid name.
Definition at line 975 of file DeclSpec.h.
References clang::SourceLocation::isValid(), and StartLocation.
Referenced by isInvalid(), and setOperatorFunctionId().
|
inline |
Specify that this unqualified-id was parsed as a constructor name.
ClassType | the class type referred to by the constructor name. |
ClassNameLoc | the location of the class name. |
EndLoc | the location of the last token that makes up the type name. |
Definition at line 1047 of file DeclSpec.h.
References ConstructorName, EndLocation, IK_ConstructorName, and StartLocation.
Referenced by clang::Parser::ParseUnqualifiedId().
void UnqualifiedId::setConstructorTemplateId | ( | TemplateIdAnnotation * | TemplateId | ) |
Specify that this unqualified-id was parsed as a template-id that names a constructor.
TemplateId | the template-id annotation that describes the parsed template-id. This UnqualifiedId instance will take ownership of the TemplateId and will free it on destruction. |
Definition at line 39 of file DeclSpec.cpp.
References EndLocation, IK_ConstructorTemplateId, clang::TemplateIdAnnotation::RAngleLoc, StartLocation, TemplateId, and clang::TemplateIdAnnotation::TemplateNameLoc.
Referenced by clang::Parser::ParseUnqualifiedId().
|
inline |
Specify that this unqualified-id was parsed as a conversion-function-id.
OperatorLoc | the location of the 'operator' keyword. |
Ty | the type to which this conversion function is converting. |
EndLoc | the location of the last token that makes up the type name. |
Definition at line 1015 of file DeclSpec.h.
References ConversionFunctionId, EndLocation, IK_ConversionFunctionId, and StartLocation.
|
inline |
Specify that this unqualified-id was parsed as a destructor name.
TildeLoc | the location of the '~' that introduces the destructor name. |
ClassType | the name of the class referred to by the destructor name. |
Definition at line 1070 of file DeclSpec.h.
References DestructorName, EndLocation, IK_DestructorName, and StartLocation.
Referenced by clang::Parser::ParseUnqualifiedId().
|
inline |
Specify that this unqualified-id was parsed as an identifier.
Id | the parsed identifier. |
IdLoc | the location of the parsed identifier. |
Definition at line 988 of file DeclSpec.h.
References EndLocation, Identifier, IK_Identifier, and StartLocation.
Referenced by clang::Sema::DefaultVariadicArgumentPromotion(), clang::Sema::DiagnoseUnknownTypeName(), clang::Sema::getTypeName(), clang::Sema::LookupInObjCMethod(), clang::Parser::ParseUnqualifiedId(), clang::TreeTransform< Derived >::RebuildTemplateName(), and clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec().
|
inline |
Definition at line 982 of file DeclSpec.h.
Referenced by clang::Sema::LookupInObjCMethod().
|
inline |
Specific that this unqualified-id was parsed as a literal-operator-id.
Id | the parsed identifier. |
OpLoc | the location of the 'operator' keyword. |
IdLoc | the location of the identifier. |
Definition at line 1032 of file DeclSpec.h.
References EndLocation, Identifier, IK_LiteralOperatorId, and StartLocation.
void UnqualifiedId::setOperatorFunctionId | ( | SourceLocation | OperatorLoc, |
OverloadedOperatorKind | Op, | ||
SourceLocation | SymbolLocations[3] | ||
) |
Specify that this unqualified-id was parsed as an operator-function-id.
OperatorLoc | the location of the 'operator' keyword. |
Op | the overloaded operator. |
SymbolLocations | the locations of the individual operator symbols in the operator. |
Definition at line 1238 of file DeclSpec.cpp.
References EndLocation, clang::SourceLocation::getRawEncoding(), I, IK_OperatorFunctionId, isValid(), clang::UnqualifiedId::OFI::Operator, OperatorFunctionId, StartLocation, and clang::UnqualifiedId::OFI::SymbolLocations.
Referenced by ParseReductionId(), and clang::TreeTransform< Derived >::RebuildTemplateName().
void UnqualifiedId::setTemplateId | ( | TemplateIdAnnotation * | TemplateId | ) |
Specify that this unqualified-id was parsed as a template-id.
TemplateId | the template-id annotation that describes the parsed template-id. This UnqualifiedId instance will take ownership of the TemplateId and will free it on destruction. |
Definition at line 31 of file DeclSpec.cpp.
References EndLocation, IK_TemplateId, clang::TemplateIdAnnotation::RAngleLoc, StartLocation, TemplateId, and clang::TemplateIdAnnotation::TemplateNameLoc.
Referenced by clang::Parser::ParseUnqualifiedId().
union { ... } |
Anonymous union that holds extra data associated with the parsed unqualified-id.
UnionParsedType clang::UnqualifiedId::ConstructorName |
When Kind == IK_ConstructorName, the class-name of the type whose constructor is being referenced.
Definition at line 943 of file DeclSpec.h.
Referenced by clang::Sema::GetNameFromUnqualifiedId(), and setConstructorName().
UnionParsedType clang::UnqualifiedId::ConversionFunctionId |
When Kind == IK_ConversionFunctionId, the type that the conversion function names.
Definition at line 939 of file DeclSpec.h.
Referenced by clang::Sema::CheckConversionDeclarator(), GetDeclSpecTypeForDeclarator(), clang::Sema::GetNameFromUnqualifiedId(), and setConversionFunctionId().
UnionParsedType clang::UnqualifiedId::DestructorName |
When Kind == IK_DestructorName, the type referred to by the class-name.
Definition at line 947 of file DeclSpec.h.
Referenced by clang::Sema::CheckDestructorDeclarator(), clang::Sema::GetNameFromUnqualifiedId(), and setDestructorName().
SourceLocation clang::UnqualifiedId::EndLocation |
The location of the last token that describes this unqualified-id.
Definition at line 961 of file DeclSpec.h.
Referenced by clear(), getLocEnd(), getMissingDeclaratorIdLoc(), clang::Sema::GetNameFromUnqualifiedId(), getSourceRange(), setConstructorName(), setConstructorTemplateId(), setConversionFunctionId(), setDestructorName(), setIdentifier(), setLiteralOperatorId(), setOperatorFunctionId(), and setTemplateId().
IdentifierInfo* clang::UnqualifiedId::Identifier |
When Kind == IK_Identifier, the parsed identifier, or when Kind == IK_UserLiteralId, the identifier suffix.
Definition at line 931 of file DeclSpec.h.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnDependentTemplateName(), clang::Sema::ActOnPseudoDestructorExpr(), clear(), clang::Sema::GetNameFromUnqualifiedId(), clang::Sema::isTemplateName(), setIdentifier(), and setLiteralOperatorId().
enum clang::UnqualifiedId::IdKind clang::UnqualifiedId::Kind |
struct OFI clang::UnqualifiedId::OperatorFunctionId |
When Kind == IK_OperatorFunctionId, the overloaded operator that we parsed.
Definition at line 935 of file DeclSpec.h.
Referenced by clang::Sema::ActOnDependentTemplateName(), clang::Sema::GetNameFromUnqualifiedId(), clang::Sema::isTemplateName(), and setOperatorFunctionId().
SourceLocation clang::UnqualifiedId::StartLocation |
The location of the first token that describes this unqualified-id, which will be the location of the identifier, "operator" keyword, tilde (for a destructor), or the template name of a template-id.
Definition at line 958 of file DeclSpec.h.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnTypedefDeclarator(), clear(), getLocStart(), getMissingDeclaratorIdLoc(), clang::Sema::GetNameFromUnqualifiedId(), getSourceRange(), isValid(), setConstructorName(), setConstructorTemplateId(), setConversionFunctionId(), setDestructorName(), setIdentifier(), setLiteralOperatorId(), setOperatorFunctionId(), and setTemplateId().
TemplateIdAnnotation* clang::UnqualifiedId::TemplateId |
When Kind == IK_TemplateId or IK_ConstructorTemplateId, the template-id annotation that contains the template name and template arguments.
Definition at line 952 of file DeclSpec.h.
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnUsingDeclaration(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::DecomposeUnqualifiedId(), clang::Sema::GetNameFromUnqualifiedId(), setConstructorTemplateId(), and setTemplateId().