19 #include "llvm/ADT/SmallString.h" 20 #include "llvm/ADT/SmallVector.h" 21 #include "llvm/ADT/StringRef.h" 26 using namespace clang;
36 size_t ParsedAttr::allocated_size()
const {
38 else if (IsTypeTagForDatatype)
42 else if (HasParsedType)
46 return totalSizeToAlloc<
ArgsUnion, detail::AvailabilityData,
48 detail::PropertyData>(NumArgs, 0, 0, 0, 0);
53 FreeLists.resize(InlineFreeListsCapacity);
59 assert((size %
sizeof(
void*)) == 0);
60 return ((size -
sizeof(
ParsedAttr)) /
sizeof(
void *));
63 void *AttributeFactory::allocate(
size_t size) {
66 if (index < FreeLists.size() && !FreeLists[index].empty()) {
68 FreeLists[index].pop_back();
77 size_t size = Attr->allocated_size();
81 if (freeListIndex >= FreeLists.size())
82 FreeLists.resize(freeListIndex + 1);
90 FreeLists[freeListIndex].push_back(Attr);
99 Attrs.insert(Attrs.end(), pool.Attrs.begin(), pool.Attrs.end());
116 unsigned (*SpellingIndexToSemanticSpelling)(
const ParsedAttr &Attr);
117 void (*GetPragmaAttributeMatchRules)(
124 #include "clang/Sema/AttrParsedAttrImpl.inc" 129 return AttrInfoMap[A.
getKind()];
148 return checkAttributeMatchRuleAppliesTo(D, MatchRule);
Defines the clang::ASTContext interface.
bool diagnoseAppertainsTo(class Sema &S, const Decl *D) const
static size_t getFreeListIndexForSize(size_t size)
llvm::PointerUnion< Expr *, IdentifierLoc * > ArgsUnion
A union of the various pointer types that can be passed to an ParsedAttr as an argument.
Decl - This represents one declaration (or definition), e.g.
static IdentifierLoc * create(ASTContext &Ctx, SourceLocation Loc, IdentifierInfo *Ident)
bool(* DiagLangOpts)(Sema &S, const ParsedAttr &Attr)
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.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
void getMatchRules(const LangOptions &LangOpts, SmallVectorImpl< std::pair< attr::SubjectMatchRule, bool >> &MatchRules) const
bool isKnownToGCC() const
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
AttributeCommonInfo::Kind getKind() const
bool existsInTarget(const TargetInfo &Target) const
unsigned getMinArgs() const
bool hasVariadicArg() const
__DEVICE__ void * memset(void *__a, int __b, size_t __c)
bool(* DiagAppertainsToDecl)(Sema &S, const ParsedAttr &Attr, const Decl *)
bool isTargetSpecificAttr() const
bool hasCustomParsing() const
Sema - This implements semantic analysis and AST building for C.
Exposes information about the current target.
unsigned HasCustomParsing
unsigned IsSupportedByPragmaAttribute
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
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 ...
Encodes a location in the source.
ParsedAttr - Represents a syntactic attribute.
bool diagnoseLangOpts(class Sema &S) const
Describes the trailing object for Availability attribute in ParsedAttr.
Dataflow Directional Tag Classes.
unsigned IsTargetSpecific
void(* GetPragmaAttributeMatchRules)(llvm::SmallVectorImpl< std::pair< attr::SubjectMatchRule, bool >> &Rules, const LangOptions &LangOpts)
static const ParsedAttrInfo & getInfo(const ParsedAttr &A)
unsigned getMaxArgs() const
A factory, from which one makes pools, from which one creates individual attributes which are dealloc...
bool appliesToDecl(const Decl *D, attr::SubjectMatchRule MatchRule) const
unsigned(* SpellingIndexToSemanticSpelling)(const ParsedAttr &Attr)
Defines the clang::TargetInfo interface.
bool isSupportedByPragmaAttribute() const
Attr - This represents one attribute.