14#ifndef LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
15#define LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
63#define PARSED_ATTR(NAME) AT_##NAME,
64#include "clang/Basic/AttrParsedAttrList.inc"
83 LLVM_PREFERRED_TYPE(
Kind)
84 unsigned AttrKind : 16;
86 LLVM_PREFERRED_TYPE(
Syntax)
87 unsigned SyntaxUsed : 4;
88 LLVM_PREFERRED_TYPE(
bool)
89 unsigned SpellingIndex : 4;
90 LLVM_PREFERRED_TYPE(
bool)
91 unsigned IsAlignas : 1;
92 LLVM_PREFERRED_TYPE(
bool)
93 unsigned IsRegularKeywordAttribute : 1;
103 constexpr Form(
Syntax SyntaxUsed,
unsigned SpellingIndex,
bool IsAlignas,
104 bool IsRegularKeywordAttribute)
105 : SyntaxUsed(SyntaxUsed), SpellingIndex(SpellingIndex),
106 IsAlignas(IsAlignas),
107 IsRegularKeywordAttribute(IsRegularKeywordAttribute) {}
110 IsAlignas(Tok == tok::kw_alignas),
123 static Form Keyword(
bool IsAlignas,
bool IsRegularKeywordAttribute) {
125 IsRegularKeywordAttribute);
135 IsAlignas(0), IsRegularKeywordAttribute(0) {}
137 LLVM_PREFERRED_TYPE(
Syntax)
138 unsigned SyntaxUsed : 4;
139 unsigned SpellingIndex : 4;
140 LLVM_PREFERRED_TYPE(
bool)
141 unsigned IsAlignas : 1;
142 LLVM_PREFERRED_TYPE(
bool)
143 unsigned IsRegularKeywordAttribute : 1;
149 : AttrName(AttrName), ScopeName(ScopeName), AttrRange(AttrRange),
150 ScopeLoc(ScopeLoc), AttrKind(AttrKind),
152 SpellingIndex(FormUsed.getSpellingIndex()),
163 AttrName, ScopeName, AttrRange, ScopeLoc,
183 IsRegularKeywordAttribute);
239 "Spelling cannot be found");
242 : calculateAttributeSpellingListIndex();
255 unsigned calculateAttributeSpellingListIndex()
const;
259 unsigned getAttributeSpellingListIndexRaw()
const {
return SpellingIndex; }
271#define KEYWORD_ATTRIBUTE(NAME, HASARG, ...) \
272 case tok::kw_##NAME: \
274#include "clang/Basic/RegularKeywordAttrInfo.inc"
275#undef KEYWORD_ATTRIBUTE
enum clang::sema::@1727::IndirectLocalPathEntry::EntryKind Kind
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_HLSLAnnotation
<vardecl> : <annotation>
@ 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
bool isC23Attribute() const
void setRange(SourceRange R)
void setAttrName(const IdentifierInfo *AttrNameII)
unsigned getAttributeSpellingListIndex() const
const IdentifierInfo * getScopeName() const
bool isContextSensitiveKeywordAttribute() const
AttributeCommonInfo(AttributeCommonInfo &&)=default
static AttrArgsInfo getCXX11AttrArgsInfo(const IdentifierInfo *Name)
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.
The JSON file list parser is used to communicate input to InstallAPI.
bool doesKeywordAttributeTakeArgs(tok::TokenKind Kind)