23 #include "llvm/ADT/SmallString.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;
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" 119 if (IsGNU && AttrName.size() >= 4 && AttrName.startswith(
"__") &&
120 AttrName.endswith(
"__"))
121 AttrName = AttrName.slice(2, AttrName.size() - 2);
129 StringRef AttrName = Name->
getName();
133 FullName += ScopeName->
getName();
139 if (ScopeName || SyntaxUsed == AS_CXX11 || SyntaxUsed == AS_C2x)
141 FullName += AttrName;
143 return ::getAttrKind(FullName, SyntaxUsed);
149 StringRef
Scope = ScopeName ? ScopeName->getName() :
"";
153 #include "clang/Sema/AttrSpellingListIndex.inc" 172 void (*GetPragmaAttributeMatchRules)(
178 #include "clang/Sema/AttrParsedAttrImpl.inc" 182 return AttrInfoMap[A.
getKind()];
203 return checkAttributeMatchRuleAppliesTo(D, MatchRule);
Defines the clang::ASTContext interface.
bool appliesToDecl(const Decl *D, attr::SubjectMatchRule MatchRule) const
bool hasCustomParsing() const
bool(* DiagAppertainsToDecl)(Sema &S, const AttributeList &Attr, const Decl *)
bool isSupportedByPragmaAttribute() const
Decl - This represents one declaration (or definition), e.g.
Defines the C++ template declaration subclasses.
static IdentifierLoc * create(ASTContext &Ctx, SourceLocation Loc, IdentifierInfo *Ident)
bool(* ExistsInTarget)(const TargetInfo &Target)
One of these records is kept for each identifier that is lexed.
SubjectMatchRule
A list of all the recognized kinds of attributes.
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 ...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
static const ParsedAttrInfo & getInfo(const AttributeList &A)
void getMatchRules(const LangOptions &LangOpts, SmallVectorImpl< std::pair< attr::SubjectMatchRule, bool >> &MatchRules) const
Scope - A scope is a transient data structure that is used while parsing the program.
unsigned getAttributeSpellingListIndex() const
Get an index into the attribute spelling list defined in Attr.td.
bool diagnoseAppertainsTo(class Sema &S, const Decl *D) const
Sema - This implements semantic analysis and AST building for C.
Exposes information about the current target.
unsigned HasCustomParsing
unsigned(* SpellingIndexToSemanticSpelling)(const AttributeList &Attr)
unsigned IsSupportedByPragmaAttribute
bool isKnownToGCC() const
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
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 getSemanticSpelling() const
If the parsed attribute has a semantic equivalent, and it would have a semantic Spelling enumeration ...
bool(* DiagLangOpts)(Sema &S, const AttributeList &Attr)
Encodes a location in the source.
bool hasVariadicArg() const
StringRef getName() const
Return the actual identifier string.
Dataflow Directional Tag Classes.
unsigned IsTargetSpecific
bool diagnoseLangOpts(class Sema &S) const
bool isTargetSpecificAttr() const
void(* GetPragmaAttributeMatchRules)(llvm::SmallVectorImpl< std::pair< attr::SubjectMatchRule, bool >> &Rules, const LangOptions &LangOpts)
Syntax
The style used to specify an attribute.
static StringRef normalizeAttrName(StringRef AttrName, StringRef ScopeName, AttributeList::Syntax SyntaxUsed)
unsigned getMaxArgs() const
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
The required allocation size of an availability attribute, which we want to ensure is a multiple of s...
A factory, from which one makes pools, from which one creates individual attributes which are dealloc...
unsigned getMinArgs() const
Defines the clang::TargetInfo interface.
static size_t getFreeListIndexForSize(size_t size)
Attr - This represents one attribute.
AttributeList - Represents a syntactic attribute.