14 #ifndef LLVM_CLANG_AST_ATTR_H
15 #define LLVM_CLANG_AST_ATTR_H
27 #include "llvm/ADT/SmallVector.h"
28 #include "llvm/ADT/StringRef.h"
29 #include "llvm/ADT/StringSwitch.h"
30 #include "llvm/Support/ErrorHandling.h"
31 #include "llvm/Support/raw_ostream.h"
38 class ObjCInterfaceDecl;
48 unsigned AttrKind : 16;
60 void *
operator new(
size_t bytes) LLVM_NOEXCEPT {
61 llvm_unreachable(
"Attrs cannot be allocated with regular 'new'.");
63 void operator delete(
void *data) LLVM_NOEXCEPT {
64 llvm_unreachable(
"Attrs cannot be released with regular 'delete'.");
70 size_t Alignment = 8) LLVM_NOEXCEPT {
71 return ::operator
new(Bytes, C, Alignment);
74 size_t Alignment) LLVM_NOEXCEPT {
75 return ::operator
delete(Ptr, C, Alignment);
81 : Range(R), AttrKind(AK), SpellingListIndex(SpellingListIndex),
83 IsLateParsed(IsLateParsed), DuplicatesAllowed(DuplicatesAllowed) {}
126 :
Attr(AK, R, SpellingListIndex, IsLateParsed, DuplicatesAllowed) {}
130 return A->
getKind() >= attr::FirstStmtAttr &&
131 A->
getKind() <= attr::LastStmtAttr;
139 :
Attr(AK, R, SpellingListIndex, IsLateParsed, DuplicatesAllowed) {}
146 return A->
getKind() >= attr::FirstInheritableAttr &&
147 A->
getKind() <= attr::LastInheritableAttr;
156 DuplicatesAllowed) {}
161 return A->
getKind() >= attr::FirstInheritableParamAttr &&
162 A->
getKind() <= attr::LastInheritableParamAttr;
174 DuplicatesAllowed) {}
179 case attr::SwiftContext:
181 case attr::SwiftErrorResult:
183 case attr::SwiftIndirectResult:
186 llvm_unreachable(
"bad parameter ABI attribute kind");
191 return A->
getKind() >= attr::FirstParameterABIAttr &&
192 A->
getKind() <= attr::LastParameterABIAttr;
196 #include "clang/AST/Attrs.inc"
C Language Family Type Representation.
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
static bool classof(const Attr *A)
void printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const
Describes how types, statements, expressions, and declarations should be printed. ...
static StringRef bytes(const std::vector< T, Allocator > &v)
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
Defines the clang::SanitizerKind enum.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Defines the clang::attr::Kind enum.
Defines some OpenMP-specific enums and functions.
InheritableParamAttr(attr::Kind AK, SourceRange R, unsigned SpellingListIndex, bool IsLateParsed, bool DuplicatesAllowed)
This parameter (which must have pointer type) uses the special Swift context-pointer ABI treatment...
void setRange(SourceRange R)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Attr(attr::Kind AK, SourceRange R, unsigned SpellingListIndex, bool IsLateParsed, bool DuplicatesAllowed)
static bool classof(const Attr *A)
SourceLocation getLocation() const
detail::InMemoryDirectory::const_iterator I
This parameter (which must have pointer-to-pointer type) uses the special Swift error-result ABI trea...
A little helper class used to produce diagnostics.
static bool classof(const Attr *A)
SourceRange getRange() const
unsigned DuplicatesAllowed
unsigned getSpellingListIndex() const
A parameter attribute which changes the argument-passing ABI rule for the parameter.
const char * getSpelling() const
ParameterABI getABI() const
Encodes a location in the source.
void setPackExpansion(bool PE)
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
bool isLateParsed() const
SourceLocation getBegin() const
Attr * clone(ASTContext &C) const
ParameterABI
Kinds of parameter ABI.
attr::Kind getKind() const
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user...
unsigned SpellingListIndex
An index into the spelling list of an attribute defined in Attr.td file.
void setInherited(bool I)
static bool classof(const Attr *A)
Defines the clang::SourceLocation class and associated facilities.
InheritableAttr(attr::Kind AK, SourceRange R, unsigned SpellingListIndex, bool IsLateParsed, bool DuplicatesAllowed)
bool duplicatesAllowed() const
By default, attributes cannot be duplicated when being merged; however, an attribute can override thi...
StmtAttr(attr::Kind AK, SourceRange R, unsigned SpellingListIndex, bool IsLateParsed, bool DuplicatesAllowed)
Defines the clang::VersionTuple class, which represents a version in the form major[.minor[.subminor]].
ParameterABIAttr(attr::Kind AK, SourceRange R, unsigned SpellingListIndex, bool IsLateParsed, bool DuplicatesAllowed)
A trivial tuple used to represent a source range.
bool isPackExpansion() const
Attr - This represents one attribute.
This parameter (which must have pointer type) is a Swift indirect result parameter.