22 #include "llvm/ADT/SmallString.h"
23 #include "llvm/ADT/StringSwitch.h"
24 using namespace clang;
34 size_t AttributeList::allocated_size()
const {
36 else if (IsTypeTagForDatatype)
45 FreeLists.resize(InlineFreeListsCapacity);
51 assert((size %
sizeof(
void*)) == 0);
55 void *AttributeFactory::allocate(
size_t size) {
58 if (index < FreeLists.size()) {
60 FreeLists[index] = attr->NextInPool;
66 return Alloc.Allocate(size, llvm::AlignOf<AttributeFactory>::Alignment);
70 assert(cur &&
"reclaiming empty pool!");
76 size_t size = cur->allocated_size();
80 if (freeListIndex >= FreeLists.size())
81 FreeLists.resize(freeListIndex+1);
84 cur->NextInPool = FreeLists[freeListIndex];
85 FreeLists[freeListIndex] = cur;
104 pool->NextInPool = Head;
110 #include "clang/Sema/AttrParsedAttrKinds.inc"
118 if (IsGNU && AttrName.size() >= 4 && AttrName.startswith(
"__") &&
119 AttrName.endswith(
"__"))
120 AttrName = AttrName.slice(2, AttrName.size() - 2);
128 StringRef AttrName = Name->
getName();
132 FullName += ScopeName->
getName();
138 if (ScopeName || SyntaxUsed ==
AS_CXX11)
140 FullName += AttrName;
142 return ::getAttrKind(FullName, SyntaxUsed);
148 StringRef
Scope = ScopeName ? ScopeName->
getName() :
"";
152 #include "clang/Sema/AttrSpellingListIndex.inc"
158 unsigned OptArgs : 4;
159 unsigned HasCustomParsing : 1;
160 unsigned IsTargetSpecific : 1;
163 unsigned IsKnownToGCC : 1;
173 #include "clang/Sema/AttrParsedAttrImpl.inc"
177 return AttrInfoMap[A.
getKind()];
Defines the clang::ASTContext interface.
bool diagnoseAppertainsTo(class Sema &S, const Decl *D) const
unsigned getSemanticSpelling() const
If the parsed attribute has a semantic equivalent, and it would have a semantic Spelling enumeration ...
Defines the C++ template declaration subclasses.
static IdentifierLoc * create(ASTContext &Ctx, SourceLocation Loc, IdentifierInfo *Ident)
bool hasCustomParsing() const
bool(* ExistsInTarget)(const TargetInfo &Target)
bool(* DiagLangOpts)(Sema &S, const AttributeList &Attr)
One of these records is kept for each identifier that is lexed.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
llvm::PointerUnion< Expr *, IdentifierLoc * > ArgsUnion
A union of the various pointer types that can be passed to an AttributeList as an argument...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
bool hasVariadicArg() const
unsigned(* SpellingIndexToSemanticSpelling)(const AttributeList &Attr)
static const ParsedAttrInfo & getInfo(const AttributeList &A)
bool(* DiagAppertainsToDecl)(Sema &S, const AttributeList &Attr, const Decl *)
Scope - A scope is a transient data structure that is used while parsing the program.
Sema - This implements semantic analysis and AST building for C.
Exposes information about the current target.
StringRef getName() const
Return the actual identifier string.
unsigned HasCustomParsing
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
bool existsInTarget(const TargetInfo &Target) const
Wraps an identifier and optional source location for the identifier.
The result type of a method or function.
unsigned getAttributeSpellingListIndex() const
Get an index into the attribute spelling list defined in Attr.td.
Encodes a location in the source.
The required allocation size of an availability attribute, which we want to ensure is a multiple of s...
unsigned getMinArgs() const
bool diagnoseLangOpts(class Sema &S) const
unsigned IsTargetSpecific
Syntax
The style used to specify an attribute.
bool isKnownToGCC() const
unsigned getMaxArgs() const
static StringRef normalizeAttrName(StringRef AttrName, StringRef ScopeName, AttributeList::Syntax SyntaxUsed)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
bool isTargetSpecificAttr() const
Defines the clang::TargetInfo interface.
static size_t getFreeListIndexForSize(size_t size)
Attr - This represents one attribute.
AttributeList - Represents a syntactic attribute.