14#ifndef LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
15#define LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
63#define PARSED_ATTR(NAME) AT_##NAME,
64#include "clang/Sema/AttrParsedAttrList.inc"
77 LLVM_PREFERRED_TYPE(
Kind)
78 unsigned AttrKind : 16;
80 LLVM_PREFERRED_TYPE(
Syntax)
81 unsigned SyntaxUsed : 4;
82 LLVM_PREFERRED_TYPE(
bool)
83 unsigned SpellingIndex : 4;
84 LLVM_PREFERRED_TYPE(
bool)
85 unsigned IsAlignas : 1;
86 LLVM_PREFERRED_TYPE(
bool)
87 unsigned IsRegularKeywordAttribute : 1;
97 constexpr Form(
Syntax SyntaxUsed,
unsigned SpellingIndex,
bool IsAlignas,
98 bool IsRegularKeywordAttribute)
99 : SyntaxUsed(SyntaxUsed), SpellingIndex(SpellingIndex),
100 IsAlignas(IsAlignas),
101 IsRegularKeywordAttribute(IsRegularKeywordAttribute) {}
104 IsAlignas(Tok == tok::kw_alignas),
117 static Form Keyword(
bool IsAlignas,
bool IsRegularKeywordAttribute) {
119 IsRegularKeywordAttribute);
129 IsAlignas(0), IsRegularKeywordAttribute(0) {}
131 LLVM_PREFERRED_TYPE(
Syntax)
132 unsigned SyntaxUsed : 4;
133 unsigned SpellingIndex : 4;
134 LLVM_PREFERRED_TYPE(
bool)
135 unsigned IsAlignas : 1;
136 LLVM_PREFERRED_TYPE(
bool)
137 unsigned IsRegularKeywordAttribute : 1;
143 : AttrName(AttrName), ScopeName(ScopeName), AttrRange(AttrRange),
144 ScopeLoc(ScopeLoc), AttrKind(AttrKind),
146 SpellingIndex(FormUsed.getSpellingIndex()),
157 AttrName, ScopeName, AttrRange, ScopeLoc,
177 IsRegularKeywordAttribute);
233 "Spelling cannot be found");
236 : calculateAttributeSpellingListIndex();
247 unsigned calculateAttributeSpellingListIndex()
const;
251 unsigned getAttributeSpellingListIndexRaw()
const {
return SpellingIndex; }
263#define KEYWORD_ATTRIBUTE(NAME, HASARG, ...) \
264 case tok::kw_##NAME: \
266#include "clang/Basic/RegularKeywordAttrInfo.inc"
267#undef KEYWORD_ATTRIBUTE
enum clang::sema::@1656::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
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)