clang API Documentation
#include <DeclarationName.h>
Public Member Functions | |
DeclarationNameInfo () | |
DeclarationNameInfo (DeclarationName Name, SourceLocation NameLoc) | |
DeclarationNameInfo (DeclarationName Name, SourceLocation NameLoc, DeclarationNameLoc LocInfo) | |
DeclarationName | getName () const |
getName - Returns the embedded declaration name. | |
void | setName (DeclarationName N) |
setName - Sets the embedded declaration name. | |
SourceLocation | getLoc () const |
getLoc - Returns the main location of the declaration name. | |
void | setLoc (SourceLocation L) |
setLoc - Sets the main location of the declaration name. | |
const DeclarationNameLoc & | getInfo () const |
DeclarationNameLoc & | getInfo () |
void | setInfo (const DeclarationNameLoc &Info) |
TypeSourceInfo * | getNamedTypeInfo () const |
void | setNamedTypeInfo (TypeSourceInfo *TInfo) |
SourceRange | getCXXOperatorNameRange () const |
void | setCXXOperatorNameRange (SourceRange R) |
SourceLocation | getCXXLiteralOperatorNameLoc () const |
void | setCXXLiteralOperatorNameLoc (SourceLocation Loc) |
bool | isInstantiationDependent () const |
Determine whether this name involves a template parameter. | |
bool | containsUnexpandedParameterPack () const |
Determine whether this name contains an unexpanded parameter pack. | |
std::string | getAsString () const |
getAsString - Retrieve the human-readable string for this name. | |
void | printName (raw_ostream &OS) const |
printName - Print the human-readable name to a stream. | |
SourceLocation | getBeginLoc () const |
getBeginLoc - Retrieve the location of the first token. | |
SourceLocation | getEndLoc () const |
getEndLoc - Retrieve the location of the last token. | |
SourceRange | getSourceRange () const LLVM_READONLY |
getSourceRange - The range of the declaration name. | |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getLocEnd () const LLVM_READONLY |
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnding source/type location info.
Definition at line 430 of file DeclarationName.h.
clang::DeclarationNameInfo::DeclarationNameInfo | ( | ) | [inline] |
Definition at line 441 of file DeclarationName.h.
clang::DeclarationNameInfo::DeclarationNameInfo | ( | DeclarationName | Name, |
SourceLocation | NameLoc | ||
) | [inline] |
Definition at line 443 of file DeclarationName.h.
clang::DeclarationNameInfo::DeclarationNameInfo | ( | DeclarationName | Name, |
SourceLocation | NameLoc, | ||
DeclarationNameLoc | LocInfo | ||
) | [inline] |
Definition at line 446 of file DeclarationName.h.
Determine whether this name contains an unexpanded parameter pack.
Definition at line 477 of file DeclarationName.cpp.
References clang::Type::containsUnexpandedParameterPack(), clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationName::CXXOperatorName, clang::DeclarationName::CXXUsingDirective, clang::DeclarationName::getCXXNameType(), clang::DeclarationName::getNameKind(), clang::DeclarationName::Identifier, clang::DeclarationNameLoc::NamedType, clang::DeclarationName::ObjCMultiArgSelector, clang::DeclarationName::ObjCOneArgSelector, clang::DeclarationName::ObjCZeroArgSelector, and clang::DeclarationNameLoc::NT::TInfo.
std::string DeclarationNameInfo::getAsString | ( | ) | const |
getAsString - Retrieve the human-readable string for this name.
Definition at line 521 of file DeclarationName.cpp.
References printName().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPCriticalDirective().
SourceLocation clang::DeclarationNameInfo::getBeginLoc | ( | ) | const [inline] |
getBeginLoc - Retrieve the location of the first token.
Definition at line 528 of file DeclarationName.h.
Referenced by clang::Sema::ActOnFriendFunctionDecl(), getLocStart(), and clang::CXXDependentScopeMemberExpr::getLocStart().
SourceLocation clang::DeclarationNameInfo::getCXXLiteralOperatorNameLoc | ( | ) | const [inline] |
getCXXLiteralOperatorNameLoc - Returns the location of the literal operator name (not the operator keyword). Assumes it is a literal operator.
Definition at line 501 of file DeclarationName.h.
References clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationNameLoc::CXXLiteralOperatorName, clang::SourceLocation::getFromRawEncoding(), and clang::DeclarationNameLoc::CXXLitOpName::OpNameLoc.
Referenced by clang::Sema::BuildLiteralOperatorCall(), and clang::ASTNodeImporter::ImportDeclarationNameLoc().
SourceRange clang::DeclarationNameInfo::getCXXOperatorNameRange | ( | ) | const [inline] |
getCXXOperatorNameRange - Gets the range of the operator name (without the operator keyword). Assumes it is a (non-literal) operator.
Definition at line 483 of file DeclarationName.h.
References clang::DeclarationNameLoc::CXXOpName::BeginOpNameLoc, clang::DeclarationName::CXXOperatorName, clang::DeclarationNameLoc::CXXOperatorName, clang::DeclarationNameLoc::CXXOpName::EndOpNameLoc, and clang::SourceLocation::getFromRawEncoding().
Referenced by clang::ASTNodeImporter::ImportDeclarationNameLoc(), and RebuildLambdaScopeInfo().
SourceLocation DeclarationNameInfo::getEndLoc | ( | ) | const |
getEndLoc - Retrieve the location of the last token.
Definition at line 559 of file DeclarationName.cpp.
References clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationNameLoc::CXXLiteralOperatorName, clang::DeclarationName::CXXOperatorName, clang::DeclarationNameLoc::CXXOperatorName, clang::DeclarationName::CXXUsingDirective, clang::DeclarationNameLoc::CXXOpName::EndOpNameLoc, clang::SourceLocation::getFromRawEncoding(), clang::DeclarationName::getNameKind(), clang::DeclarationName::Identifier, clang::DeclarationNameLoc::NamedType, clang::DeclarationName::ObjCMultiArgSelector, clang::DeclarationName::ObjCOneArgSelector, clang::DeclarationName::ObjCZeroArgSelector, clang::DeclarationNameLoc::CXXLitOpName::OpNameLoc, and clang::DeclarationNameLoc::NT::TInfo.
Referenced by clang::Sema::ActOnOpenMPReductionClause(), clang::Sema::BuildQualifiedDeclarationNameExpr(), getLocEnd(), and clang::CXXDependentScopeMemberExpr::getLocEnd().
const DeclarationNameLoc& clang::DeclarationNameInfo::getInfo | ( | ) | const [inline] |
Definition at line 460 of file DeclarationName.h.
Referenced by clang::ASTWriter::AddDeclarationNameInfo(), clang::Sema::BuildLiteralOperatorCall(), and clang::Sema::GetNameFromUnqualifiedId().
DeclarationNameLoc& clang::DeclarationNameInfo::getInfo | ( | ) | [inline] |
Definition at line 461 of file DeclarationName.h.
SourceLocation clang::DeclarationNameInfo::getLoc | ( | ) | const [inline] |
getLoc - Returns the main location of the declaration name.
Definition at line 456 of file DeclarationName.h.
Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnOpenMPIdExpression(), clang::ASTWriter::AddDeclarationNameInfo(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildDeclRefExpr(), clang::Sema::BuildLiteralOperatorCall(), clang::Sema::BuildMemberReferenceExpr(), BuildMSPropertyRefExpr(), clang::Sema::BuildQualifiedDeclarationNameExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckTemplateTypeArgument(), clang::Sema::CheckVarTemplateId(), clang::Sema::CorrectTypo(), clang::Sema::DiagnoseClassNameShadow(), diagnoseInstanceReference(), DiagnoseQualifiedMemberReference(), clang::Sema::DiagnoseUnexpandedParameterPack(), clang::DependentScopeDeclRefExpr::getLocation(), clang::CXXDependentScopeMemberExpr::getMemberLoc(), clang::LookupResult::getNameLoc(), clang::OverloadExpr::getNameLoc(), recoverFromMSUnqualifiedLookup(), clang::TypoCorrection::setCorrectionRange(), clang::Sema::SubstDeclarationNameInfo(), and clang::TreeTransform< Derived >::TransformDeclarationNameInfo().
SourceLocation clang::DeclarationNameInfo::getLocEnd | ( | ) | const [inline] |
Definition at line 538 of file DeclarationName.h.
References getEndLoc(), getLocStart(), and clang::SourceLocation::isValid().
Referenced by clang::Sema::CheckUsingDeclQualifier(), clang::DeclRefExpr::getLocEnd(), clang::UnresolvedLookupExpr::getLocEnd(), clang::UnresolvedMemberExpr::getLocEnd(), and getSourceRange().
SourceLocation clang::DeclarationNameInfo::getLocStart | ( | ) | const [inline] |
Definition at line 535 of file DeclarationName.h.
References getBeginLoc().
Referenced by clang::Sema::ActOnOpenMPReductionClause(), getLocEnd(), clang::DeclRefExpr::getLocStart(), clang::UnresolvedLookupExpr::getLocStart(), clang::UnresolvedMemberExpr::getLocStart(), clang::FunctionDecl::getReturnTypeSourceRange(), and getSourceRange().
DeclarationName clang::DeclarationNameInfo::getName | ( | ) | const [inline] |
getName - Returns the embedded declaration name.
Definition at line 451 of file DeclarationName.h.
Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnDependentMemberExpr(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnMemberAccessExpr(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnOpenMPReductionClause(), clang::Sema::ActOnUsingDeclaration(), clang::ASTWriter::AddDeclarationNameInfo(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildPossibleImplicitMemberExpr(), clang::Sema::BuildQualifiedDeclarationNameExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckMicrosoftIfExistsSymbol(), CheckNestingOfRegions(), clang::Sema::CheckTemplateTypeArgument(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::CorrectTypo(), clang::Sema::CorrectTypoDelayed(), clang::CXXConstructorDecl::Create(), clang::CXXDestructorDecl::Create(), clang::CXXConversionDecl::Create(), CreateNewFunctionDecl(), clang::Sema::DiagnoseClassNameShadow(), diagnoseInstanceReference(), clang::Sema::DiagnoseUnexpandedParameterPack(), clang::DependentScopeDeclRefExpr::getDeclName(), clang::LookupResult::getLookupName(), clang::CXXDependentScopeMemberExpr::getMember(), clang::OverloadExpr::getName(), handleCleanupAttr(), clang::Sema::HandleDeclarator(), clang::ASTNodeImporter::ImportDeclarationNameLoc(), clang::MemberExpr::MemberExpr(), clang::ASTReader::ReadDeclarationNameInfo(), recoverFromMSUnqualifiedLookup(), clang::Sema::SubstDeclarationNameInfo(), clang::TreeTransform< Derived >::TransformDeclarationNameInfo(), and clang::RecursiveASTVisitor< Derived >::TraverseDeclarationNameInfo().
TypeSourceInfo* clang::DeclarationNameInfo::getNamedTypeInfo | ( | ) | const [inline] |
getNamedTypeInfo - Returns the source type info associated to the name. Assumes it is a constructor, destructor or conversion.
Definition at line 466 of file DeclarationName.h.
References clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::DeclarationNameLoc::NamedType, and clang::DeclarationNameLoc::NT::TInfo.
Referenced by clang::Sema::DiagnoseUnexpandedParameterPack(), clang::ASTNodeImporter::ImportDeclarationNameLoc(), clang::TreeTransform< Derived >::TransformDeclarationNameInfo(), and clang::RecursiveASTVisitor< Derived >::TraverseDeclarationNameInfo().
SourceRange clang::DeclarationNameInfo::getSourceRange | ( | ) | const [inline] |
getSourceRange - The range of the declaration name.
Definition at line 532 of file DeclarationName.h.
References getLocEnd(), and getLocStart().
Referenced by clang::Sema::ActOnDependentMemberExpr(), and clang::Sema::CheckInheritingConstructorUsingDecl().
Determine whether this name involves a template parameter.
Definition at line 499 of file DeclarationName.cpp.
References clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationName::CXXOperatorName, clang::DeclarationName::CXXUsingDirective, clang::DeclarationName::getCXXNameType(), clang::DeclarationName::getNameKind(), clang::DeclarationName::Identifier, clang::Type::isInstantiationDependentType(), clang::DeclarationNameLoc::NamedType, clang::DeclarationName::ObjCMultiArgSelector, clang::DeclarationName::ObjCOneArgSelector, clang::DeclarationName::ObjCZeroArgSelector, and clang::DeclarationNameLoc::NT::TInfo.
void DeclarationNameInfo::printName | ( | raw_ostream & | OS | ) | const |
printName - Print the human-readable name to a stream.
Definition at line 528 of file DeclarationName.cpp.
References clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationName::CXXOperatorName, clang::DeclarationName::CXXUsingDirective, clang::DeclarationName::getNameKind(), clang::DeclarationName::Identifier, clang::DeclarationNameLoc::NamedType, clang::DeclarationName::ObjCMultiArgSelector, clang::DeclarationName::ObjCOneArgSelector, clang::DeclarationName::ObjCZeroArgSelector, and clang::DeclarationNameLoc::NT::TInfo.
Referenced by getAsString(), and clang::operator<<().
void clang::DeclarationNameInfo::setCXXLiteralOperatorNameLoc | ( | SourceLocation | Loc | ) | [inline] |
setCXXLiteralOperatorNameLoc - Sets the location of the literal operator name (not the operator keyword). Assumes it is a literal operator.
Definition at line 509 of file DeclarationName.h.
References clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationNameLoc::CXXLiteralOperatorName, clang::SourceLocation::getRawEncoding(), and clang::DeclarationNameLoc::CXXLitOpName::OpNameLoc.
Referenced by clang::Sema::ActOnNumericConstant(), clang::Sema::ActOnStringLiteral(), BuildCookedLiteralOperatorCall(), clang::Sema::GetNameFromUnqualifiedId(), and clang::ASTNodeImporter::ImportDeclarationNameLoc().
void clang::DeclarationNameInfo::setCXXOperatorNameRange | ( | SourceRange | R | ) | [inline] |
setCXXOperatorNameRange - Sets the range of the operator name (without the operator keyword). Assumes it is a C++ operator.
Definition at line 492 of file DeclarationName.h.
References clang::DeclarationNameLoc::CXXOpName::BeginOpNameLoc, clang::DeclarationName::CXXOperatorName, clang::DeclarationNameLoc::CXXOperatorName, clang::DeclarationNameLoc::CXXOpName::EndOpNameLoc, clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and clang::SourceLocation::getRawEncoding().
Referenced by clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::CreateOverloadedArraySubscriptExpr(), and clang::ASTNodeImporter::ImportDeclarationNameLoc().
void clang::DeclarationNameInfo::setInfo | ( | const DeclarationNameLoc & | Info | ) | [inline] |
Definition at line 462 of file DeclarationName.h.
Referenced by clang::ASTReader::ReadDeclarationNameInfo().
void clang::DeclarationNameInfo::setLoc | ( | SourceLocation | L | ) | [inline] |
setLoc - Sets the main location of the declaration name.
Definition at line 458 of file DeclarationName.h.
Referenced by clang::Sema::GetNameFromUnqualifiedId(), and clang::ASTReader::ReadDeclarationNameInfo().
void clang::DeclarationNameInfo::setName | ( | DeclarationName | N | ) | [inline] |
setName - Sets the embedded declaration name.
Definition at line 453 of file DeclarationName.h.
Referenced by clang::Sema::BuildUsingDeclaration(), clang::Sema::GetNameFromUnqualifiedId(), clang::ASTReader::ReadDeclarationNameInfo(), clang::LookupResult::setLookupName(), and clang::TreeTransform< Derived >::TransformDeclarationNameInfo().
void clang::DeclarationNameInfo::setNamedTypeInfo | ( | TypeSourceInfo * | TInfo | ) | [inline] |
setNamedTypeInfo - Sets the source type info associated to the name. Assumes it is a constructor, destructor or conversion.
Definition at line 474 of file DeclarationName.h.
References clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::DeclarationNameLoc::NamedType, and clang::DeclarationNameLoc::NT::TInfo.
Referenced by clang::Sema::BuildUsingDeclaration(), clang::Sema::GetNameFromUnqualifiedId(), clang::ASTNodeImporter::ImportDeclarationNameLoc(), clang::TreeTransform< Derived >::RebuildCXXPseudoDestructorExpr(), and clang::TreeTransform< Derived >::TransformDeclarationNameInfo().