14#ifndef LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
15#define LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
61#define PARSED_ATTR(NAME) AT_##NAME,
62#include "clang/Sema/AttrParsedAttrList.inc"
75 unsigned AttrKind : 16;
77 unsigned SyntaxUsed : 4;
78 unsigned SpellingIndex : 4;
79 unsigned IsAlignas : 1;
80 unsigned IsRegularKeywordAttribute : 1;
90 constexpr Form(
Syntax SyntaxUsed,
unsigned SpellingIndex,
bool IsAlignas,
91 bool IsRegularKeywordAttribute)
92 : SyntaxUsed(SyntaxUsed), SpellingIndex(SpellingIndex),
94 IsRegularKeywordAttribute(IsRegularKeywordAttribute) {}
97 IsAlignas(Tok == tok::kw_alignas),
110 static Form Keyword(
bool IsAlignas,
bool IsRegularKeywordAttribute) {
112 IsRegularKeywordAttribute);
122 IsAlignas(0), IsRegularKeywordAttribute(0) {}
124 unsigned SyntaxUsed : 4;
125 unsigned SpellingIndex : 4;
126 unsigned IsAlignas : 1;
127 unsigned IsRegularKeywordAttribute : 1;
133 : AttrName(AttrName), ScopeName(ScopeName), AttrRange(AttrRange),
134 ScopeLoc(ScopeLoc), AttrKind(AttrKind),
136 SpellingIndex(FormUsed.getSpellingIndex()),
137 IsAlignas(FormUsed.isAlignas()),
147 AttrName, ScopeName, AttrRange, ScopeLoc,
167 IsRegularKeywordAttribute);
213 "Spelling cannot be found");
216 : calculateAttributeSpellingListIndex();
227 unsigned calculateAttributeSpellingListIndex()
const;
231 unsigned getAttributeSpellingListIndexRaw()
const {
return SpellingIndex; }
Defines the clang::SourceLocation class and associated facilities.
Defines the clang::TokenKind enum and support functions.
An object for streaming information to a record.
SourceLocation getScopeLoc() const
bool isAttributeSpellingListCalculated() const
AttributeCommonInfo(const IdentifierInfo *AttrName, SourceRange AttrRange, Form FormUsed)
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_Implicit
The attibute has no source code manifestation and is only created implicitly.
@ AS_Microsoft
[uuid("...")] class Foo
AttributeCommonInfo(SourceRange AttrRange, Kind K, Form FormUsed)
bool isCXX11Attribute() const
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Kind AttrKind, Form FormUsed)
bool isDeclspecAttribute() const
SourceRange getRange() const
void setRange(SourceRange R)
unsigned getAttributeSpellingListIndex() const
bool isC2xAttribute() const
const IdentifierInfo * getScopeName() const
bool isContextSensitiveKeywordAttribute() const
AttributeCommonInfo(AttributeCommonInfo &&)=default
bool isGNUAttribute() const
bool isRegularKeywordAttribute() const
bool isKeywordAttribute() const
SourceLocation getLoc() const
const IdentifierInfo * getAttrName() const
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Form FormUsed)
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
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
TokenKind
Provides a simple uniform namespace for tokens from all C languages.