clang 10.0.0git

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::Attr Class Reference

Attr - This represents one attribute. More...

`#include "clang/AST/Attr.h"`

Inheritance diagram for clang::Attr:
[legend]
Collaboration diagram for clang::Attr:
[legend]

## 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. More...
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 (SourceRange AttrRange)
| AttributeCommonInfo (SourceLocation AttrLoc)
| AttributeCommonInfo (const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Syntax SyntaxUsed)
| AttributeCommonInfo (const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Kind AttrKind, Syntax SyntaxUsed)
| AttributeCommonInfo (const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Kind AttrKind, Syntax SyntaxUsed, unsigned Spelling)
| AttributeCommonInfo (const IdentifierInfo *AttrName, SourceRange AttrRange, Syntax SyntaxUsed)
| AttributeCommonInfo (SourceRange AttrRange, Kind K, Syntax SyntaxUsed)
| AttributeCommonInfo (SourceRange AttrRange, Kind K, Syntax SyntaxUsed, unsigned Spelling)
| AttributeCommonInfo (AttributeCommonInfo &&)=default
| AttributeCommonInfo (const AttributeCommonInfo &)=default
Kind | getParsedKind () const
Syntax | getSyntax () const
const IdentifierInfo * | getAttrName () const
SourceLocation | getLoc () const
SourceRange | getRange () const
void | setRange (SourceRange R)
bool | hasScope () const
const IdentifierInfo * | getScopeName () const
SourceLocation | getScopeLoc () const
bool | isDeclspecAttribute () const
bool | isMicrosoftAttribute () const
bool | isGNUScope () const
bool | isAlignasAttribute () const
bool | isCXX11Attribute () const
bool | isC2xAttribute () const
bool | isKeywordAttribute () const
bool | isContextSensitiveKeywordAttribute () const
unsigned | getAttributeSpellingListIndex () const
void | setAttributeSpellingListIndex (unsigned V)

## 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. More...
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, AS_CXX11, AS_C2x, AS_Declspec, AS_Microsoft, AS_Keyword, AS_Pragma, AS_ContextSensitiveKeyword }
| The style used to specify an attribute. More...
enum | Kind { NoSemaHandlerAttribute, IgnoredAttribute, UnknownAttribute }
Static Public Member Functions inherited from clang::AttributeCommonInfo
static Kind | getParsedKind (const IdentifierInfo *Name, const IdentifierInfo *Scope, Syntax SyntaxUsed)
Static Protected Attributes inherited from clang::AttributeCommonInfo
static constexpr unsigned | SpellingNotCalculated = 0xf

## Detailed Description

Attr - This represents one attribute.

Definition at line 45 of file Attr.h.

## Constructor & Destructor Documentation

## ◆ Attr()

clang::Attr::Attr | ( | ASTContext & | Context,
|  | const AttributeCommonInfo & | CommonInfo,
|  | attr::Kind | AK,
|  | bool | IsLateParsed
| ) |  |
| inline protected

Definition at line 78 of file Attr.h.

## Member Function Documentation

## ◆ clone()

Attr* clang::Attr::clone | ( | ASTContext & | C | ) | const

Referenced by clang::ASTImporter::Import(), isPackExpansion(), and clang::Sema::propagateDLLAttrToBaseClassTemplate().

## ◆ getKind()

attr::Kind clang::Attr::getKind | ( |  | ) | const
| inline

Definition at line 85 of file Attr.h.

Referenced by clang::ASTRecordWriter::AddAttr(), clang::ast_matchers::AST_MATCHER_P(), attrToRetainOwnershipKind(), clang::TypeAttr::classof(), clang::StmtAttr::classof(), clang::InheritableAttr::classof(), clang::InheritableParamAttr::classof(), clang::ParameterABIAttr::classof(), DeclHasAttr(), clang::ParameterABIAttr::getABI(), getStaticBooleanValue(), handleMSPointerTypeQualifierAttr(), ReferenceDllExportedMembers(), clang::TreeTransform< Derived >::TransformAttr(), clang::attrvisitor::Base< llvm::make_const_ptr, JSONNodeDumper, void, ParamTys... >::Visit(), clang::TextNodeDumper::Visit(), and clang::JSONNodeDumper::Visit().

## ◆ getLocation()

SourceLocation clang::Attr::getLocation | ( |  | ) | const
| inline

Definition at line 92 of file Attr.h.

References clang::SourceRange::getBegin(), and clang::AttributeCommonInfo::getRange().

