|
clang 22.0.0git
|
Attr - This represents one attribute. More...
#include "clang/AST/Attr.h"
Public Member Functions | |
| void * | operator new (size_t Bytes, ASTContext &C, size_t Alignment=8) noexcept |
| void | operator delete (void *Ptr, ASTContext &C, size_t Alignment) noexcept |
| attr::Kind | getKind () const |
| unsigned | getSpellingListIndex () const |
| const char * | getSpelling () const |
| SourceLocation | getLocation () const |
| bool | isInherited () const |
| bool | isImplicit () const |
| Returns true if the attribute has been implicitly created instead of explicitly written by the user. | |
| void | setImplicit (bool I) |
| void | setPackExpansion (bool PE) |
| bool | isPackExpansion () const |
| Attr * | clone (ASTContext &C) const |
| bool | isLateParsed () const |
| void | printPretty (raw_ostream &OS, const PrintingPolicy &Policy) const |
| Public Member Functions inherited from clang::AttributeCommonInfo | |
| AttributeCommonInfo (const IdentifierInfo *AttrName, AttributeScopeInfo AttrScope, SourceRange AttrRange, Kind AttrKind, Form FormUsed) | |
| AttributeCommonInfo (const IdentifierInfo *AttrName, AttributeScopeInfo Scope, SourceRange AttrRange, Form FormUsed) | |
| AttributeCommonInfo (const IdentifierInfo *AttrName, SourceRange AttrRange, Form FormUsed) | |
| AttributeCommonInfo (SourceRange AttrRange, Kind K, Form FormUsed) | |
| AttributeCommonInfo (SourceRange AttrRange, AttributeScopeInfo AttrScope, Kind K, Form FormUsed) | |
| AttributeCommonInfo (AttributeCommonInfo &&)=default | |
| AttributeCommonInfo (const AttributeCommonInfo &)=default | |
| Kind | getParsedKind () const |
| Syntax | getSyntax () const |
| Form | getForm () const |
| const IdentifierInfo * | getAttrName () const |
| void | setAttrName (const IdentifierInfo *AttrNameII) |
| SourceLocation | getLoc () const |
| SourceRange | getRange () const |
| void | setRange (SourceRange R) |
| bool | hasScope () const |
| bool | isExplicitScope () const |
| const IdentifierInfo * | getScopeName () const |
| SourceLocation | getScopeLoc () const |
| std::string | getNormalizedFullName () const |
| Gets the normalized full name, which consists of both scope and name and with surrounding underscores removed as appropriate (e.g. | |
| std::string | getNormalizedFullName (StringRef ScopeName, StringRef AttrName) const |
| StringRef | getNormalizedScopeName () const |
| StringRef | getNormalizedAttrName (StringRef ScopeName) const |
| std::optional< StringRef > | tryGetCorrectedScopeName (StringRef ScopeName) const |
| std::optional< StringRef > | tryGetCorrectedAttrName (StringRef ScopeName, StringRef AttrName, const TargetInfo &Target, const LangOptions &LangOpts) const |
| SourceRange | getNormalizedRange () const |
| bool | isDeclspecAttribute () const |
| bool | isMicrosoftAttribute () const |
| bool | isGNUScope () const |
| bool | isClangScope () const |
| bool | isCXX11Attribute () const |
| bool | isC23Attribute () const |
| bool | isAlignas () const |
| bool | isStandardAttributeSyntax () const |
| The attribute is spelled [[]] in either C or C++ mode, including standard attributes spelled with a keyword, like alignas. | |
| bool | isGNUAttribute () const |
| bool | isKeywordAttribute () const |
| bool | isRegularKeywordAttribute () const |
| bool | isContextSensitiveKeywordAttribute () const |
| unsigned | getAttributeSpellingListIndex () const |
| void | setAttributeSpellingListIndex (unsigned V) |
Static Public Member Functions | |
| static StringRef | getDocumentation (attr::Kind) |
| Static Public Member Functions inherited from clang::AttributeCommonInfo | |
| static Kind | getParsedKind (const IdentifierInfo *Name, const IdentifierInfo *Scope, Syntax SyntaxUsed) |
| static AttrArgsInfo | getCXX11AttrArgsInfo (const IdentifierInfo *Name) |
Protected Member Functions | |
| void * | operator new (size_t bytes) noexcept |
| void | operator delete (void *data) noexcept |
| Attr (ASTContext &Context, const AttributeCommonInfo &CommonInfo, attr::Kind AK, bool IsLateParsed) | |
| Protected Member Functions inherited from clang::AttributeCommonInfo | |
| bool | isAttributeSpellingListCalculated () const |
Protected Attributes | |
| unsigned | Inherited: 1 |
| An index into the spelling list of an attribute defined in Attr.td file. | |
| unsigned | IsPackExpansion: 1 |
| unsigned | Implicit: 1 |
| unsigned | IsLateParsed: 1 |
| unsigned | InheritEvenIfAlreadyPresent: 1 |
Additional Inherited Members | |
| Public Types inherited from clang::AttributeCommonInfo | |
| enum | Syntax { AS_GNU = 1 , AS_CXX11 , AS_C23 , AS_Declspec , AS_Microsoft , AS_Keyword , AS_Pragma , AS_ContextSensitiveKeyword , AS_HLSLAnnotation , AS_Implicit } |
| The style used to specify an attribute. More... | |
| enum | Kind { NoSemaHandlerAttribute , IgnoredAttribute , UnknownAttribute } |
| enum class | Scope { NONE , CLANG , GNU , MSVC , OMP , HLSL , VK , GSL , RISCV } |
| enum class | AttrArgsInfo { None , Optional , Required } |
| Static Protected Attributes inherited from clang::AttributeCommonInfo | |
| static constexpr unsigned | SpellingNotCalculated = 0xf |
|
inlineprotected |
Definition at line 84 of file Attr.h.
References clang::AttributeCommonInfo::AttributeCommonInfo(), false, Implicit, Inherited, InheritEvenIfAlreadyPresent, IsLateParsed, and IsPackExpansion.
Referenced by clang::InheritableAttr::classof(), clang::StmtAttr::classof(), clang::TypeAttr::classof(), clone(), clang::InheritableAttr::InheritableAttr(), clang::StmtAttr::StmtAttr(), and clang::TypeAttr::TypeAttr().
| Attr * clang::Attr::clone | ( | ASTContext & | C | ) | const |
References Attr(), and clang::C.
Referenced by clang::Sema::checkClassLevelDLLAttribute(), getImplicitCodeSegAttrFromClass(), InjectAnonymousStructOrUnionMembers(), instantiateDependentHLSLParamModifierAttr(), instantiateDependentSYCLKernelAttr(), mergeDeclAttribute(), and clang::Sema::propagateDLLAttrToBaseClassTemplate().
|
static |
Definition at line 23 of file AttrDocTable.cpp.
References AttrDoc.
|
inline |
Definition at line 91 of file Attr.h.
Referenced by clang::ASTRecordWriter::AddAttr(), attrToRetainOwnershipKind(), clang::Sema::checkClassLevelDLLAttribute(), checkNewAttributesAfterDef(), CheckNullabilityTypeSpecifier(), clang::DeclOrStmtAttr::classof(), clang::HLSLAnnotationAttr::classof(), clang::HLSLSemanticAttr::classof(), clang::InheritableAttr::classof(), clang::InheritableParamAttr::classof(), clang::InheritableParamOrStmtAttr::classof(), clang::ParameterABIAttr::classof(), clang::StmtAttr::classof(), clang::TypeAttr::classof(), DeclHasAttr(), clang::ParameterABIAttr::getABI(), getCCTypeAttr(), clang::ASTNodeKind::getFromNode(), HandleAddressSpaceTypeAttribute(), handleMSPointerTypeQualifierAttr(), HandleWebAssemblyFuncrefAttr(), clang::ASTImporter::Import(), ReferenceDllExportedMembers(), clang::TreeTransform< Derived >::TransformAttr(), clang::TreeTransform< Derived >::TransformStmtAttr(), clang::attrvisitor::Base< Ptr, ImplClass, RetTy, ParamTys >::Visit(), clang::JSONNodeDumper::Visit(), and clang::TextNodeDumper::Visit().
|
inline |
Definition at line 98 of file Attr.h.
References clang::SourceRange::getBegin(), and clang::AttributeCommonInfo::getRange().
Referenced by clang::Sema::ActOnIfStmt(), clang::Sema::ActOnStartOfFunctionDef(), checkAliasAttr(), clang::checkAMDGPUFlatWorkGroupSizeArguments(), clang::checkAMDGPUWavesPerEUArguments(), clang::checkAttrMutualExclusion(), clang::Sema::checkClassLevelDLLAttribute(), clang::Sema::CheckCompleteVariableDeclaration(), checkForMultipleExportedDefaultConstructors(), checkHybridPatchableAttr(), checkNewAttributesAfterDef(), checkSelectAnyAttr(), checkWeakAttr(), checkWeakRefAttr(), clang::SemaHLSL::createSemanticAttr(), clang::Sema::FinalizeDeclaration(), clang::TypeLoc::findNullabilityLoc(), clang::tooling::getAssociatedRange(), clang::Sema::InstantiateDefaultCtorDefaultArgs(), instantiateDependentFunctionAttrCondition(), clang::Sema::propagateDLLAttrToBaseClassTemplate(), and ReferenceDllExportedMembers().
| const char * clang::Attr::getSpelling | ( | ) | const |
|
inline |
Definition at line 93 of file Attr.h.
References clang::AttributeCommonInfo::getAttributeSpellingListIndex().
|
inline |
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition at line 104 of file Attr.h.
References Implicit.
Referenced by clang::JSONNodeDumper::Visit(), and clang::TextNodeDumper::Visit().
|
inline |
Definition at line 100 of file Attr.h.
References Inherited.
Referenced by clang::Decl::addAttr(), clang::Sema::checkClassLevelDLLAttribute(), clang::Sema::FinalizeDeclaration(), ReferenceDllExportedMembers(), clang::JSONNodeDumper::Visit(), and clang::TextNodeDumper::Visit().
|
inline |
Definition at line 113 of file Attr.h.
References IsLateParsed.
|
inline |
Definition at line 108 of file Attr.h.
References IsPackExpansion.
|
inlineprotectednoexcept |
|
inlinenoexcept |
|
inlineprotectednoexcept |
|
inlinenoexcept |
| void clang::Attr::printPretty | ( | raw_ostream & | OS, |
| const PrintingPolicy & | Policy ) const |
|
inline |
Definition at line 105 of file Attr.h.
References Implicit.
Referenced by checkObjCKindOfType(), and getImplicitCodeSegAttrFromClass().
|
inline |
Definition at line 107 of file Attr.h.
References IsPackExpansion.
|
protected |
Definition at line 58 of file Attr.h.
Referenced by Attr(), isImplicit(), and setImplicit().
|
protected |
An index into the spelling list of an attribute defined in Attr.td file.
Definition at line 54 of file Attr.h.
Referenced by Attr(), isInherited(), and clang::InheritableAttr::setInherited().
|
protected |
Definition at line 64 of file Attr.h.
Referenced by Attr(), clang::DeclOrStmtAttr::DeclOrStmtAttr(), clang::HLSLAnnotationAttr::HLSLAnnotationAttr(), clang::HLSLSemanticAttr::HLSLSemanticAttr(), clang::InheritableAttr::InheritableAttr(), clang::InheritableParamAttr::InheritableParamAttr(), clang::InheritableParamOrStmtAttr::InheritableParamOrStmtAttr(), clang::ParameterABIAttr::ParameterABIAttr(), and clang::InheritableAttr::shouldInheritEvenIfAlreadyPresent().
|
protected |
Definition at line 62 of file Attr.h.
Referenced by Attr(), clang::DeclOrStmtAttr::DeclOrStmtAttr(), clang::HLSLAnnotationAttr::HLSLAnnotationAttr(), clang::HLSLSemanticAttr::HLSLSemanticAttr(), clang::InheritableAttr::InheritableAttr(), clang::InheritableParamAttr::InheritableParamAttr(), clang::InheritableParamOrStmtAttr::InheritableParamOrStmtAttr(), isLateParsed(), clang::ParameterABIAttr::ParameterABIAttr(), clang::StmtAttr::StmtAttr(), and clang::TypeAttr::TypeAttr().
|
protected |
Definition at line 56 of file Attr.h.
Referenced by Attr(), isPackExpansion(), and setPackExpansion().