clang API Documentation
Represents a C++ unqualified-id that has been parsed. More...
#include <DeclSpec.h>

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 () | |
| UnqualifiedId (const UnqualifiedId &Other) | |
| Do not use this copy constructor. It is temporary, and only exists because we are holding FieldDeclarators in a SmallVector when we don't actually need them. | |
| ~UnqualifiedId () | |
| Destroy this unqualified-id. | |
| void | clear () |
| Clear out this unqualified-id, setting it to default (invalid) state. | |
| bool | isValid () const |
| Determine whether this unqualified-id refers to a valid name. | |
| bool | isInvalid () const |
| Determine whether this unqualified-id refers to an invalid name. | |
| IdKind | getKind () const |
| Determine what kind of name we have. | |
| void | setKind (IdKind kind) |
| void | setIdentifier (const IdentifierInfo *Id, SourceLocation IdLoc) |
| Specify that this unqualified-id was parsed as an identifier. | |
| void | setOperatorFunctionId (SourceLocation OperatorLoc, OverloadedOperatorKind Op, SourceLocation SymbolLocations[3]) |
| Specify that this unqualified-id was parsed as an operator-function-id. | |
| void | setConversionFunctionId (SourceLocation OperatorLoc, ParsedType Ty, SourceLocation EndLoc) |
| Specify that this unqualified-id was parsed as a conversion-function-id. | |
| void | setLiteralOperatorId (const IdentifierInfo *Id, SourceLocation OpLoc, SourceLocation IdLoc) |
| Specific that this unqualified-id was parsed as a literal-operator-id. | |
| void | setConstructorName (ParsedType ClassType, SourceLocation ClassNameLoc, SourceLocation EndLoc) |
| Specify that this unqualified-id was parsed as a constructor name. | |
| void | setConstructorTemplateId (TemplateIdAnnotation *TemplateId) |
| Specify that this unqualified-id was parsed as a template-id that names a constructor. | |
| void | setDestructorName (SourceLocation TildeLoc, ParsedType ClassType, SourceLocation EndLoc) |
| Specify that this unqualified-id was parsed as a destructor name. | |
| void | setTemplateId (TemplateIdAnnotation *TemplateId) |
| Specify that this unqualified-id was parsed as a template-id. | |
| SourceRange | getSourceRange () const |
| Return the source range that covers this unqualified-id. | |
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. | |
| struct { | |
| OverloadedOperatorKind Operator | |
| The kind of overloaded operator. | |
| unsigned SymbolLocations [3] | |
| The source locations of the individual tokens that name the operator, e.g., the "new", "[", and "]" tokens in operator new []. | |
| } OperatorFunctionId | |
| When Kind == IK_OperatorFunctionId, the overloaded operator that we parsed. | |
| UnionParsedType ConversionFunctionId | |
| When Kind == IK_ConversionFunctionId, the type that the conversion function names. | |
| UnionParsedType ConstructorName | |
| When Kind == IK_ConstructorName, the class-name of the type whose constructor is being referenced. | |
| UnionParsedType DestructorName | |
| When Kind == IK_DestructorName, the type referred to by the class-name. | |
| TemplateIdAnnotation * TemplateId | |
| When Kind == IK_TemplateId or IK_ConstructorTemplateId, the template-id annotation that contains the template name and template arguments. | |
| }; | |
| Anonymous union that holds extra data associated with the parsed unqualified-id. | |
| 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. | |
| SourceLocation | EndLocation |
| The location of the last token that describes this unqualified-id. | |
Represents a C++ unqualified-id that has been parsed.
Definition at line 757 of file DeclSpec.h.
Describes the kind of unqualified-id parsed.
| IK_Identifier |
An identifier. |
| IK_OperatorFunctionId |
An overloaded operator name, e.g., operator+. |
| IK_ConversionFunctionId |
A conversion function name, e.g., operator int. |
| IK_LiteralOperatorId |
A user-defined literal name, e.g., operator "" _i. |
| IK_ConstructorName |
A constructor name. |
| IK_ConstructorTemplateId |
A constructor named via a template-id. |
| IK_DestructorName |
A destructor name. |
| IK_TemplateId |
A template-id, e.g., f<int>. |
| IK_ImplicitSelfParam |
An implicit 'self' parameter. |
Definition at line 763 of file DeclSpec.h.
| clang::UnqualifiedId::UnqualifiedId | ( | ) | [inline] |
Definition at line 833 of file DeclSpec.h.
| clang::UnqualifiedId::UnqualifiedId | ( | const UnqualifiedId & | Other | ) | [inline] |
Do not use this copy constructor. It is temporary, and only exists because we are holding FieldDeclarators in a SmallVector when we don't actually need them.
FIXME: Kill this copy constructor.
Definition at line 840 of file DeclSpec.h.
References IK_Identifier, and Kind.
| clang::UnqualifiedId::~UnqualifiedId | ( | ) | [inline] |
| void UnqualifiedId::clear | ( | ) |
Clear out this unqualified-id, setting it to default (invalid) state.
Definition at line 938 of file DeclSpec.cpp.
References EndLocation, Identifier, IK_Identifier, and StartLocation.
Referenced by clang::Declarator::clear(), and ~UnqualifiedId().
| IdKind clang::UnqualifiedId::getKind | ( | ) | const [inline] |
Determine what kind of name we have.
Definition at line 860 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::DecomposeUnqualifiedId(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), clang::Declarator::getIdentifier(), clang::Sema::GetNameFromUnqualifiedId(), clang::Declarator::hasName(), and clang::Sema::isTemplateName().
| SourceRange clang::UnqualifiedId::getSourceRange | ( | ) | const [inline] |
Return the source range that covers this unqualified-id.
Definition at line 966 of file DeclSpec.h.
References EndLocation, and StartLocation.
Referenced by clang::Sema::ActOnDependentTemplateName(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnMemberAccessExpr(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::ActOnUsingDeclaration(), and clang::Sema::isTemplateName().
| bool clang::UnqualifiedId::isInvalid | ( | ) | const [inline] |
Determine whether this unqualified-id refers to an invalid name.
Definition at line 857 of file DeclSpec.h.
References isValid().
| bool clang::UnqualifiedId::isValid | ( | ) | const [inline] |
Determine whether this unqualified-id refers to a valid name.
Definition at line 854 of file DeclSpec.h.
References clang::SourceLocation::isValid(), and StartLocation.
Referenced by isInvalid(), clang::Declarator::isPastIdentifier(), and setOperatorFunctionId().
| void clang::UnqualifiedId::setConstructorName | ( | ParsedType | ClassType, |
| SourceLocation | ClassNameLoc, | ||
| SourceLocation | EndLoc | ||
| ) | [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 926 of file DeclSpec.h.
References ConstructorName, EndLocation, IK_ConstructorName, and StartLocation.
| 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 46 of file DeclSpec.cpp.
References EndLocation, IK_ConstructorTemplateId, clang::TemplateIdAnnotation::RAngleLoc, StartLocation, TemplateId, and clang::TemplateIdAnnotation::TemplateNameLoc.
| void clang::UnqualifiedId::setConversionFunctionId | ( | SourceLocation | OperatorLoc, |
| ParsedType | Ty, | ||
| SourceLocation | EndLoc | ||
| ) | [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 894 of file DeclSpec.h.
References ConversionFunctionId, EndLocation, IK_ConversionFunctionId, and StartLocation.
| void clang::UnqualifiedId::setDestructorName | ( | SourceLocation | TildeLoc, |
| ParsedType | ClassType, | ||
| SourceLocation | EndLoc | ||
| ) | [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 949 of file DeclSpec.h.
References DestructorName, EndLocation, IK_DestructorName, and StartLocation.
| void clang::UnqualifiedId::setIdentifier | ( | const IdentifierInfo * | Id, |
| SourceLocation | IdLoc | ||
| ) | [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 867 of file DeclSpec.h.
References EndLocation, Identifier, IK_Identifier, and StartLocation.
Referenced by clang::Sema::CodeCompleteObjCSuperMessage(), clang::Sema::DefaultVariadicArgumentPromotion(), clang::Sema::DiagnoseUnknownTypeName(), clang::Sema::getTypeName(), handleExtVectorTypeAttr(), HandleExtVectorTypeAttr(), clang::Sema::LookupInObjCMethod(), clang::TreeTransform< Derived >::RebuildTemplateName(), and clang::Declarator::SetIdentifier().
| void clang::UnqualifiedId::setKind | ( | IdKind | kind | ) | [inline] |
Definition at line 861 of file DeclSpec.h.
Referenced by clang::Sema::LookupInObjCMethod().
| void clang::UnqualifiedId::setLiteralOperatorId | ( | const IdentifierInfo * | Id, |
| SourceLocation | OpLoc, | ||
| SourceLocation | IdLoc | ||
| ) | [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 911 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 945 of file DeclSpec.cpp.
References EndLocation, clang::SourceLocation::getRawEncoding(), IK_OperatorFunctionId, isValid(), OperatorFunctionId, and StartLocation.
Referenced by 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 38 of file DeclSpec.cpp.
References EndLocation, IK_TemplateId, clang::TemplateIdAnnotation::RAngleLoc, StartLocation, TemplateId, and clang::TemplateIdAnnotation::TemplateNameLoc.
| union { ... } |
Anonymous union that holds extra data associated with the parsed unqualified-id.
When Kind == IK_ConstructorName, the class-name of the type whose constructor is being referenced.
Definition at line 813 of file DeclSpec.h.
Referenced by clang::Sema::GetNameFromUnqualifiedId(), and setConstructorName().
When Kind == IK_ConversionFunctionId, the type that the conversion function names.
Definition at line 809 of file DeclSpec.h.
Referenced by clang::Sema::CheckConversionDeclarator(), GetDeclSpecTypeForDeclarator(), clang::Sema::GetNameFromUnqualifiedId(), and setConversionFunctionId().
When Kind == IK_DestructorName, the type referred to by the class-name.
Definition at line 817 of file DeclSpec.h.
Referenced by clang::Sema::CheckDestructorDeclarator(), clang::Sema::GetNameFromUnqualifiedId(), and setDestructorName().
The location of the last token that describes this unqualified-id.
Definition at line 831 of file DeclSpec.h.
Referenced by clear(), clang::Sema::GetNameFromUnqualifiedId(), getSourceRange(), setConstructorName(), setConstructorTemplateId(), setConversionFunctionId(), setDestructorName(), setIdentifier(), setLiteralOperatorId(), setOperatorFunctionId(), and setTemplateId().
When Kind == IK_Identifier, the parsed identifier, or when Kind == IK_UserLiteralId, the identifier suffix.
Definition at line 789 of file DeclSpec.h.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnDependentTemplateName(), clang::Sema::ActOnPseudoDestructorExpr(), clear(), clang::Declarator::getIdentifier(), clang::Sema::GetNameFromUnqualifiedId(), clang::Declarator::hasName(), clang::Sema::isTemplateName(), setIdentifier(), and setLiteralOperatorId().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnTypedefDeclarator(), getKind(), and UnqualifiedId().
The kind of overloaded operator.
Definition at line 795 of file DeclSpec.h.
| struct { ... } clang::UnqualifiedId::OperatorFunctionId |
When Kind == IK_OperatorFunctionId, the overloaded operator that we parsed.
Referenced by clang::Sema::ActOnDependentTemplateName(), GetFullTypeForDeclarator(), clang::Sema::GetNameFromUnqualifiedId(), clang::Sema::isTemplateName(), and setOperatorFunctionId().
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 828 of file DeclSpec.h.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnTypedefDeclarator(), clear(), clang::Declarator::getIdentifierLoc(), clang::Sema::GetNameFromUnqualifiedId(), getSourceRange(), isValid(), setConstructorName(), setConstructorTemplateId(), setConversionFunctionId(), setDestructorName(), setIdentifier(), setLiteralOperatorId(), setOperatorFunctionId(), and setTemplateId().
| unsigned clang::UnqualifiedId::SymbolLocations[3] |
The source locations of the individual tokens that name the operator, e.g., the "new", "[", and "]" tokens in operator new [].
Different operators have different numbers of tokens in their name, up to three. Any remaining source locations in this array will be set to an invalid value for operators with fewer than three tokens.
Definition at line 804 of file DeclSpec.h.
When Kind == IK_TemplateId or IK_ConstructorTemplateId, the template-id annotation that contains the template name and template arguments.
Definition at line 822 of file DeclSpec.h.
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnUsingDeclaration(), clang::Sema::DecomposeUnqualifiedId(), clang::Sema::GetNameFromUnqualifiedId(), setConstructorTemplateId(), and setTemplateId().