Referenced by clang::Sema::ActOnStartOfFunctionDef(), checkForMultipleExportedDefaultConstructors(), clang::TypeLoc::findNullabilityLoc(), clang::Sema::propagateDLLAttrToBaseClassTemplate(), ReferenceDllExportedMembers(), and clang::TreeTransform< Derived >::TransformDependentTemplateSpecializationType().

## ◆ getSpelling()

const char* clang::Attr::getSpelling | ( |  | ) | const

Referenced by clang::Sema::CheckParmsForFunctionDef(), and getSpellingListIndex().

## ◆ getSpellingListIndex()

unsigned clang::Attr::getSpellingListIndex | ( |  | ) | const
| inline

Definition at line 87 of file Attr.h.

References clang::AttributeCommonInfo::getAttributeSpellingListIndex(), and getSpelling().

## ◆ isImplicit()

bool clang::Attr::isImplicit | ( |  | ) | const
| inline

Returns true if the attribute has been implicitly created instead of explicitly written by the user.

Definition at line 98 of file Attr.h.

References Implicit.

Referenced by clang::TextNodeDumper::Visit(), and clang::JSONNodeDumper::Visit().

## ◆ isInherited()

bool clang::Attr::isInherited | ( |  | ) | const
| inline

Definition at line 94 of file Attr.h.

References Inherited.

Referenced by clang::Decl::addAttr(), ReferenceDllExportedMembers(), clang::TextNodeDumper::Visit(), and clang::JSONNodeDumper::Visit().

## ◆ isLateParsed()

bool clang::Attr::isLateParsed | ( |  | ) | const
| inline

Definition at line 107 of file Attr.h.

References IsLateParsed, and printPretty().

## ◆ isPackExpansion()

bool clang::Attr::isPackExpansion | ( |  | ) | const
| inline

Definition at line 102 of file Attr.h.

References clone(), and IsPackExpansion.

## ◆ operator delete() [1/2]

void clang::Attr::operator delete | ( | void * | data | ) |
| inline protected noexcept

Definition at line 63 of file Attr.h.

## ◆ operator delete() [2/2]

void clang::Attr::operator delete | ( | void * | Ptr,
|  | ASTContext & | C,
|  | size_t | Alignment
| ) |  |
| inline noexcept

Definition at line 73 of file Attr.h.

References clang::C.

## ◆ operator new() [1/2]

void* clang::Attr::operator new | ( | size_t | bytes | ) |
| inline protected noexcept

Definition at line 60 of file Attr.h.

## ◆ operator new() [2/2]

void* clang::Attr::operator new | ( | size_t | Bytes,
|  | ASTContext & | C,
|  | size_t | Alignment = `8`
| ) |  |
| inline noexcept

Definition at line 69 of file Attr.h.

References clang::C.

## ◆ printPretty()

void clang::Attr::printPretty | ( | raw_ostream & | OS,
|  | const PrintingPolicy & | Policy
| ) |  | const

Referenced by isLateParsed().

## ◆ setImplicit()

void clang::Attr::setImplicit | ( | bool | I | ) |
| inline

Definition at line 99 of file Attr.h.

References Implicit.

## ◆ setPackExpansion()

void clang::Attr::setPackExpansion | ( | bool | PE | ) |
| inline

Definition at line 101 of file Attr.h.

References IsPackExpansion.

## Member Data Documentation

## ◆ Implicit

unsigned clang::Attr::Implicit
| protected

Definition at line 54 of file Attr.h.

Referenced by isImplicit(), and setImplicit().

## ◆ Inherited

unsigned clang::Attr::Inherited
| protected

An index into the spelling list of an attribute defined in Attr.td file.

Definition at line 52 of file Attr.h.

Referenced by isInherited(), and clang::InheritableAttr::setInherited().

## ◆ InheritEvenIfAlreadyPresent

unsigned clang::Attr::InheritEvenIfAlreadyPresent
| protected

Definition at line 58 of file Attr.h.

Referenced by clang::InheritableAttr::shouldInheritEvenIfAlreadyPresent().

## ◆ IsLateParsed

unsigned clang::Attr::IsLateParsed
| protected

Definition at line 57 of file Attr.h.

Referenced by isLateParsed().

## ◆ IsPackExpansion

unsigned clang::Attr::IsPackExpansion
| protected

Definition at line 53 of file Attr.h.

Referenced by isPackExpansion(), and setPackExpansion().

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

- include/clang/AST/Attr.h