Go to the documentation of this file.
14 #ifndef LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
15 #define LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
20 class ASTRecordWriter;
56 #define PARSED_ATTR(NAME) AT_##NAME,
57 #include "clang/Sema/AttrParsedAttrList.inc"
70 unsigned AttrKind : 16;
72 unsigned SyntaxUsed : 4;
73 unsigned SpellingIndex : 4;
80 : AttrRange(AttrRange), ScopeLoc(), AttrKind(0), SyntaxUsed(0),
84 : AttrRange(AttrLoc), ScopeLoc(), AttrKind(0), SyntaxUsed(0),
90 : AttrName(AttrName), ScopeName(ScopeName), AttrRange(AttrRange),
98 : AttrName(AttrName), ScopeName(ScopeName), AttrRange(AttrRange),
99 ScopeLoc(ScopeLoc), AttrKind(AttrKind), SyntaxUsed(SyntaxUsed),
106 : AttrName(AttrName), ScopeName(ScopeName), AttrRange(AttrRange),
107 ScopeLoc(ScopeLoc), AttrKind(AttrKind), SyntaxUsed(SyntaxUsed),
108 SpellingIndex(Spelling) {}
112 : AttrName(AttrName), ScopeName(nullptr), AttrRange(AttrRange),
113 ScopeLoc(), AttrKind(
getParsedKind(AttrName, ScopeName, SyntaxUsed)),
117 : AttrName(nullptr), ScopeName(nullptr), AttrRange(AttrRange), ScopeLoc(),
118 AttrKind(K), SyntaxUsed(SyntaxUsed),
123 : AttrName(nullptr), ScopeName(nullptr), AttrRange(AttrRange), ScopeLoc(),
124 AttrKind(K), SyntaxUsed(SyntaxUsed), SpellingIndex(Spelling) {}
195 "Spelling cannot be found");
198 : calculateAttributeSpellingListIndex();
209 unsigned calculateAttributeSpellingListIndex()
const;
213 unsigned getAttributeSpellingListIndexRaw()
const {
return SpellingIndex; }
222 #endif // LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
Kind getParsedKind() const
@ AS_Microsoft
[uuid("...")] class Foo
bool isGNUAttribute() const
SourceLocation getLoc() const
A trivial tuple used to represent a source range.
void setRange(SourceRange R)
Encodes a location in the source.
SourceLocation getBegin() const
bool isKeywordAttribute() const
AttributeCommonInfo(SourceLocation AttrLoc)
const IdentifierInfo * getAttrName() const
AttributeCommonInfo(SourceRange AttrRange, Kind K, Syntax SyntaxUsed)
Syntax
The style used to specify an attribute.
bool isDeclspecAttribute() const
AttributeCommonInfo(SourceRange AttrRange, Kind K, Syntax SyntaxUsed, unsigned Spelling)
@ AS_Keyword
__ptr16, alignas(...), etc.
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Kind AttrKind, Syntax SyntaxUsed)
bool isC2xAttribute() const
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Syntax SyntaxUsed)
@ AS_ContextSensitiveKeyword
Context-sensitive version of a keyword attribute.
bool isStandardAttributeSyntax() const
The attribute is spelled [[]] in either C or C++ mode, including standard attributes spelled with a k...
Scope - A scope is a transient data structure that is used while parsing the program.
bool isContextSensitiveKeywordAttribute() const
AttributeCommonInfo(const IdentifierInfo *AttrName, SourceRange AttrRange, Syntax SyntaxUsed)
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Kind AttrKind, Syntax SyntaxUsed, unsigned Spelling)
bool isAttributeSpellingListCalculated() const
@ AS_HLSLSemantic
<vardecl> : <semantic>
SourceLocation getScopeLoc() const
bool isMicrosoftAttribute() const
bool isCXX11Attribute() const
SourceRange getRange() const
const IdentifierInfo * getScopeName() const
bool isAlignasAttribute() const
An object for streaming information to a record.
std::string getNormalizedFullName() const
Gets the normalized full name, which consists of both scope and name and with surrounding underscores...
@ AS_Declspec
__declspec(...)
One of these records is kept for each identifier that is lexed.
AttributeCommonInfo(SourceRange AttrRange)
bool isClangScope() const
void setAttributeSpellingListIndex(unsigned V)
static constexpr unsigned SpellingNotCalculated
unsigned getAttributeSpellingListIndex() const