14#ifndef LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
15#define LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
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; }
Defines the clang::SourceLocation class and associated facilities.
An object for streaming information to a record.
SourceLocation getScopeLoc() const
bool isAttributeSpellingListCalculated() const
bool isMicrosoftAttribute() const
bool isClangScope() const
void setAttributeSpellingListIndex(unsigned V)
std::string getNormalizedFullName() const
Gets the normalized full name, which consists of both scope and name and with surrounding underscores...
Syntax
The style used to specify an attribute.
@ AS_Keyword
__ptr16, alignas(...), etc.
@ AS_Declspec
__declspec(...)
@ AS_ContextSensitiveKeyword
Context-sensitive version of a keyword attribute.
@ AS_HLSLSemantic
<vardecl> : <semantic>
@ AS_Microsoft
[uuid("...")] class Foo
bool isCXX11Attribute() const
bool isDeclspecAttribute() const
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Kind AttrKind, Syntax SyntaxUsed)
SourceRange getRange() const
void setRange(SourceRange R)
AttributeCommonInfo(SourceRange AttrRange)
unsigned getAttributeSpellingListIndex() const
bool isC2xAttribute() const
const IdentifierInfo * getScopeName() const
bool isContextSensitiveKeywordAttribute() const
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Kind AttrKind, Syntax SyntaxUsed, unsigned Spelling)
AttributeCommonInfo(AttributeCommonInfo &&)=default
bool isGNUAttribute() const
AttributeCommonInfo(const IdentifierInfo *AttrName, SourceRange AttrRange, Syntax SyntaxUsed)
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Syntax SyntaxUsed)
AttributeCommonInfo(SourceRange AttrRange, Kind K, Syntax SyntaxUsed)
AttributeCommonInfo(SourceLocation AttrLoc)
bool isKeywordAttribute() const
SourceLocation getLoc() const
const IdentifierInfo * getAttrName() const
AttributeCommonInfo(const AttributeCommonInfo &)=default
static constexpr unsigned SpellingNotCalculated
bool isStandardAttributeSyntax() const
The attribute is spelled [[]] in either C or C++ mode, including standard attributes spelled with a k...
Kind getParsedKind() const
bool isAlignasAttribute() const
AttributeCommonInfo(SourceRange AttrRange, Kind K, Syntax SyntaxUsed, unsigned Spelling)
One of these records is kept for each identifier that is lexed.
Scope - A scope is a transient data structure that is used while parsing the program.
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getBegin() const