14 #ifndef LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H 15 #define LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H 20 class ASTRecordWriter;
53 #define PARSED_ATTR(NAME) AT_##NAME, 54 #include "clang/Sema/AttrParsedAttrList.inc" 67 unsigned AttrKind : 16;
69 unsigned SyntaxUsed : 3;
70 unsigned SpellingIndex : 4;
77 : AttrRange(AttrRange), ScopeLoc(), AttrKind(0), SyntaxUsed(0),
78 SpellingIndex(SpellingNotCalculated) {}
81 : AttrRange(AttrLoc), ScopeLoc(), AttrKind(0), SyntaxUsed(0),
82 SpellingIndex(SpellingNotCalculated) {}
87 : AttrName(AttrName), ScopeName(ScopeName), AttrRange(AttrRange),
90 SyntaxUsed(SyntaxUsed), SpellingIndex(SpellingNotCalculated) {}
95 : AttrName(AttrName), ScopeName(ScopeName), AttrRange(AttrRange),
96 ScopeLoc(ScopeLoc), AttrKind(AttrKind), SyntaxUsed(SyntaxUsed),
97 SpellingIndex(SpellingNotCalculated) {}
103 : AttrName(AttrName), ScopeName(ScopeName), AttrRange(AttrRange),
104 ScopeLoc(ScopeLoc), AttrKind(AttrKind), SyntaxUsed(SyntaxUsed),
105 SpellingIndex(Spelling) {}
109 : AttrName(AttrName), ScopeName(nullptr), AttrRange(AttrRange),
110 ScopeLoc(), AttrKind(
getParsedKind(AttrName, ScopeName, SyntaxUsed)),
111 SyntaxUsed(SyntaxUsed), SpellingIndex(SpellingNotCalculated) {}
114 : AttrName(nullptr), ScopeName(nullptr), AttrRange(AttrRange), ScopeLoc(),
115 AttrKind(K), SyntaxUsed(SyntaxUsed),
116 SpellingIndex(SpellingNotCalculated) {}
120 : AttrName(nullptr), ScopeName(nullptr), AttrRange(AttrRange), ScopeLoc(),
121 AttrKind(K), SyntaxUsed(SyntaxUsed), SpellingIndex(Spelling) {}
163 "Spelling cannot be found");
166 : calculateAttributeSpellingListIndex();
177 unsigned calculateAttributeSpellingListIndex()
const;
181 unsigned getAttributeSpellingListIndexRaw()
const {
return SpellingIndex; }
190 #endif // LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H AttributeCommonInfo(SourceRange AttrRange, Kind K, Syntax SyntaxUsed, unsigned Spelling)
bool isC2xAttribute() const
SourceLocation getLoc() const
Syntax
The style used to specify an attribute.
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Kind AttrKind, Syntax SyntaxUsed)
bool isAttributeSpellingListCalculated() const
One of these records is kept for each identifier that is lexed.
AttributeCommonInfo(SourceLocation AttrLoc)
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Syntax SyntaxUsed)
bool isKeywordAttribute() const
__ptr16, alignas(...), etc.
Scope - A scope is a transient data structure that is used while parsing the program.
const IdentifierInfo * getAttrName() const
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Kind AttrKind, Syntax SyntaxUsed, unsigned Spelling)
SourceLocation getScopeLoc() const
AttributeCommonInfo(SourceRange AttrRange, Kind K, Syntax SyntaxUsed)
bool isContextSensitiveKeywordAttribute() const
AttributeCommonInfo(const IdentifierInfo *AttrName, SourceRange AttrRange, Syntax SyntaxUsed)
bool isDeclspecAttribute() const
void setAttributeSpellingListIndex(unsigned V)
Encodes a location in the source.
SourceRange getRange() const
Dataflow Directional Tag Classes.
static constexpr unsigned SpellingNotCalculated
bool isCXX11Attribute() const
AttributeCommonInfo(SourceRange AttrRange)
bool isAlignasAttribute() const
void setRange(SourceRange R)
bool isMicrosoftAttribute() const
Defines the clang::SourceLocation class and associated facilities.
An object for streaming information to a record.
unsigned getAttributeSpellingListIndex() const
const IdentifierInfo * getScopeName() const
Context-sensitive version of a keyword attribute.
Kind getParsedKind() const
A trivial tuple used to represent a source range.
SourceLocation getBegin() const