clang 20.0.0git
Classes | Public Member Functions | Public Attributes | List of all members
clang::UnqualifiedId Class Reference

Represents a C++ unqualified-id that has been parsed. More...

#include "clang/Sema/DeclSpec.h"

Classes

struct  OFI
 

Public Member Functions

 UnqualifiedId ()
 
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.
 
UnqualifiedIdKind getKind () const
 Determine what kind of name we have.
 
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.
 
void setDeductionGuideName (ParsedTemplateTy Template, SourceLocation TemplateLoc)
 Specify that this unqualified-id was parsed as a template-name for a deduction-guide.
 
void setImplicitSelfParam (const IdentifierInfo *Id)
 Specify that this unqualified-id is an implicit 'self' parameter.
 
SourceRange getSourceRange () const LLVM_READONLY
 Return the source range that covers this unqualified-id.
 
SourceLocation getBeginLoc () const LLVM_READONLY
 
SourceLocation getEndLoc () const LLVM_READONLY
 

Public Attributes

union {
   const 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...
 
   UnionParsedTemplateTy   TemplateName
 When Kind == IK_DeductionGuideName, the parsed template-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.
 
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.
 

Detailed Description

Represents a C++ unqualified-id that has been parsed.

Definition at line 1028 of file DeclSpec.h.

Constructor & Destructor Documentation

◆ UnqualifiedId()

clang::UnqualifiedId::UnqualifiedId ( )
inline

Definition at line 1091 of file DeclSpec.h.

Member Function Documentation

◆ clear()

void clang::UnqualifiedId::clear ( )
inline

Clear out this unqualified-id, setting it to default (invalid) state.

Definition at line 1096 of file DeclSpec.h.

References EndLocation, Identifier, clang::IK_Identifier, Kind, and StartLocation.

◆ getBeginLoc()

SourceLocation clang::UnqualifiedId::getBeginLoc ( ) const
inline

Definition at line 1240 of file DeclSpec.h.

References StartLocation.

◆ getEndLoc()

SourceLocation clang::UnqualifiedId::getEndLoc ( ) const
inline

Definition at line 1241 of file DeclSpec.h.

References EndLocation.

◆ getKind()

UnqualifiedIdKind clang::UnqualifiedId::getKind ( ) const
inline

Determine what kind of name we have.

Definition at line 1110 of file DeclSpec.h.

References Kind.

Referenced by clang::Sema::ActOnPseudoDestructorExpr(), clang::Declarator::isCtorOrDtor(), and clang::Declarator::isStaticMember().

◆ getSourceRange()

SourceRange clang::UnqualifiedId::getSourceRange ( ) const
inline

Return the source range that covers this unqualified-id.

Definition at line 1237 of file DeclSpec.h.

References EndLocation, and StartLocation.

◆ isInvalid()

bool clang::UnqualifiedId::isInvalid ( ) const
inline

Determine whether this unqualified-id refers to an invalid name.

Definition at line 1107 of file DeclSpec.h.

References isValid().

◆ isValid()

bool clang::UnqualifiedId::isValid ( ) const
inline

Determine whether this unqualified-id refers to a valid name.

Definition at line 1104 of file DeclSpec.h.

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

Referenced by isInvalid(), and setOperatorFunctionId().

◆ setConstructorName()

void clang::UnqualifiedId::setConstructorName ( ParsedType  ClassType,
SourceLocation  ClassNameLoc,
SourceLocation  EndLoc 
)
inline

Specify that this unqualified-id was parsed as a constructor name.

Parameters
ClassTypethe class type referred to by the constructor name.
ClassNameLocthe location of the class name.
EndLocthe location of the last token that makes up the type name.

Definition at line 1175 of file DeclSpec.h.

References ConstructorName, EndLocation, clang::IK_ConstructorName, Kind, and StartLocation.

◆ setConstructorTemplateId()

void UnqualifiedId::setConstructorTemplateId ( TemplateIdAnnotation TemplateId)

Specify that this unqualified-id was parsed as a template-id that names a constructor.

Parameters
TemplateIdthe 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 43 of file DeclSpec.cpp.

References EndLocation, clang::IK_ConstructorTemplateId, clang::TemplateIdAnnotation::isInvalid(), clang::TemplateIdAnnotation::RAngleLoc, StartLocation, TemplateId, and clang::TemplateIdAnnotation::TemplateNameLoc.

◆ setConversionFunctionId()

void clang::UnqualifiedId::setConversionFunctionId ( SourceLocation  OperatorLoc,
ParsedType  Ty,
SourceLocation  EndLoc 
)
inline

Specify that this unqualified-id was parsed as a conversion-function-id.

Parameters
OperatorLocthe location of the 'operator' keyword.
Tythe type to which this conversion function is converting.
EndLocthe location of the last token that makes up the type name.

Definition at line 1143 of file DeclSpec.h.

References ConversionFunctionId, EndLocation, clang::IK_ConversionFunctionId, Kind, and StartLocation.

◆ setDeductionGuideName()

void clang::UnqualifiedId::setDeductionGuideName ( ParsedTemplateTy  Template,
SourceLocation  TemplateLoc 
)
inline

Specify that this unqualified-id was parsed as a template-name for a deduction-guide.

Parameters
TemplateThe parsed template-name.
TemplateLocThe location of the parsed template-name.

Definition at line 1219 of file DeclSpec.h.

References EndLocation, clang::IK_DeductionGuideName, Kind, and StartLocation.

◆ setDestructorName()

void clang::UnqualifiedId::setDestructorName ( SourceLocation  TildeLoc,
ParsedType  ClassType,
SourceLocation  EndLoc 
)
inline

Specify that this unqualified-id was parsed as a destructor name.

Parameters
TildeLocthe location of the '~' that introduces the destructor name.
ClassTypethe name of the class referred to by the destructor name.

Definition at line 1198 of file DeclSpec.h.

References DestructorName, EndLocation, clang::IK_DestructorName, Kind, and StartLocation.

◆ setIdentifier()

void clang::UnqualifiedId::setIdentifier ( const IdentifierInfo Id,
SourceLocation  IdLoc 
)
inline

Specify that this unqualified-id was parsed as an identifier.

Parameters
Idthe parsed identifier.
IdLocthe location of the parsed identifier.

Definition at line 1116 of file DeclSpec.h.

References EndLocation, Id, Identifier, clang::IK_Identifier, Kind, and StartLocation.

Referenced by clang::SemaCodeCompletion::CodeCompleteObjCSuperMessage().

◆ setImplicitSelfParam()

void clang::UnqualifiedId::setImplicitSelfParam ( const IdentifierInfo Id)
inline

Specify that this unqualified-id is an implicit 'self' parameter.

Parameters
Idthe identifier.

Definition at line 1230 of file DeclSpec.h.

References EndLocation, Id, Identifier, clang::IK_ImplicitSelfParam, Kind, and StartLocation.

Referenced by clang::SemaObjC::BuildIvarRefExpr().

◆ setLiteralOperatorId()

void clang::UnqualifiedId::setLiteralOperatorId ( const IdentifierInfo Id,
SourceLocation  OpLoc,
SourceLocation  IdLoc 
)
inline

Specific that this unqualified-id was parsed as a literal-operator-id.

Parameters
Idthe parsed identifier.
OpLocthe location of the 'operator' keyword.
IdLocthe location of the identifier.

Definition at line 1160 of file DeclSpec.h.

References EndLocation, Id, Identifier, clang::IK_LiteralOperatorId, Kind, and StartLocation.

◆ setOperatorFunctionId()

void UnqualifiedId::setOperatorFunctionId ( SourceLocation  OperatorLoc,
OverloadedOperatorKind  Op,
SourceLocation  SymbolLocations[3] 
)

Specify that this unqualified-id was parsed as an operator-function-id.

Parameters
OperatorLocthe location of the 'operator' keyword.
Opthe overloaded operator.
SymbolLocationsthe locations of the individual operator symbols in the operator.

Definition at line 1510 of file DeclSpec.cpp.

References EndLocation, clang::IK_OperatorFunctionId, isValid(), clang::UnqualifiedId::OFI::Operator, OperatorFunctionId, StartLocation, and clang::UnqualifiedId::OFI::SymbolLocations.

Referenced by ParseReductionId().

◆ setTemplateId()

void UnqualifiedId::setTemplateId ( TemplateIdAnnotation TemplateId)

Specify that this unqualified-id was parsed as a template-id.

Parameters
TemplateIdthe 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 32 of file DeclSpec.cpp.

References EndLocation, clang::IK_TemplateId, clang::TemplateIdAnnotation::isInvalid(), clang::TemplateIdAnnotation::RAngleLoc, StartLocation, TemplateId, and clang::TemplateIdAnnotation::TemplateNameLoc.

Member Data Documentation

◆ 

union { ... } clang::UnqualifiedId::@221

Anonymous union that holds extra data associated with the parsed unqualified-id.

◆ ConstructorName

UnionParsedType clang::UnqualifiedId::ConstructorName

When Kind == IK_ConstructorName, the class-name of the type whose constructor is being referenced.

Definition at line 1068 of file DeclSpec.h.

Referenced by setConstructorName().

◆ ConversionFunctionId

UnionParsedType clang::UnqualifiedId::ConversionFunctionId

When Kind == IK_ConversionFunctionId, the type that the conversion function names.

Definition at line 1064 of file DeclSpec.h.

Referenced by setConversionFunctionId().

◆ DestructorName

UnionParsedType clang::UnqualifiedId::DestructorName

When Kind == IK_DestructorName, the type referred to by the class-name.

Definition at line 1072 of file DeclSpec.h.

Referenced by setDestructorName().

◆ EndLocation

SourceLocation clang::UnqualifiedId::EndLocation

◆ Identifier

const IdentifierInfo* clang::UnqualifiedId::Identifier

When Kind == IK_Identifier, the parsed identifier, or when Kind == IK_UserLiteralId, the identifier suffix.

Definition at line 1056 of file DeclSpec.h.

Referenced by clang::Sema::ActOnPseudoDestructorExpr(), clear(), setIdentifier(), setImplicitSelfParam(), and setLiteralOperatorId().

◆ OperatorFunctionId

struct OFI clang::UnqualifiedId::OperatorFunctionId

When Kind == IK_OperatorFunctionId, the overloaded operator that we parsed.

Definition at line 1060 of file DeclSpec.h.

Referenced by setOperatorFunctionId().

◆ StartLocation

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

Referenced by clang::Sema::ActOnPseudoDestructorExpr(), clear(), getBeginLoc(), getSourceRange(), isValid(), setConstructorName(), setConstructorTemplateId(), setConversionFunctionId(), setDeductionGuideName(), setDestructorName(), setIdentifier(), setImplicitSelfParam(), setLiteralOperatorId(), setOperatorFunctionId(), and setTemplateId().

◆ TemplateId

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

Referenced by clang::Sema::ActOnPseudoDestructorExpr(), setConstructorTemplateId(), and setTemplateId().

◆ TemplateName

UnionParsedTemplateTy clang::UnqualifiedId::TemplateName

When Kind == IK_DeductionGuideName, the parsed template-name.

Definition at line 1075 of file DeclSpec.h.


The documentation for this class was generated from the following files: