14#ifndef LLVM_CLANG_SEMA_PARSEDATTR_H
15#define LLVM_CLANG_SEMA_PARSEDATTR_H
23#include "llvm/ADT/PointerUnion.h"
24#include "llvm/ADT/SmallVector.h"
25#include "llvm/Support/Allocator.h"
26#include "llvm/Support/VersionTuple.h"
88 LLVM_PREFERRED_TYPE(
bool)
90 LLVM_PREFERRED_TYPE(
bool)
97 : GetterId(getterId), SetterId(setterId) {}
113using ArgsUnion = llvm::PointerUnion<Expr *, IdentifierLoc *>;
127 private llvm::TrailingObjects<
128 ParsedAttr, ArgsUnion, detail::AvailabilityData,
129 detail::TypeTagForDatatypeData, ParsedType, detail::PropertyData> {
130 friend TrailingObjects;
132 size_t numTrailingObjects(OverloadToken<ArgsUnion>)
const {
return NumArgs; }
133 size_t numTrailingObjects(OverloadToken<detail::AvailabilityData>)
const {
134 return IsAvailability;
137 numTrailingObjects(OverloadToken<detail::TypeTagForDatatypeData>)
const {
138 return IsTypeTagForDatatype;
140 size_t numTrailingObjects(OverloadToken<ParsedType>)
const {
141 return HasParsedType;
143 size_t numTrailingObjects(OverloadToken<detail::PropertyData>)
const {
154 unsigned NumArgs : 16;
157 LLVM_PREFERRED_TYPE(
bool)
158 mutable unsigned Invalid : 1;
161 LLVM_PREFERRED_TYPE(
bool)
162 mutable unsigned UsedAsTypeAttr : 1;
166 LLVM_PREFERRED_TYPE(
bool)
167 unsigned IsAvailability : 1;
171 LLVM_PREFERRED_TYPE(
bool)
172 unsigned IsTypeTagForDatatype : 1;
176 LLVM_PREFERRED_TYPE(
bool)
177 unsigned IsProperty : 1;
180 LLVM_PREFERRED_TYPE(
bool)
181 unsigned HasParsedType : 1;
184 LLVM_PREFERRED_TYPE(
bool)
185 mutable unsigned HasProcessingCache : 1;
188 mutable unsigned ProcessingCache : 8;
191 LLVM_PREFERRED_TYPE(
bool)
192 mutable unsigned IsPragmaClangAttribute : 1;
198 const Expr *MessageExpr;
202 ArgsUnion *getArgsBuffer() {
return getTrailingObjects<ArgsUnion>(); }
204 return getTrailingObjects<ArgsUnion>();
208 return getTrailingObjects<detail::AvailabilityData>();
211 return getTrailingObjects<detail::AvailabilityData>();
224 EllipsisLoc(ellipsisLoc), NumArgs(numArgs), Invalid(
false),
227 HasProcessingCache(
false), IsPragmaClangAttribute(
false),
242 NumArgs(1), Invalid(
false), UsedAsTypeAttr(
false), IsAvailability(
true),
244 HasProcessingCache(
false), IsPragmaClangAttribute(
false),
245 UnavailableLoc(unavailable), MessageExpr(messageExpr),
249 new (getAvailabilityData())
251 replacementExpr, environmentLoc);
255 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
256 IdentifierInfo *scopeName, SourceLocation scopeLoc,
257 IdentifierLoc *Parm1, IdentifierLoc *Parm2, IdentifierLoc *Parm3,
259 : AttributeCommonInfo(attrName, scopeName, attrRange, scopeLoc, formUsed),
260 NumArgs(3), Invalid(
false), UsedAsTypeAttr(
false),
262 HasParsedType(
false), HasProcessingCache(
false),
263 IsPragmaClangAttribute(
false), Info(ParsedAttrInfo::get(*this)) {
264 ArgsUnion *Args = getArgsBuffer();
271 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
272 IdentifierInfo *scopeName, SourceLocation scopeLoc,
273 IdentifierLoc *ArgKind, ParsedType matchingCType,
274 bool layoutCompatible,
bool mustBeNull, Form formUsed)
275 : AttributeCommonInfo(attrName, scopeName, attrRange, scopeLoc, formUsed),
277 IsAvailability(
false), IsTypeTagForDatatype(
true), IsProperty(
false),
278 HasParsedType(
false), HasProcessingCache(
false),
279 IsPragmaClangAttribute(
false), Info(ParsedAttrInfo::get(*this)) {
281 memcpy(getArgsBuffer(), &PVal,
sizeof(ArgsUnion));
282 detail::TypeTagForDatatypeData &ExtraData = getTypeTagForDatatypeDataSlot();
283 new (&ExtraData.MatchingCType)
ParsedType(matchingCType);
284 ExtraData.LayoutCompatible = layoutCompatible;
285 ExtraData.MustBeNull = mustBeNull;
289 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
290 IdentifierInfo *scopeName, SourceLocation scopeLoc,
291 ParsedType typeArg, Form formUsed, SourceLocation ellipsisLoc)
292 : AttributeCommonInfo(attrName, scopeName, attrRange, scopeLoc, formUsed),
295 IsTypeTagForDatatype(
false), IsProperty(
false), HasParsedType(
true),
296 HasProcessingCache(
false), IsPragmaClangAttribute(
false),
297 Info(ParsedAttrInfo::get(*this)) {
302 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
303 IdentifierInfo *scopeName, SourceLocation scopeLoc,
304 IdentifierInfo *getterId, IdentifierInfo *setterId, Form formUsed)
305 : AttributeCommonInfo(attrName, scopeName, attrRange, scopeLoc, formUsed),
307 IsAvailability(
false), IsTypeTagForDatatype(
false), IsProperty(
true),
308 HasParsedType(
false), HasProcessingCache(
false),
309 IsPragmaClangAttribute(
false), Info(ParsedAttrInfo::get(*this)) {
310 new (&getPropertyDataBuffer()) detail::PropertyData(getterId, setterId);
316 detail::TypeTagForDatatypeData &getTypeTagForDatatypeDataSlot() {
317 return *getTrailingObjects<detail::TypeTagForDatatypeData>();
319 const detail::TypeTagForDatatypeData &getTypeTagForDatatypeDataSlot()
const {
320 return *getTrailingObjects<detail::TypeTagForDatatypeData>();
325 ParsedType &getTypeBuffer() {
return *getTrailingObjects<ParsedType>(); }
327 return *getTrailingObjects<ParsedType>();
332 detail::PropertyData &getPropertyDataBuffer() {
334 return *getTrailingObjects<detail::PropertyData>();
336 const detail::PropertyData &getPropertyDataBuffer()
const {
338 return *getTrailingObjects<detail::PropertyData>();
341 size_t allocated_size()
const;
350 void operator delete(
void *) =
delete;
365 assert(hasProcessingCache());
366 return ProcessingCache;
370 ProcessingCache = value;
371 HasProcessingCache =
true;
390 assert(Arg < NumArgs &&
"Arg access out of range!");
391 return getArgsBuffer()[Arg];
395 return Arg < NumArgs && isa<Expr *>(getArg(Arg));
401 return Arg < NumArgs && isa<IdentifierLoc *>(getArg(Arg));
405 return cast<IdentifierLoc *>(getArg(Arg));
409 assert(getParsedKind() == AT_Availability &&
410 "Not an availability attribute");
411 return getAvailabilityData()->Changes[detail::IntroducedSlot];
415 assert(getParsedKind() == AT_Availability &&
416 "Not an availability attribute");
417 return getAvailabilityData()->Changes[detail::DeprecatedSlot];
421 assert(getParsedKind() == AT_Availability &&
422 "Not an availability attribute");
423 return getAvailabilityData()->Changes[detail::ObsoletedSlot];
427 assert(getParsedKind() == AT_Availability &&
428 "Not an availability attribute");
429 return getAvailabilityData()->StrictLoc;
433 assert(getParsedKind() == AT_Availability &&
434 "Not an availability attribute");
435 return UnavailableLoc;
439 assert(getParsedKind() == AT_Availability &&
440 "Not an availability attribute");
445 assert(getParsedKind() == AT_Availability &&
446 "Not an availability attribute");
447 return getAvailabilityData()->Replacement;
451 assert(getParsedKind() == AT_Availability &&
452 "Not an availability attribute");
453 return getAvailabilityData()->EnvironmentLoc;
457 assert(getParsedKind() == AT_TypeTagForDatatype &&
458 "Not a type_tag_for_datatype attribute");
459 return getTypeTagForDatatypeDataSlot().MatchingCType;
463 assert(getParsedKind() == AT_TypeTagForDatatype &&
464 "Not a type_tag_for_datatype attribute");
465 return getTypeTagForDatatypeDataSlot().LayoutCompatible;
469 assert(getParsedKind() == AT_TypeTagForDatatype &&
470 "Not a type_tag_for_datatype attribute");
471 return getTypeTagForDatatypeDataSlot().MustBeNull;
475 assert(HasParsedType &&
"Not a type attribute");
476 return getTypeBuffer();
480 assert(isDeclspecPropertyAttribute() &&
481 "Not a __delcspec(property) attribute");
482 return getPropertyDataBuffer().GetterId;
486 assert(isDeclspecPropertyAttribute() &&
487 "Not a __delcspec(property) attribute");
488 return getPropertyDataBuffer().SetterId;
496 MacroExpansionLoc =
Loc;
507 assert(hasMacroIdentifier() &&
"Can only get the macro expansion location "
508 "if this attribute has a macro identifier.");
509 return MacroExpansionLoc;
514 bool checkExactlyNumArgs(
class Sema &S,
unsigned Num)
const;
517 bool checkAtLeastNumArgs(
class Sema &S,
unsigned Num)
const;
520 bool checkAtMostNumArgs(
class Sema &S,
unsigned Num)
const;
522 bool isTargetSpecificAttr()
const;
523 bool isTypeAttr()
const;
524 bool isStmtAttr()
const;
526 bool hasCustomParsing()
const;
527 bool acceptsExprPack()
const;
528 bool isParamExpr(
size_t N)
const;
529 unsigned getMinArgs()
const;
530 unsigned getMaxArgs()
const;
531 unsigned getNumArgMembers()
const;
532 bool hasVariadicArg()
const;
533 void handleAttrWithDelayedArgs(
Sema &S,
Decl *
D)
const;
534 bool diagnoseAppertainsTo(
class Sema &S,
const Decl *
D)
const;
535 bool diagnoseAppertainsTo(
class Sema &S,
const Stmt *St)
const;
536 bool diagnoseMutualExclusion(
class Sema &S,
const Decl *
D)
const;
547 bool diagnoseLangOpts(
class Sema &S)
const;
549 bool isKnownToGCC()
const;
550 bool isSupportedByPragmaAttribute()
const;
562 bool slidesFromDeclToDeclSpecLegacyBehavior()
const;
569 unsigned getSemanticSpelling()
const;
574 switch (getParsedKind()) {
575 case ParsedAttr::AT_OpenCLConstantAddressSpace:
576 return LangAS::opencl_constant;
577 case ParsedAttr::AT_OpenCLGlobalAddressSpace:
578 return LangAS::opencl_global;
579 case ParsedAttr::AT_OpenCLGlobalDeviceAddressSpace:
580 return LangAS::opencl_global_device;
581 case ParsedAttr::AT_OpenCLGlobalHostAddressSpace:
582 return LangAS::opencl_global_host;
583 case ParsedAttr::AT_OpenCLLocalAddressSpace:
584 return LangAS::opencl_local;
585 case ParsedAttr::AT_OpenCLPrivateAddressSpace:
586 return LangAS::opencl_private;
587 case ParsedAttr::AT_OpenCLGenericAddressSpace:
588 return LangAS::opencl_generic;
590 return LangAS::Default;
598 case ParsedAttr::AT_OpenCLGlobalAddressSpace:
599 return LangAS::sycl_global;
600 case ParsedAttr::AT_OpenCLGlobalDeviceAddressSpace:
601 return LangAS::sycl_global_device;
602 case ParsedAttr::AT_OpenCLGlobalHostAddressSpace:
603 return LangAS::sycl_global_host;
604 case ParsedAttr::AT_OpenCLLocalAddressSpace:
605 return LangAS::sycl_local;
606 case ParsedAttr::AT_OpenCLPrivateAddressSpace:
607 return LangAS::sycl_private;
608 case ParsedAttr::AT_OpenCLGenericAddressSpace:
610 return LangAS::Default;
617 switch (getParsedKind()) {
618 case ParsedAttr::AT_HLSLGroupSharedAddressSpace:
619 return LangAS::hlsl_groupshared;
621 return LangAS::Default;
640 AvailabilityAllocSize =
644 TypeTagForDatatypeAllocSize =
661 InlineFreeListsCapacity =
662 1 + (AvailabilityAllocSize -
sizeof(
ParsedAttr)) /
sizeof(
void *)
665 llvm::BumpPtrAllocator Alloc;
669 SmallVector<SmallVector<ParsedAttr *, 8>, InlineFreeListsCapacity> FreeLists;
675 void *allocate(
size_t size);
698 void *allocate(
size_t size) {
699 return Factory.allocate(size);
703 Attrs.push_back(attr);
707 void remove(ParsedAttr *attr) {
708 assert(llvm::is_contained(Attrs, attr) &&
709 "Can't take attribute from a pool that doesn't own it!");
710 Attrs.erase(llvm::find(Attrs, attr));
713 void takePool(AttributePool &pool);
736 Factory.reclaimPool(*
this);
754 void *memory = allocate(
759 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
760 args, numArgs, form, ellipsisLoc));
770 const Expr *ReplacementExpr,
772 void *memory = allocate(AttributeFactory::AvailabilityAllocSize);
773 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
774 Param, introduced, deprecated, obsoleted,
775 unavailable, MessageExpr, form, strict,
776 ReplacementExpr, EnvironmentLoc));
783 void *memory = allocate(
787 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
788 Param1, Param2, Param3, form));
795 ParsedType matchingCType,
bool layoutCompatible,
797 void *memory = allocate(AttributeFactory::TypeTagForDatatypeAllocSize);
798 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
799 argumentKind, matchingCType,
800 layoutCompatible, mustBeNull, form));
809 void *memory = allocate(
813 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
814 typeArg, formUsed, ellipsisLoc));
822 void *memory = allocate(AttributeFactory::PropertyAllocSize);
823 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
824 getterId, setterId, formUsed));
831 using SizeType =
decltype(std::declval<VecTy>().size());
841 bool empty()
const {
return AttrList.empty(); }
842 SizeType
size()
const {
return AttrList.size(); }
848 AttrList.push_back(newAttr);
852 assert(is_contained(AttrList, ToBeRemoved) &&
853 "Cannot remove attribute that isn't in the list");
854 AttrList.erase(llvm::find(AttrList, ToBeRemoved));
859 struct iterator : llvm::iterator_adaptor_base<iterator, VecTy::iterator,
860 std::random_access_iterator_tag,
863 iterator(VecTy::iterator I) : iterator_adaptor_base(I) {}
868 : llvm::iterator_adaptor_base<const_iterator, VecTy::const_iterator,
869 std::random_access_iterator_tag,
879 AttrList.insert(AttrList.begin(), B.I,
E.I);
883 AttrList.insert(AttrList.begin(), B.I,
E.I);
887 AttrList.insert(AttrList.end(), B.I,
E.I);
891 AttrList.insert(AttrList.end(), B.I,
E.I);
901 return *AttrList.front();
905 return *AttrList.front();
909 return *AttrList.back();
913 return *AttrList.back();
917 return llvm::any_of(AttrList, [K](
const ParsedAttr *AL) {
923 auto It = llvm::find_if(AttrList, [](
const ParsedAttr *AL) {
926 if (It != AttrList.end())
938 : StringLiterals(StringLiteralBits) {}
941 if (I >= StringLiterals.size())
942 return StringLiterals.test(StringLiterals.size() - 1);
943 return StringLiterals.test(I);
947 std::bitset<32> StringLiterals;
966 assert(&
Other !=
this &&
967 "ParsedAttributes can't take attributes from itself");
969 Other.clearListOnly();
970 pool.takeAllFrom(
Other.pool);
974 assert(&
Other !=
this &&
975 "ParsedAttributes can't take attribute from itself");
976 Other.getPool().remove(PA);
993 ParsedAttr *
attr = pool.create(attrName, attrRange, scopeName, scopeLoc,
994 args, numArgs, form, ellipsisLoc);
1007 const Expr *ReplacementExpr,
1010 pool.create(attrName, attrRange, scopeName, scopeLoc, Param, introduced,
1011 deprecated, obsoleted, unavailable, MessageExpr, form,
1012 strict, ReplacementExpr, EnvironmentLoc);
1022 ParsedAttr *
attr = pool.create(attrName, attrRange, scopeName, scopeLoc,
1023 Param1, Param2, Param3, form);
1033 ParsedType matchingCType,
bool layoutCompatible,
1036 attrName, attrRange, scopeName, scopeLoc, argumentKind, matchingCType,
1037 layoutCompatible, mustBeNull, form);
1048 pool.createTypeAttribute(attrName, attrRange, scopeName, scopeLoc,
1049 typeArg, formUsed, ellipsisLoc);
1061 attrName, attrRange, scopeName, scopeLoc, getterId, setterId, formUsed);
1073 ParsedAttributes &
Result);
1125 std::enable_if_t<std::is_same<ACI, AttributeCommonInfo>::value,
int> = 0>
1128 DB.
AddTaggedVal(
reinterpret_cast<uint64_t
>(CI.getAttrName()),
1135 std::enable_if_t<std::is_same<ACI, AttributeCommonInfo>::value,
int> = 0>
1138 DB.
AddTaggedVal(
reinterpret_cast<uint64_t
>(CI->getAttrName()),
Defines the Diagnostic-related interfaces.
static Decl::Kind getKind(const Decl *D)
llvm::MachO::Target Target
Defines the clang::SourceLocation class and associated facilities.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const IdentifierInfo * getAttrName() const
Kind getParsedKind() const
A factory, from which one makes pools, from which one creates individual attributes which are dealloc...
ParsedAttr * create(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, ArgsUnion *args, unsigned numArgs, ParsedAttr::Form form, SourceLocation ellipsisLoc=SourceLocation())
ParsedAttr * createTypeTagForDatatype(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *argumentKind, ParsedType matchingCType, bool layoutCompatible, bool mustBeNull, ParsedAttr::Form form)
AttributePool(AttributePool &&pool)=default
Move the given pool's allocations to this pool.
AttributePool(AttributeFactory &factory)
Create a new pool for a factory.
ParsedAttr * create(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *Param1, IdentifierLoc *Param2, IdentifierLoc *Param3, ParsedAttr::Form form)
AttributePool & operator=(AttributePool &&pool)=delete
AttributePool(const AttributePool &)=delete
AttributeFactory & getFactory() const
ParsedAttr * createPropertyAttribute(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierInfo *getterId, IdentifierInfo *setterId, ParsedAttr::Form formUsed)
ParsedAttr * createTypeAttribute(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, ParsedType typeArg, ParsedAttr::Form formUsed, SourceLocation ellipsisLoc)
void takeAllFrom(AttributePool &pool)
Take the given pool's allocations and add them to this pool.
ParsedAttr * create(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *Param, const AvailabilityChange &introduced, const AvailabilityChange &deprecated, const AvailabilityChange &obsoleted, SourceLocation unavailable, const Expr *MessageExpr, ParsedAttr::Form form, SourceLocation strict, const Expr *ReplacementExpr, IdentifierLoc *EnvironmentLoc)
AttributePool & operator=(const AttributePool &)=delete
Decl - This represents one declaration (or definition), e.g.
@ ak_identifierinfo
IdentifierInfo.
This represents one expression.
One of these records is kept for each identifier that is lexed.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
ParsedAttr - Represents a syntactic attribute.
bool isPackExpansion() const
const AvailabilityChange & getAvailabilityDeprecated() const
ParsedAttr(ParsedAttr &&)=delete
LangAS asSYCLLangAS() const
If this is an OpenCL address space attribute, returns its SYCL representation in LangAS,...
IdentifierLoc * getArgAsIdent(unsigned Arg) const
bool hasParsedType() const
const AvailabilityChange & getAvailabilityIntroduced() const
void setInvalid(bool b=true) const
const ParsedAttrInfo & getInfo() const
bool hasMacroIdentifier() const
Returns true if this attribute was declared in a macro.
ParsedAttr & operator=(ParsedAttr &&)=delete
ParsedAttr & operator=(const ParsedAttr &)=delete
const Expr * getReplacementExpr() const
IdentifierInfo * getPropertyDataSetter() const
bool hasProcessingCache() const
SourceLocation getUnavailableLoc() const
unsigned getProcessingCache() const
const IdentifierLoc * getEnvironment() const
LangAS asOpenCLLangAS() const
If this is an OpenCL address space attribute, returns its representation in LangAS,...
const Expr * getMessageExpr() const
const ParsedType & getMatchingCType() const
const ParsedType & getTypeArg() const
SourceLocation getStrictLoc() const
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this attribute.
bool isArgIdent(unsigned Arg) const
Expr * getArgAsExpr(unsigned Arg) const
bool getMustBeNull() const
bool diagnoseMutualExclusion(class Sema &S, const Stmt *St) const
bool isUsedAsTypeAttr() const
bool isPragmaClangAttribute() const
True if the attribute is specified using '#pragma clang attribute'.
AttributeCommonInfo::Kind getKind() const
void setProcessingCache(unsigned value) const
SourceLocation getMacroExpansionLoc() const
ParsedAttr(const ParsedAttr &)=delete
bool isArgExpr(unsigned Arg) const
bool getLayoutCompatible() const
void setUsedAsTypeAttr(bool Used=true)
bool isDeclspecPropertyAttribute() const
Is this the Microsoft __declspec(property) attribute?
ArgsUnion getArg(unsigned Arg) const
getArg - Return the specified argument.
SourceLocation getEllipsisLoc() const
IdentifierInfo * getPropertyDataGetter() const
void setMacroIdentifier(IdentifierInfo *MacroName, SourceLocation Loc)
Set the macro identifier info object that this parsed attribute was declared in if it was declared in...
LangAS asHLSLLangAS() const
If this is an HLSL address space attribute, returns its representation in LangAS, otherwise returns d...
void setIsPragmaClangAttribute()
const AvailabilityChange & getAvailabilityObsoleted() const
IdentifierInfo * getMacroIdentifier() const
Return the macro identifier if this attribute was declared in a macro.
static const ParsedAttributesView & none()
const ParsedAttr & front() const
bool hasMSPropertyAttr() const
const ParsedAttr & back() const
const_iterator begin() const
const ParsedAttr * getMSPropertyAttr() const
void addAll(const_iterator B, const_iterator E)
void addAllAtEnd(const_iterator B, const_iterator E)
void addAtEnd(ParsedAttr *newAttr)
void addAll(iterator B, iterator E)
bool hasAttribute(ParsedAttr::Kind K) const
ParsedAttr & operator[](SizeType pos)
const_iterator end() const
void remove(ParsedAttr *ToBeRemoved)
const ParsedAttr & operator[](SizeType pos) const
void addAllAtEnd(iterator B, iterator E)
ParsedAttributes - A collection of parsed attributes.
ParsedAttr * addNew(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, ArgsUnion *args, unsigned numArgs, ParsedAttr::Form form, SourceLocation ellipsisLoc=SourceLocation())
Add attribute with expression arguments.
void takeOneFrom(ParsedAttributes &Other, ParsedAttr *PA)
ParsedAttr * addNew(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *Param1, IdentifierLoc *Param2, IdentifierLoc *Param3, ParsedAttr::Form form)
Add objc_bridge_related attribute.
AttributePool & getPool() const
ParsedAttributes & operator=(const ParsedAttributes &)=delete
ParsedAttr * addNewPropertyAttr(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierInfo *getterId, IdentifierInfo *setterId, ParsedAttr::Form formUsed)
Add microsoft __delspec(property) attribute.
ParsedAttributes(const ParsedAttributes &)=delete
void takeAllFrom(ParsedAttributes &Other)
ParsedAttributes(AttributeFactory &factory)
ParsedAttr * addNewTypeTagForDatatype(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *argumentKind, ParsedType matchingCType, bool layoutCompatible, bool mustBeNull, ParsedAttr::Form form)
Add type_tag_for_datatype attribute.
ParsedAttr * addNewTypeAttr(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, ParsedType typeArg, ParsedAttr::Form formUsed, SourceLocation ellipsisLoc=SourceLocation())
Add an attribute with a single type argument.
ParsedAttributes(ParsedAttributes &&G)=default
ParsedAttr * addNew(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *Param, const AvailabilityChange &introduced, const AvailabilityChange &deprecated, const AvailabilityChange &obsoleted, SourceLocation unavailable, const Expr *MessageExpr, ParsedAttr::Form form, SourceLocation strict, const Expr *ReplacementExpr, IdentifierLoc *EnvironmentLoc)
Add availability attribute.
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
void AddTaggedVal(uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const
Exposes information about the current target.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
SubjectMatchRule
A list of all the recognized kinds of attributes.
The JSON file list parser is used to communicate input to InstallAPI.
AttributeDeclKind
These constants match the enumerated choices of warn_attribute_wrong_decl_type and err_attribute_wron...
@ ExpectedFunctionMethodOrParameter
@ ExpectedFunctionWithProtoType
@ ExpectedFunctionMethodOrBlock
@ ExpectedTypeOrNamespace
@ ExpectedVariableFieldOrTag
@ ExpectedVariableOrField
@ ExpectedFunctionOrMethod
@ ExpectedVariableOrFunction
@ ExpectedFunctionVariableOrClass
llvm::PointerUnion< Expr *, IdentifierLoc * > ArgsUnion
A union of the various pointer types that can be passed to an ParsedAttr as an argument.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
void takeAndConcatenateAttrs(ParsedAttributes &First, ParsedAttributes &Second, ParsedAttributes &Result)
Consumes the attributes from First and Second and concatenates them into Result.
AttributeArgumentNType
These constants match the enumerated choices of err_attribute_argument_n_type and err_attribute_argum...
@ AANT_ArgumentIntegerConstant
@ AANT_ArgumentBuiltinFunction
@ AANT_ArgumentConstantExpr
@ AANT_ArgumentIdentifier
@ Result
The result type of a method or function.
LangAS
Defines the address space values used by the address space qualifier of QualType.
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
@ Other
Other implicit parameter.
Represents information about a change in availability for an entity, which is part of the encoding of...
VersionTuple Version
The version number at which the change occurred.
bool isValid() const
Determine whether this availability change is valid.
SourceLocation KeywordLoc
The location of the keyword indicating the kind of change.
SourceRange VersionRange
The source range covering the version number.
Wraps an identifier and optional source location for the identifier.
unsigned AttrKind
Corresponds to the Kind enum.
ParsedAttributeArgumentsProperties(uint32_t StringLiteralBits)
bool isStringLiteralArg(unsigned I) const
const_iterator(VecTy::const_iterator I)
reference operator*() const
reference operator*() const
iterator(VecTy::iterator I)
Describes the trailing object for Availability attribute in ParsedAttr.
AvailabilityData(const AvailabilityChange &Introduced, const AvailabilityChange &Deprecated, const AvailabilityChange &Obsoleted, SourceLocation Strict, const Expr *ReplaceExpr, const IdentifierLoc *EnvironmentLoc)
const IdentifierLoc * EnvironmentLoc
AvailabilityChange Changes[NumAvailabilitySlots]
PropertyData(IdentifierInfo *getterId, IdentifierInfo *setterId)
IdentifierInfo * GetterId
unsigned LayoutCompatible