14 #ifndef LLVM_CLANG_AST_ATTR_H
15 #define LLVM_CLANG_AST_ATTR_H
26 #include "llvm/ADT/SmallVector.h"
27 #include "llvm/ADT/StringRef.h"
28 #include "llvm/ADT/StringSwitch.h"
29 #include "llvm/Support/ErrorHandling.h"
30 #include "llvm/Support/raw_ostream.h"
37 class ObjCInterfaceDecl;
47 unsigned AttrKind : 16;
59 void*
operator new(
size_t bytes)
throw() {
60 llvm_unreachable(
"Attrs cannot be allocated with regular 'new'.");
62 void operator delete(
void* data)
throw() {
63 llvm_unreachable(
"Attrs cannot be released with regular 'delete'.");
69 size_t Alignment = 8)
throw() {
70 return ::operator
new(Bytes,
C, Alignment);
73 size_t Alignment)
throw() {
74 return ::operator
delete(Ptr,
C, Alignment);
80 : Range(R), AttrKind(AK), SpellingListIndex(SpellingListIndex),
82 IsLateParsed(IsLateParsed), DuplicatesAllowed(DuplicatesAllowed) {}
125 :
Attr(AK, R, SpellingListIndex, IsLateParsed, DuplicatesAllowed) {}
132 return A->
getKind() <= attr::LAST_INHERITABLE;
141 DuplicatesAllowed) {}
148 return A->
getKind() <= attr::LAST_INHERITABLE_PARAM;
152 #include "clang/AST/Attrs.inc"
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
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.
InheritableParamAttr(attr::Kind AK, SourceRange R, unsigned SpellingListIndex, bool IsLateParsed, bool DuplicatesAllowed)
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)
SourceLocation getLocation() const
A little helper class used to produce diagnostics.
static bool classof(const Attr *A)
SourceRange getRange() const
unsigned getSpellingListIndex() const
const char * getSpelling() const
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
void setPackExpansion(bool PE)
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
bool isLateParsed() const
SourceLocation getBegin() const
Attr * clone(ASTContext &C) const
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
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...
Defines the clang::VersionTuple class, which represents a version in the form major[.minor[.subminor]].
A trivial tuple used to represent a source range.
bool isPackExpansion() const
Attr - This represents one attribute.